In nRF Connect SDK 1.7.1, how to send hex data over the connection by AT#UDPSEND?
I use AT#XUDPCLI to create UDP client and connect to server.
For the AT#UDPSEND, it seems like CAN NOT assign datatype for the data.
Any suggestion?
In nRF Connect SDK 1.7.1, how to send hex data over the connection by AT#UDPSEND?
I use AT#XUDPCLI to create UDP client and connect to server.
For the AT#UDPSEND, it seems like CAN NOT assign datatype for the data.
Any suggestion?
Hi,
If you do not provide any data, the Serial LTE Modem will enter data mode, which let's you send raw data (formatted however you want, the byte that is received on the UART is the byte that is sent over the air) until the escape sequence is entered. By default, the escape sequence is "+++" without any <CR> or <LF> line endings.
See the documentation for the #XUDPSEND command and data mode for more information:
Best regards,
Didrik
Hi Didrik:
Thanks for your quick response.
Let's make it quickly, for example, if I want to send 0x1234 by #XUDPSEND from LTELinkMonitor.
What the commands I need to send? Is following correct?
AT#XUDPSEND= \x12\x34+++
How to send escape sequence without <CR> or <LF> in
Hi Didrik:
Thanks for your quick response.
Let's make it quickly, for example, if I want to send 0x1234 by #XUDPSEND from LTELinkMonitor.
What the commands I need to send? Is following correct?
AT#XUDPSEND= \x12\x34+++
How to send escape sequence without <CR> or <LF> in
TC said:Let's make it quickly, for example, if I want to send 0x1234 by #XUDPSEND from LTELinkMonitor.
The terminal in the LTE Link Monitor is not advanced enough to be able to do this.
TC said:What the commands I need to send?
Yes, 'AT#XUDPSEND=' is correct. How you send the data following that, depends on what terminal you are using.
TC said:How to send escape sequence without <CR> or <LF> in
Again, this depends on what terminal you are using.
Note that with the LTE Link Monitor, you will neither be able to send the bytes you want, nor will you be able to exit datamode afterwards.
When I need absolute control over what I am sending, I am usually using RealTerm.
How to receive the data after #XUDPSEND and "+++"?
The behavior is waitting or what command I need to send?
Can I send other AT command brfore receive the data?
Afte #XUDPSEND and "+++" I can't see following message:
#XUDPSEND: XX OK
Is that means I didn't send out any data?
TC said:How to receive the data after #XUDPSEND and "+++"?
The behavior is waitting or what command I need to send?
Can I send other AT command brfore receive the data?
When using the #XUDPCLI and #XUDPSEND commands, you do not need to do anything to receive data.
When not using data mode, you will get the received data in #XUDPSEND URCs. In data mode, the received data will just be sent over the UART.
TC said:Afte #XUDPSEND and "+++" I can't see following message:
#XUDPSEND: XX OK
Is that means I didn't send out any data?
No, the data is sent. But, in data mode, you will not get any confirmations.
E.g. in this screenshot from RealTerm, I first send at#xudpsend= command (in green) (I have already "connected" to a UDP echo server with #XUDPCLI).
I then send "at#xudpcli=" to the server, and the server replies with "at#xudpcli=" (in yellow). I then send "foo" twice, and get "foo" back twice, before I send another "at#xudpsend=", and get the same in return. Finally, I send "dflir", and get the echo back before I exit data mode with "+++".
I then send "foo" without using data mode, also here I get the response without having to send any other AT commands.
If you want more control over when you are sending and receiving, you must use the socket AT commands instead.
That was pretty answered, thanks!