- Short range radio modules
- Positioning chips and modules
u-blox Products
- Product selector
- Previous generations
- Contact sales
Find products
- Product documentation
Documentation
AT Command | Description |
|---|---|
Create Socket | |
Create Persistent Socket | |
Socket TLS | |
Socket Connect | |
Socket Persistent | |
Socket Persistent Remove | |
Socket Persistent List | |
Socket Receive Mode | |
Socket Write String | |
Socket Write Binary | |
Close socket | |
Read Socket String | |
Socket Read Binary | |
Socket Error | |
Socket Listen | |
Socket Read From | |
Socket Peer Address | |
Socket Status | |
Socket Options | |
Socket Host by Name |
AT Command | Description |
|---|---|
AT+USOCR=<protocol>[,<preferred_protocol_type>] | Creates a socket and associates it with the specified protocol (TCP or UDP). |
Response | Description |
|---|---|
+USOCR:<socket_handle> | Successful creation of socket. |
Parameter | Type | Description |
|---|---|---|
protocol | enumerator | IP protocol. Valid values: 6: TCP 17: UDP |
preferred_protocol_type | enumerator | Selects the IP address type to use. Valid values: 0: IPv4 address. 1: IPv6 address. Default value: 0 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
AT Command | Description |
|---|---|
AT+USOPCR=<protocol>[,<preferred_protocol_type>] | Creates a persistent socket and associates it with the specified protocol (TCP or UDP). A persistent socket will automatically re-connect when connection is lost. It can also be stored so that the connection initiated on boot. Notes: Can be stored using AT&W. |
Response | Description |
|---|---|
+USOPCR:<socket_handle> | Successful creation of persistent socket. |
Parameter | Type | Description |
|---|---|---|
protocol | enumerator | IP protocol. Valid values: 6: TCP 17: UDP |
preferred_protocol_type | enumerator | Selects the IP address type to use. Valid values: 0: IPv4 address. 1: IPv6 address. Default value: 0 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
AT Command | Description |
|---|---|
AT+USOTLS=<socket_handle>,<tls_version>[,<ca_name>[,<client_cert_name>,<client_key_name>]] | Add a TLS context to a socket. This is only valid for TCP client sockets. |
AT+USOTLS=<socket_handle> | Get the TLS context information for a socket. |
Response | Description |
|---|---|
+USOTLS:<socket_handle>,<tls_version>,<ca_name>,<client_cert_name>,<client_key_name> | Successful response with the TLS context information for the specified socket. The response includes the TLS version, CA name, client certificate name, and client key name. |
Parameter | Type | Description |
|---|---|---|
tls_version | enumerator | Minimum TLS version to use Valid values: 0: Disable TLS 1: TLS 1.2 or up |
ca_name | string | Name of the certificate authority (CA) certificate to use Valid length: 1..32 |
client_cert_name | string | Name of the client certificate to use Valid length: 1..32 |
client_key_name | string | Name of the private key for client certificate Valid length: 1..32 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
AT Command | Description |
|---|---|
AT+USOC=<socket_handle>,<host_address>,<remote_port> | Establish a peer-to-peer connection to the specified remote host on the given remote port. |
Parameter | Type | Description |
|---|---|---|
host_address | string | Remote host IP address or domain name of the remote host. Valid length: 0..128 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_port | integer | The port of the remote peer. Valid values: 1..65535 |
AT Command | Description |
|---|---|
AT+USOP=<socket_handle>,<host_address>,<remote_port> |
Parameter | Type | Description |
|---|---|---|
host_address | string | Remote host IP address or domain name. Valid length: 0..128 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_port | integer | The port of the remote peer. Valid values: 1..65535 |
AT Command | Description |
|---|---|
AT+USOPR=<config_id> |
Parameter | Type | Description |
|---|---|---|
config_id | integer | Configuration ID |
AT Command | Description |
|---|---|
AT+USOPL? | List all persistent socket configurations. |
Response | Description |
|---|---|
+USOPL:<socket_handle>,<host_address>,<remote_port> | The response for each persistent configuration. |
Parameter | Type | Description |
|---|---|---|
config_id | integer | Configuration ID. |
host_address | string | Remote host IP address or domain name of the remote host. Valid length: 0..128 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_port | integer | The port of the remote peer. Valid values: 1..65535 |
AT Command | Description |
|---|---|
AT+USORM=<read_mode> | Set the mode in which you would like to receive data in AT mode. Notes: Any created sockets or created persistent sockets will use the same receive mode as was configured when they were created Requires AT&W and a reboot before taking effect. |
AT+USORM? | Read the current receive mode |
Response | Description |
|---|---|
+USORM:<read_mode> | Successful read response |
Parameter | Type | Description |
|---|---|---|
read_mode | enumerator | Modes to read data in AT Valid values: 0: Buffered mode 1: Direct String mode 2: Direct Binary Mode |
AT Command | Description |
|---|---|
AT+USOWS=<socket_handle>,<string_data> |
Response | Description |
|---|---|
+USOWS:<socket_handle>,<written_length> | Successful write response. |
Parameter | Type | Description |
|---|---|---|
written_length | integer | Data length that was written. |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
string_data | string | Data encoded as ascii chars. Valid length: 0..1000 |
AT Command | Description |
|---|---|
AT+USOWB=<socket_handle>{binary_data} | Writes binary data to the specified socket in binary mode. |
Response | Description |
|---|---|
+USOWB:<socket_handle>,<written_length> | Successful write response. |
Parameter | Type | Description |
|---|---|---|
written_length | integer | Data length that was actually written to socket. |
binary_data | binary | The data to write. |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
AT Command | Description |
|---|---|
AT+USOCL=<socket_handle> | Closes the specified socket. The command blocks the AT command interface until the completion of the socket close operation. When this function returns OK the socket is cleaned up and fully closed. |
Parameter | Type | Description |
|---|---|---|
socket_handle | integer | Socket identifier to be used for any future operation on that socket. Valid values: 0..256 |
AT Command | Description |
|---|---|
AT+USORS=<socket_handle>,<length> | Reads the specified amount of data from the specified socket. Note that the data should include no null terminator characters. |
Response | Description |
|---|---|
+USORS:<socket_handle>,<length>,<string_data> | Successful read response. |
Parameter | Type | Description |
|---|---|---|
length | integer | Number of bytes to read. Valid values: 1..1000 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
string_data | string | Data encoded as ascii chars. Valid length: 0..1000 |
AT Command | Description |
|---|---|
AT+USORB=<socket_handle>,<length> | Reads the specified amount of data from the specified socket in binary mode. |
Response | Description |
|---|---|
+USORB:<socket_handle>{binary_data} | Successful read response. |
Parameter | Type | Description |
|---|---|---|
length | integer | Number of bytes to read. Valid values: 1..1000 |
binary_data | binary | The available data. Please note that the number of bytes may be less than requested. |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
AT Command | Description |
|---|---|
AT+USOE | Retrieves the last error that occurred in any socket operation, stored in the socket errno. |
Response | Description |
|---|---|
+USOE:<error_code> | Successful response. |
Parameter | Type | Description |
|---|---|---|
error_code | integer | BSD error code. See BSD standard for error code definitions. |
AT Command | Description |
|---|---|
AT+USOL=<socket_handle>,<port> | Sets the specified socket in listening mode on the specified port of service, waiting for incoming connections (TCP) or data (UDP). |
Parameter | Type | Description |
|---|---|---|
port | integer | Port of service, range 1-65535. Port numbers below 1024 are not recommended since they are usually reserved Valid values: 1..65535 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
AT Command | Description |
|---|---|
AT+USORF=<socket_handle>,<length> | Reads the specified amount of data from the specified UDP socket. |
Response | Description |
|---|---|
+USORF:<socket_handle>,<remote_ip>,<remote_port>,<length>,<string_data> | Successful read response. |
Parameter | Type | Description |
|---|---|---|
length | integer | Number of bytes to read. Valid values: 1..900 |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_ip | ip_addr | The ip address of the remote peer. |
remote_port | integer | The port of the remote peer. Valid values: 1..65535 |
string_data | string | Data encoded as ascii chars. Valid length: 0..1000 |
AT Command | Description |
|---|---|
AT+USOPA=<socket_handle> | Get the address of remote peer. |
Response | Description |
|---|---|
+USOPA:<socket_handle>,<remote_ip>,<remote_port> | Successful read response. |
Parameter | Type | Description |
|---|---|---|
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_ip | ip_addr | The ip address of the remote peer. |
remote_port | integer | The port of the remote peer. Valid values: 1..65535 |
AT Command | Description |
|---|---|
AT+USOST? | List status for all created sockets. |
AT+USOST=<socket_handle> | Get the status of a specific socket. |
Response | Description |
|---|---|
+USOST:<socket_handle>,<protocol>,<socket_status> | Response for each created socket. |
Parameter | Type | Description |
|---|---|---|
socket_status | enumerator | Valid values: 0: Not Connected 1: Listening 2: Connected |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
protocol | enumerator | IP protocol. Valid values: 6: TCP 17: UDP |
AT Command | Description |
|---|---|
AT+USOO=<socket_handle>,<option>,<value> | Set a socket option. See available options below. |
AT+USOO=<socket_handle>,<option> | Read a socket option for a socket |
Response | Description |
|---|---|
+USOO:<socket_handle>,<option>,<value> | Successful read response |
Parameter | Type | Description |
|---|---|---|
option | enumerator | Available options to set Valid values: 0: Turn on/off No delay feature for TCP sockets. Integer flag: 0 = off (i.e. Nagle algorithm enabled), 1 = on (i.e. Nagle algorithm disabled) Default: to 0 1: Set socket to be blocking or non blocking. Integer flag: 0 = off, 1 = on. Sockets are non-blocking by default (Note that read/write will always be non-blocking). Can only be set while the socket is in a non connected state. Note: Only valid for non-persistent TCP sockets, will have no effect on UDP sockets 2: Keep connections alive by sending keepalive probes. Integer flag: 0 = off, 1 = on. To calculate the keepalive time us this formula KeepIdle + (KeepIntvl * KeepCnt). Defaults to 1. Note: Only valid for TCP sockets. 3: Set Keep Idle value for the socket. This specifies the amount of time (in sec) that the connection must be idle before sending keepalive probes (if keepalive is enabled). Defaults to 3. Note: Only valid for TCP sockets. 4: Set keep alive interval value for the socket. This is the time in seconds between two successive keepalive retransmissions. Defaults to 3. Note: Only valid for TCP sockets. 5: Set keep alive counter value for the socket. The number of unanswered probes required to force closure of the socket. Defaults to 3. Note: Only valid for TCP sockets. |
value | integer | See option parameter |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
AT Command | Description |
|---|---|
AT+USOH=<host_name> | Does a DNS lookup of a host name and returns the IP address. |
Response | Description |
|---|---|
+USOH:<host_ip> | Successful read response. |
Parameter | Type | Description |
|---|---|---|
host_name | string | Name to lookup. Valid length: 0..128 |
host_ip | ip_addr | The ip address of the host. |
Unsolicited Response Code | Description |
|---|---|
Event Socket Connection | |
Event Socket Data Available | |
Event Socket Data String | |
Event Socket Data String From | |
Event Socket Data Binary | |
Event Socket Data Binary From | |
Event Socket Closed | |
Event Socket Incoming Connection |
+UESOC:<socket_handle>Parameter | Type | Description |
|---|---|---|
socket_handle | integer | Socket identifier be used for any operation on that socket. |
+UESODA:<socket_handle>,<number_bytes>Parameter | Type | Description |
|---|---|---|
number_bytes | integer | Number of bytes available to read. If socket is a UDP socket this number refers to the size of the next datagram. |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
+UESODS:<socket_handle>,<string_data>Parameter | Type | Description |
|---|---|---|
socket_handle | integer | Socket identifier be used for any operation on that socket. |
string_data | string | Data encoded as ascii chars. Valid length: 0..1000 |
+UESODSF:<socket_handle>,<remote_ip>,<remote_port>,<string_data>Parameter | Type | Description |
|---|---|---|
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_ip | ip_addr | The ip address of the remote peer. |
remote_port | integer | The port of the remote peer. Valid values: 1..65535 |
string_data | string | Data encoded as ascii chars. Valid length: 0..1000 |
+UESODB:<socket_handle>{binary_data}Parameter | Type | Description |
|---|---|---|
binary_data | binary | The received data. |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
+UESODBF:<socket_handle>,<remote_ip>,<remote_port>{binary_data}Parameter | Type | Description |
|---|---|---|
binary_data | binary | The received data. |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_ip | ip_addr | The ip address of the remote peer. |
remote_port | integer | The port of the remote peer. Valid values: 1..65535 |
+UESOCL:<socket_handle>Parameter | Type | Description |
|---|---|---|
socket_handle | integer | Socket identifier be used for any operation on that socket. |
+UESOIC:<socket_handle>,<remote_ip>,<listening_socket_handle>Parameter | Type | Description |
|---|---|---|
listening_socket_handle | integer | The handle of the new connected socket. Use this for any further operations on the connection. |
socket_handle | integer | Socket identifier be used for any operation on that socket. |
remote_ip | ip_addr | The ip address of the remote peer. |