This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Sending UDP using the Serial LTE Modem application - AT sequence

Hi

I have upgraded from an early version of SLM to the latest version in nRF Connect SDK ver. 1.3.1

the SLM application is running on a custom board with a nRF52840. Using the old version of SLM, the following commands resulted in successful communication:

  

at#xsocket=1,2
at#xudpsendto="xx.xxx.xx.xxx",xxxx,"testing"
at#xudprecvfrom="xx.xxx.xx.xxx",xxxx,100,1
at#xsocket=0

What is the correct sequence of AT commands in the new version? And is there some documentation on available commands in the SLM application?

Parents Reply Children
  • Hi Bard,
    We are working on improving the documentation to explain this better.

    #XSENDTO UDP send data Send data via UDP channel
    #XSENDTO=<url>,<port>,<datatype>,<data>
    Response:
    #XSENDTO: <size>
    <url> values String type, hostname or IP address
    Max 128 bytes. In case of IP address, IPv4 only, not support IPv6
    <port> values Integer, UDP service port
    <datatype> values 0 - hexidecimal string format, e.g. "DEADBEEF" for 0xDEADBEEF
    1 - plain text (default value)
    2 - Json
    3 - HTML
    4 - OMA TLV
    <data> values String type, arbitary data
    NOTE1 max NET_IPV4_MTU (576) bytes
    NOTE2 no NULL char in the middle
    <size> values Integer type, actual number of bytes sent
    example AT#XSENDTO="test.server.com",1234,"Test UDP"
    #XSENDTO: 8
    OK
    #XRECVFROM UDP receive data Receive data via UDP channel
    #XRECVFROM=<url>,<port>[,<size>]
    NOTE receive max NET_IPV4_MTU(576) bytes
    Response:
    <data>
    #XRECVFROM: <datatype>, <size>
    <url> values String type, hostname or IP address
    Max 128 bytes. In case of IP address, IPv4 only, not support IPv6
    <port> values Integer, UDP service port
    <size> values Requested number of bytes in command, , NET_IPV4_MTU if not specified
    Actual number of bytes received in response
    <datatype> values See #XSEND command
    example AT#UDPRECVFROM="test.server.com",1234
    Test OK
    #XRECVFROM: 1, 7
    OK
Related