MESSAGING


Commands that allow the sending of alerts or messages:




SEND EMAIL


Send an email through SMM Server, which must be active and reachable.


Command

AT#EMAIL=<rcpt>,<subject>[,<body>][,<icon>]

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERS

<rcpt>

RECIPIENT'S EMAIL ADDRESS

GROUP NAME YOU WANT TO SEND TO ALL MEMBERS


<subject>

SUBJECT OF THE MESSAGE, CAN INCLUDE TAGS


<body>

OPTIONAL BODY OF THE MESSAGE, CAN INCLUDE TAGS


<icon>

OPTIONAL ICON TO BE SHOWN WITHIN THE MESSAGE


The body field can contain free text within which the use of TAGs is allowed, or it may contain preformatted information composed by the SMM server specifying the following keywords:

  • LOG: send the log file stored in the cloud account
  • MAP: send the device map stored in the cloud account


When the device map is sent, it is possible to specify the identifier of an icon to show, selected among the available ones, see EMAIL ICON


It is possible to send email with attachment using AT#HTTP command properly defined:

AT#HTTP=POST,webadmin.mobi/ava/$D13/$D07/<1>/<2>,<3>

PARAMETERS

<1>

RECIPIENT'S EMAIL ADDRESS


<2>

SUBJECT OF THE MESSAGE, CAN INCLUDE TAGS


<3>

COMPLETE PATH OF THE FILE TO BE ATTACHED

AT#HTTP=POST,webadmin.mobi/ava/$D13/$D07/my@email.com/Text,S:LOGS/mylog.log


NOTE: to prevent abuse and increase safety, the email will be sent only to email addresses stored in Avior user list.

SEND CHAT MESSAGE


Sends a Telegram chat message through the SMM Server, which must be active and reachable.


Command

AT#TGM=<rcpt>,<text>,<type>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERS

<rcpt>

RECIPIENT'S PHONE NUMBER

GROUP NAME YOU WANT TO SEND TO ALL MEMBERS


<text>

TEXT OF THE MESSAGE, CAN INCLUDE TAGS


<type>

M : SIMPLE TEXT MESSAGE

G : TEXT MESSAGE INCLUDING GEO INFO

S : TEXT MESSAGE INCLUDING DEVICE STATUS

L : TEXT MESSAGE INCLUDING SYSTEM LOG

K : TEXT MESSAGE INCLUDING ON/OFF KEYBOARD

P : TEXT MESSAGE INCLUDING PULSE KEYBOARD

B : TEXT MESSAGE INCLUDING CUSTOM KEY

Q : TEXT MESSAGE AS QRCODE


The recipient's number must be entered in international format.

For the chat message format options, see TELEGRAM.

SEND TO COM PORT


Send a text to the com port.


Command

AT#COM=<text>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERS

<text>

TEXT TO SEND TO LOCAL COM PORT

SEND MESSAGE TO LAN DEVICE


Send a message to a device, identified with WebID, that shares the same local area network (LAN).


Command

AT#DLAN=<webid>,<text>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETER

<webid>

IDENTIFIER OF REMOTE DEVICE


<text>

TEXT OF THE MESSAGE, CAN INCLUDE TAGS


To play tone 1 on device identified with WebID 3xc11b within same LAN, text must include the password of remote device to deploy the command:

AT#DLAN=3xc11b,"0000 at#spk=1"

OK

SEND MESSAGE TO WAN DEVICE


Send a message to a remote device, identified with WebID, through the SMM Server, which must be active and reachable.


Command

AT#DWAN=<webid>,<text>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETER

<webid>

IDENTIFIER OF REMOTE DEVICE


<text>

TEXT OF THE MESSAGE, CAN INCLUDE TAGS


To activate the output 4 of remote device identified by WebId 3wa59c, text must include the password of remote device to deploy the command:

AT#DWAN=3wa59c,"0000 out4=1"

OK

HTTP REQUEST


Make an HTTP request to the specified address, a data connection must be available.


Command

AT#HTTP=<method>,<url>[,<data>]

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETER

<method>

GET | POST | PUT | DELETE


<url>

DESTINATION URL


<data>

TEXT TO POST, CAN INCLUDE TAGS or

COMPLETE PATH AND FILE NAME TO SEND CONTENT


The response returned by the server is always ignored.

It is possible to include a custom tag X-command within the header of the response, any command found in its value will be executed.


NOTE: It is possible to execute HTTPS (HTTP Secure) only via WiFi network (firmware version 02.28 or above) and via 4G modem (firmware version 01.21 or above). 2G modem doesn't support HTTPS request: they will be made as HTTP request.


A SWAP AREA is made available for each unit to upload/download free content. Available size is limited to 200k.

SEND MESSAGE TO BLE DEVICE


Send a message to the currently connected BLE device.

The command has no effect if no BLE device is connected.


Command

AT#BTM=<text>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETER

<text>

TEXT TO SEND, CAN INCLUDE TAGS


When Avior operates as ADVERTISER it is recognized by nearby BLE devices that may request connection that will be granted only if the BLE device identifier is stored as a user.

CLOSE THE BLE CONNECTION


Close the connection with the BLE device.

The command has no effect if no BLE device is connected.


Command

AT#BTH

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED


