Telit xE910 AT Interface
The Telit family of 910 modules have been updated to include native support for interfacing applications to the deviceWISE Cloud. This API lets you use a new set of AT commands to easily expand the capabilities of any device built upon a Telit 910 family module.
The ME910 does not support AT Commands
Supported modules:
- LE910
- HE910
- UE910
- GE910
Supports most TR50 commands.
Can only authenticate using application tokens, you cannot connect using user credentials.
// set the APN for the modem.
AT+CGDCONT=1,"IP","internetm2m.air.com"
// start the PDP context (IP connection)
AT#SGACT=1,1
// configure the connection to the deviceWISE Cloud
// settings are saved in NVM, so this needs to be set only once.
AT#DWCFG=open-api.devicewise.com,0,b2Z4JLWY3d8K8Ome
// connect to the deviceWISE Cloud
AT#DWCONN=1
// send a property.publish API call to submit "temp" property data.
AT#DWSEND=0,property.publish,key,temp,value,22.5
API Reference
#DWCFG – configure deviceWISE parameters | ||
---|---|---|
AT#DWCFG=[<serverUrl>[,<deviceIDSelector>[,<appToken>[,<security>[,<heartBeat>[,<autoReconnect>[,<overflowHandling>[,<atrunInstanceId>[,<serviceTimeout>[,<unused_1>[,<unused_2>[,<unused_3>]]]]]]]]]]]] | This command sets the parameters related to the deviceWISE functionality Parameters: <serverUrl> - String parameter indicating the URL of the deviceWISE Cloud instance in address:port form. <deviceIDSelector> 0 – 1 (0=IMEI 1=CCID/ESN), basically 0 if not SIM card or CDMA ID installed <appToken> - The secure application token provided in the Management Portal, typically a string of 16 characters.. <security> - Flag indicating if the SSL encryption is enabled. 0 – SSL encryption disabled (default) 1 – SSL encryption enabled If SSL encryption enabling is required, some initial settings have to be done as follows. For further details, refer to “SSL/TLS User Guide”. SSL channel has to be enabled as follows: AT#SSLEN=1,1 OK If server authentication is needed, #SSLSECCFG has to be set as follows: AT#SSLSECCFG=1,0,1,0 OK Then, CA Certificate(DER format) has to be stored as follows: AT#SSLSECDATA=1,1,1,<size> > …………………. // store CA Certificate OK Only the configuration SSL commands listed above are admitted. DW connection in secure mode cannot be used contemporarily to any command starting an SSL connection (including SSL sockets, FTPS, secure SMTP and HTPS). <heartBeat> - If no packets are received in the number of seconds specified in the heartbeat field, a heartbeat message will be sent to keep the connection alive. Default: 60 Range: 10 - 86400 <autoReconnect> - Flag indicating if the connection manager should automatically reconnect to the service. 0 – auto-reconnect disabled 1 – auto-reconnect lazy - reconnect on next send and every 3600 seconds. 2 – auto-reconnect moderate (default) - reconnect 120 seconds, then every 3600 seconds after the first day. 3 – auto-reconnect aggressive - reconnect every 120 seconds. <overflowHandling> - Flag indicating if the way to handle overflows in data management. 0 – FIFO (default) 1 – LIFO <atrunInstanceId> - AT instance that will be used by the service to run the AT Command. Default 4 Range 0 – 4 <serviceTimeout> - It defines in seconds the maximum time interval for a servce request to the server. Default 5 Range 1 – 120 |
|
AT#DWCFG? |
Read command returns the current settings in the format: #DWCFG: <serverUrl>,<deviceIDSelector>,<appToken>,<security>,<heartBeat>,<autoReconnect>,<overflowHandling>,<atrunInstanceId>,<serviceTimeout>,0,0,0 |
|
AT#DWCFG=? |
Test commandreturns the supported range of parameters <deviceIDSelector>, <security>, <heartBeat>, <AutoReconnect>, <atrunInstanceId> and <serviceTimeout> and the maximum length of <serverUrl> and <appToken> parameters. |
#DWCONN – connect to the deviceWISE Cloud | ||
---|---|---|
AT#DWCONN=<connect> |
Set command connects/disconnects to the deviceWISE Cloud.\ Parameters: <connect> - flag to connect/disconnect to the deviceWISE Cloud
|
|
AT#DWCONN? |
Read command returns the current settings for all parameters in the format: #DWCONN: <connect>>,<status> Where: <connect> is defined as above <status> is the real connection status. Values:
|
|
AT#DWCONN=? |
Test command reports the supported range of values for all parameters |
#DWSTATUS – query connection status | ||
---|---|---|
AT#DWSTATUS |
Execution command returns the status of the connection, including some runtime statistics. Note, all statistics should be stored in RAM, not NVM.
The Cloud will return a generic structure
#DWSTATUS: <connected><lastErrorCode>,<latency>,<pktsIn>,<pktsOut>,<bytesIn>,<bytesOut> <connected> : 3 = waiting to connect, 2 = connected, 1 = trying to connect, 0 = disconnected <lastErrorCode>: last error code encountered by the client <latency> : milliseconds measured between last request and reply. <pktsIn> : number of packets received, tracked by the server <pktsOut> : number of packets sent. <bytesIn> : number of bytes received, TCP/IP payload <bytesOut> : number of bytes sent. |
|
AT#DWSTATUS=? |
Test command reports OK result code |
#DWSEND – send data to the deviceWISE Cloud |
||
---|---|---|
AT#DWSEND=<type>,<param_1>[,<param_2>[,…[<param_n>]]] | Execution command permits to send formatted data to the deviceWISE Cloud. Parameters: <type> - type code for the type of message to send. (0 for normal request, 1 for method request, 2 for method update, 3 for method acknowledgement)
Type 0 message format: <param_1> - command – the api command to execute. <param_i> - string parameter indicating the i-th parameter
Type 1 message format: <param_1> - “thingKey” – the key of a thing to execute. <param_2> - timeout – time to wait in seconds before returning an error for the request. <param_3> - method – the method key of a thing to execute. <param_4> - is singleton – 0 or 1. 1 if no more than one of these instance can exist. <param_5+> - parameters for the method. String parameter indicating the i-th parameter, with i=1,…,20.
Type 2 message format: <param_1> - id – the identification of the method instance. <param_2> - message – a message represents the current status of the method.
Type 3 message format: <param_1> - id – the identification of the method instance. <param_2> - status – the integer result status for the execution. 0 is reserved for OK. <param_3 when status is set to non-zero> - error message associates with the status. <param_3 when status is set to zero> - return parameters for the method. Key value pair should be used. param_i should be the name of the element and param_i+1 should be the value of the element.
|
|
AT#DWSEND=? | Test command reports the maximum length of <type> parameter. |
#DWSENDR – send raw data to the deviceWISE Cloud |
||
---|---|---|
AT#DWSENDR=<dataLen> |
Execution command permits to send raw data to the deviceWISE Cloud. Content must be valid JSON.
Parameters: <dataLen> - number of bytes to be sent Range: 1 - 1500
The module responds to the command with the prompt <greater_than><space> and waits for the data to send. When <dataLen> bytes have been sent, operation is automatically completed. If data are successfully sent, then the response is OK. If data sending fails for some reason, an error code is reported. The response to the AT#DWSENDR command reports the <msgId> value that identifies the sending. There is also a limit of 20 messages on the receive queue. If the queue is full, the consequent send will still succeed but the response for that particular request will be dropped until an item is removed from this queue (See command AT#DWRCV and AT#DWRCVR). Note: it’s possible to use AT#DWSENDR only if the connection has been opened with AT#DWCONN |
|
AT#DWSENDR=? |
Test command reports the supported range of values for <dataLen> parameter |
#DWRCVR – Receive data from the deviceWISE Cloud | ||
AT#DWRCV=<msgId> |
Execution command permits the user to read formatted data arriving from the deviceWISE Cloud; the module is notified of these data by the URC #DWRING.
Parameters: <msgId> - index of the data message to receive, as indicated in the URC #DWRING Range: >=1
If the data received are the consequence of a previous data sending issued by AT#DWSEND, then the <msgId> value is the same of the <msgId> value reported in the answer of AT#DWSEND.
The incoming Server data are notified by the URC #DWRING with the following format:
#DWRING: <type>,<msgId>,<len> where: <type> - type of message to receive <msgId> - index of the data message to receive <len> - length of data message to receive
If the incoming data are accepted with AT#DWRCV, then the formatted data are received and showed with the following URC:
#DWDATA: <msgId>,<error>,<len>,<param_1>[,<param_2>[,…[,<param_n>]]] where: <msgId> - defined as above <error> - error code of the message to receive, 0 if there is no error. <len> - defined as above <param_i> - string parameter indicating the i-th parameter associated to the type specified It is possible to use AT#DWRCV only if the connection has been opened with AT#DWCONN, else the ME is raising an error. If the data received are the consequence of a previous data sending issued by AT#DWSEND, then they can be read only using AT#DWRCV command and not AT#DWRCVR command (i.e.: AT#DWRCV and AT#DWRCVR are not interchangeable). |
|
AT#DWRCV=? |
Test command reports the supported range of values for all parameters. |
#DWRCVR – Receive raw data from service | ||
AT#DWRCVR=<msgId> | Execution command permits the user to read raw data arriving from the MdeviceWISE Cloud; the module is notified of these data by the URC #DWRING.
Parameters: <msgId> - index of the data message to receive, as indicated in the URC #DWRING Range: >=1 If the data received are the consequence of a previous data sending (issued by AT#DWSENDR), then the <msgId> value is the same of the <msgId> value reported in the answer of AT#DWSENDR. The incoming Server data are notified by the URC #DWRING with the following format: #DWRING: <type>,<msgId>,<len> where: <type> - type of the data message to receive <msgId> - index of the data message to receive <len> - length of data message to receive
If the incoming data are accepted with AT#DWRCVR, then the data are received and showed with the following URC:
#DWRDATA: <msgId>,<len>,<data> where: <msgId> - defined as above <error> - error code of the message to receive, 0 if there is no error. <len> - defined as above <data> - data from the deviceWISE Cloud It is possible to use AT#DWRCVR only if the connection has been opened with AT#DWCONN, else the ME is raising an error. If the data received are the consequence of a previous data sending issued by AT#DWSENDR, then they can be read only using AT#DWRCVR command and not AT#DWRCV command (i.e.: AT#DWRCV and AT#DWRCVR are not interchangeable). |
|
AT#DWRCVR=? |
Test command reports the supported range of values for all parameters. |
#DWLRCV – List information on messages pending from the deviceWISE Cloud | ||
AT#DWLRCV | Execution command permits the user to obtain information regarding the messages pending from the deviceWISE Cloud in the following format:
#DWLRCV: <msg_number>[,<msgId_1>,<msg_1_len>[,<msgId_2>,<msg_2_len>[,……<msgId_n>,<msg_n_len>]]]
where: <msg_number> - number of messages pending from the deviceWISE Cloud Range: >=0 <msgId_i> - index of the i-th data message to receive <msg_i_len> - length of the i-th data message to receive
It is possible to use AT#DWLRCV only if the connection has been opened with AT#DWCONN, else the ME is raising an error. |
|
AT#DWLRCV=? | Test command reports OK result code |
#DWEN – enable agent features | ||
AT#DWEN=<feat>,<en>[,<option1>[,<option2>[,<option3>[,<option4>[,<option5>]]]]] | Set command permits to enable/disable up to 8 different deviceWISE features.
Parameters: <feat> - feature to enable or disable; range (0-7) 0 – remote at commands 1 – location reporting 2 … 7 – reserved for future use. <en> - enable or disable the features 0 – disable the feature 1 – enable the feature <optionX> where X=1,..,5 - optional parameters depending on the feature (string) Note: feature 0 (Remote AT commands) has no option. The <en> value is considered only at the very first connection to deviceWISE Cloud (AT#DWCONN=1) after a device power on or reboot. |
|
AT#DWEN? |
Read command returns the current settings for each feature in the format: #DWEN: <feat>,<en>,<option1>,<option2>,<option3>,<option4>,<option5> |
|
AT#DWEN=? | Test command reports the supported range of values for parameters <feat> and <en> and the maximum length of <optionX> (where X=1,..,5) parameters |
Configuring the API
Before you can connect to the platform, it is important to configure the API so that it connects to the correct instance of the deviceWISE Cloud, and has the correct security credentials to connect to your account. To configure the API, there are two AT commands (AT#DWCFG & AT#DWEN) that must be set prior to issuing a connect (AT#DWCONN). Calling of the configuration APIs only needs to occur once, as the settings are persisted in NVM (non-volatile memory), so any settings will persist across loss of power to the module. You should always call both of these APIs prior to establishing a connection. When in doubt, do not specify optional parameters.
Remote AT Support
One special feature of the API is the ability to enable remote AT command support in the deviceWISE Cloud. Using the Remote AT support, you can execute AT commands via the deviceWISE Cloud to diagnose connection issues or perform remote configuration changes with ease. To enable this function, you need to call "AT#DWEN=0,1" to enable this support. Enabling or disabling the feature only takes effect when the connection is established.
There is no limit on the length of the single <param_i>, but there is a limit in the total length of the AT command string, that cannot exceed 400 characters. If this threshold is exceeded, then an ERROR is raised.
There is also a limit of 20 messages on the receive queue. If the queue is full, the consequent send will still succeed but the response for that particular request will be dropped until an item is removed from this queue (See command AT#DWRCV and AT#DWRCVR).