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

Illustration of sending data over UDP with the Thingy:91/nRF9160-dk's modem

Would it be possible to illustrate what AT commands would be required to set up and send a UDP packet for the nRF9160, including configuring the modem, turning the modem on, connecting to LTE etc? As a newcomer to the modem, it is tricky to understand the AT command sequence required. Thanks for any help.

Parents
  • Hi!

    Of course! To use AT commands for this you will need to be running the Serial LTE Modem application available in NCS, which has support for proprietary AT commands like UDP AT commands.

    AT+CFUN=1 //to turn on the modem

    AT+CFUN? //to confirm that the modem is turned on

    AT+CEREG=5 //to enable unsolicited notfiications

    //wait for a connection, +CEREG: 5 

    AT#XSOCKET=1,2,1 //open a UDP socket with role = server 

    (or AT#XSOCKET=1,2,0 //open a UDP socket with role = client)

    Then you can use AT#XSOCKETOPT to set socket options

    AT#XSENDTO=<url>,<port>,<datatype>,<data> //to send data

    Let me know if there's anything else you need!

    Best regards,

    Heidi

Reply
  • Hi!

    Of course! To use AT commands for this you will need to be running the Serial LTE Modem application available in NCS, which has support for proprietary AT commands like UDP AT commands.

    AT+CFUN=1 //to turn on the modem

    AT+CFUN? //to confirm that the modem is turned on

    AT+CEREG=5 //to enable unsolicited notfiications

    //wait for a connection, +CEREG: 5 

    AT#XSOCKET=1,2,1 //open a UDP socket with role = server 

    (or AT#XSOCKET=1,2,0 //open a UDP socket with role = client)

    Then you can use AT#XSOCKETOPT to set socket options

    AT#XSENDTO=<url>,<port>,<datatype>,<data> //to send data

    Let me know if there's anything else you need!

    Best regards,

    Heidi

Children
Related