Service name | Port | Notes | Example |
---|---|---|---|
TCP | UDP | 7 |
TCP
AT+USOCR=6
AT+USOCO=0,"18.196.19.141",7 AT+USORD=0,100 AT+USOWR=0,5,"HELLO" AT+USORD=0,5
UDP
AT+USOCR=17
AT+USOST=0,"18.196.19.141",7,5,"HELLO" AT+USORF=0,5 |
|
TLS | 51000 | Server authentication. Use root CA cert: ISRG Root X1. |
Download certificate to module FS
AT+USECMNG=1,0,"isrgrootx1.pem","isrgrootx1.pem" AT+USECPRF=0 AT+USECPRF=0,3,"isrgrootx1.pem" AT+USOCR=6 AT+USOSEC=0,1,0 AT+USOCO=0,"18.196.19.141",51000 AT+USORD=0,100 AT+USOWR=0,5,"HELLO" AT+USORD=0,5 |
DTLS | 52000 |
Server authentication. Use root CA cert: ISRG Root X1. Sequential, one client at a time (automatically closed after about 2 mins inactivity). |
Download certificate to module FS
AT+USECMNG=1,0,"isrgrootx1.pem","isrgrootx1.pem" AT+USECPRF=0 AT+USECPRF=0,3,"isrgrootx1.pem" AT+USOCR=17 AT+USOSEC=0,1,0 AT+USOCO=0,"18.196.19.141",52000 AT+USOWR=0,5,"HELLO" AT+USORD=0,5 |
Delay | Truncate UDP | 7 |
ECHO back the messages with specified delay, size, and number of retransmission. To use this functionality the structure of the message need to be the following: UBX-ECHO[Delay][Delay][Size][Repeat][Message]
In m-center the message can be sent as:
|
Example with "UBX-ECHO\08\00\02\02Hello World":
- delay of "\08\00"[Hex] = 2048[Dec] --> 2048 * 0.002 = 4.096 sec - size of the echo "\02"[Hex] --> only "He" of "Hello World" is echoed - sending "\02"[Hex] echos. AT+USOCR=17 AT+USOST=0,"18.196.19.141",7,17 @ UBX-ECHO\08\00\02\02Hello World AT+USORF=0,2 |
Custom TCP connection | 7 |
Init a new TCP connection with custom timeout and echo limit. To use this functionality the structure of the message need to be the following: UBX-CUSTOM[Timeout][EchoLimit]{Message}
|
Example:
- configure a timeout of 30 seconds - and an echo limit of 2000 bytes. AT+USOCR=6 AT+USOCO=0,"18.196.19.141",7 AT+USOWR=0,18,"UBX-CUSTOM00302000" |
These APIs work only in secure (port 443) mode.
Be sure to use the root CA certificate ISRG Root X1.
Following is an example of HTTP client initialization.
Method | Endpoint | Notes | Example |
---|---|---|---|
HEAD / GET |
|
HEAD / GET a resource. GET returns the list of parameters passed in the request. HEAD returns only the headers (no body). |
(HEAD) AT+UHTTPC=0,0,"/api/test/get","response"
(GET) AT+UHTTPC=0,1,"/api/test/get","response" |
POST |
|
POST text raw data in the request Body (Content-Type: text/plain). Returns the data sent. |
AT+UHTTPC=0,5,"/api/test/post_data","response","POST test",1
|
|
POST form data in the request Body (Content-Type: application/x-www-form-urlencoded or multipart/form-data). Returns the form parameters sent. |
AT+UHTTPC=0,5,"/api/test/post_form","response","a=5&&b=10",0
|
|
|
POST a file in the request Body (Content-Type: multipart/form-data). Returns the file names sent. |
AT+UHTTPC=0,4,"/api/test/post_file","response","file_to_send",3
|
|
PUT |
|
PUT text raw data in the request Body (Content-Type: text/plain). Returns the data sent. |
Not possible to send raw data in PUT |
|
PUT a file in the request Body (Content-Type: multipart/form-data). Returns the file names sent. |
AT+UHTTPC=0,3,"/api/test/put_file","response","file_to_send",3
|
|
DELETE |
|
DELETE a resource. Returns the list of parameters passed in the request. |
AT+UHTTPC=0,2,"/api/test/delete","response"
|
DOWNLOAD |
|
GET a file fromm the server. Returns a file from the server. Available <file_name>s are:
|
AT+UHTTPC=0,1,"/download/<file_name>","response"
|
Service name | Port | Notes | Example |
---|---|---|---|
Plain MQTT | 1883 | ||
MQTT + TLS | 8883 | Mutual authentication. | |
MQTT over WebSockets | 1884 | ||
MQTT + TLS over WebSockets | 8884 | Mutual authentication. |
Service name | Port | Notes | Example |
---|---|---|---|
Plain MQTT-SN | 1885 | See https://wiki.u-blox.com/bin/view/Generic/AECelMQTTSNAWS |