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

Serial LTE Modem SENDTO of hex string bigger than 32 bytes resets the module

Hi,

I have been working with the Thingy:91 at the version 1.2.99 but this also happens on previous versions (I do not know which it was but the serial_lte_modem code had a at#xdatatype command that is no longer existing on version 1.2.0 or 1.2.99) of the SDK. In this version I am using the following functions to try to request a timestamp from an NTP server.

at#xsocket=1,2,0



#XSOCKET: 1, 2, 0, 17


OK



at#xbind=1024



OK


at#xsendto="178.32.88.247",123,0,"1b0000000000000000000000000000000000000000000000e2495ab3c7ae147800000000000000000000000000000000"



Ready

The "Ready" at the end means that the device has rebooted, I assume this is due to an error. This happens when the datatype is 0, which means hexadecimal string and the payload is more than 32 bytes,
which in a hex string would mean 64 bytes.

After doing a little bit of debugging I found out that the error may be in the handle_at_sendto(...) function of the slm_at_tcpip.c file, because I wrote a debugger to see what was inside the "data" vector
just before the line where it may be doing a segmentation error (line 1125). Inside my data vector I saw that there was my complete payload but there were additional strange characters such as '$' and 'É'.

Is there any other way to achieve this kind of communication (sending a hex string of this size) using the serial_lte_modem?

By the way, to communicate with the modem I have been using the LTE Link Monitor.

Thanks, Aleix.

Related