The connection to the BLE device is automatically closed, anyway,  after 20 seconds of inactivity.

SEND UDP MESSAGE


Send a message using UDP protocol to specified IP address and port.

Available for 4G units only.


Command

AT#UDP=<ipaddress>,<port>,<text>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERs

<ipaddress>

DESTINATION IP ADDRESS


<port>

DESTINATION UDP PORT


<text>

MESSAGE TO BE SENT


Send message "Hello Avior" to IP address 123.130.140.150 port 1234:

AT#UDP=123.130.140.150,1234,"Hello Avior"

OK


PUBLISH MQTT MESSAGE


Publish an MQTT message to broker, specifying topic, payload and QoS.


Command

AT#MQTT="<topic>","<payload>","<qos>"

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERs

<topic>

MESSAGE TOPIC, CAN INCLUDE TAGS


<payload>

MESSAGE PAYLOAD, CAN INCLUDE TAGS

OR COMPLETE PATH AND FILE NAME TO SEND CONTENT


<qos>

QUALITY OF SERVICE


If a message is successfully published an MQT event is triggered.


Publish text "gate is open" to topic "mytopic/home/garage" with QoS=1:

AT#MQTT="mytopic/home/garage","gate is open",1


Publish text with tags ($D01 is the device identifier, $I12 is the status of digital input 1 and $O42 is the status of output 4) with QoS=0:

AT#MQTT="mydevice/$D01","in1=$I12 and out4=$O42",0


Publish file located in SDcard S:LOGS/data.log to topic "system/file:

AT#MQTT="system/file",S:LOGS/data.log,1

MODBUS RTU READ REQUEST


Read Modbus RTU data from COM port.


ComMAnd

AT#RTUR=<slaveAddr>,<functCode>,<startReg>,

<numReg>,<dataType>,[<options>],<dest>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERS

<slaveAddr>

ADDRESS OF MODBUS SLAVE

1 ... 247


<functCode>

MODBUS FUNCTION CODE

1 : READ COILS

2 : READ DISCRETE INPUTS

3 : READ HOLDING REGISTER

4 : READ INPUT REGISTERS


<startReg>

STARTING REGISTER

0 ... 65535


<numReg>

NUMBER OF DATA TO BE READ

1 ... 32


<dataType>

DATA TYPE

B: BIT (for function code 1 e 2)

W: WORD - 16 bit (for function code 3 e 4)

D: DOUBLE - 32 bit (for function code 3 e 4)

F: FLOAT - IEEE754 (for function code 3 e 4)


<options>

READ OPTONS (CAN BE EMPTY)

S: data interpreted as a signed numbers (dataType W and D)

I: endianess inversiom (dataType D)

SI: both options above


<dest>

DESTINATION OF READ DATA (WHERE TO SAVE)

E01 ... E32


<dest> indicates the position of the first read data, following data are saved in next positions. Thus, if 4 data are read and destination is E06, the data are saved in E06, E07, E08, E09.

Returns ERROR if number of data to be read exceed E32 position.


AT#RTUR=8,1,5,2,B,,E04

Read request with following parameters:

- slave address: 8

- function code: 1 (lettura di coils)

- starting modbus register: 5

- number of coils to read: 2

- data type: BIT

- options: none

- destination: E04 (stored in E04, E05, E06, E07, E08)


AT#RTUR=9,3,6,1,W,S,E01

Read request with following parameters:

- slave address: 9

- function code: 3 (lettura di holding register)

- starting modbus register: 6

- number of register to read: 1

- data type: WORD (16bit)

- options: S data to be treated as signed number

- destination: E01


AT#RTUR=123,4,8,3,D,,E14

Read request with following parameters:

- slave address: 123

- function code: 4 (lettura di input register)

- starting modbus register: 8

- number of data to read: 3

- data type: DOUBLEWORD (32bit = 6 registri modbus da16bit)

- options: none, data composed taking two registers

- destination: E14 (saved in E14, E15, E16)

MODBUS RTU WRITE REQUEST


Write Modbus RTU data to COM port.


ComMand

AT#RTUW=<slaveAddr>,<functCode>,<Reg>,<data>

Response

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERS

<slaveAddr>

ADDRESS OF MODBUS SLAVE

1 ... 247


<functCode>

MODBUS FUNCTION CODE

5  : WRITE COIL

6  : WRITE 1 HOLDING REGISTER

16 : WRITE 2 HOLDING REGISTERS



<Reg>

STARTING REGISTER (TO BE WROTE)

0 ... 65535


<data>

VALUE TO BE WRITTEN, CAN INCLUDE TAG

0|1: FOR COIL

0...65535: FOR WORD

0...4294967294: FOR DOUBLE


AT#RTUW=3,5,2,1

Write request with following parameters:

- slave address: 3

- function code: 5 (write single coil)

- modbus register to be written: 2

- data to be written: 1 (set coil)


AT#RTUW=77,6,3456,$V11

Write request with following parameters:

- slave address: 77

- function code: 6 (write holding register)

- modbus register to be written: 3456

- data to be written: value of variabile "var1" ($V11)


AT#RTUW=207,16,521,$E30

Write request with following parameters:

- slave address: 207

- function code: 16 (write 2 holding registers, 32 bit)

- modbus register to be written: 521

- data to be written: content of E30 ($E30)