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

How to get LTE modem to handle binary data through TCP

I've been able to connect to our server using the LTE modem sample app.  

As shown below, I configure the modem, open a socket, bind the port, and send and receive a small bit of data, but what I receive is not complete.

AT+CFUN=1
OK
+CEREG: 2,"4905","011E7701",7,0,0
+CGEV: ME PDN ACT 0,0
+CEREG: 5,"4905","011E7701",7
AT+CGDCONT?
+CGDCONT: 0,"IP","ibasis.iot","10.160.124.200",0,0
OK
AT#XSOCKET=1,1,1
#XSOCKET: 2, 6
OK
AT#XBIND=myport
OK
AT#XTCPCONN=myurl,myport
#XTCPCONN: 1
OK
AT#XTCPSEND="Hello World"
#XTCPSEND: 11
OK
AT#XTCPRECV=25,25
#XTCPRECV: Ã
#XTCPRECV: 12

In sending "hello world", I expect a 12-byte error response. I get the first two characters of the appropriate response, but since the second character is a null byte, it seems to stop the transmission, though there are 10 more bytes to be had.  In some tests I managed to get most of the bytes by using multiple #XTCPRECV commands thus proving the data is valid.

But if I try sending an appropriate binary payload e.g. #XTCPSEND="\xb2\x00\x08..." I get "tcpip: Failed to parse AT command -11"

I need to set up a TCP stream connection such that our own binary protocol can be sent across the serial modem in both directions. (This should be similar to a WM2 modem)

I also can't seem to find any documents describing the BSD command set I'm using.  I've gleaned some from other users' questions and this link:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/nrf/applications/serial_lte_modem/README.html#references

But I find nothing about why #XTCPCONN works in my case but #XCONNECT does not, and what's the differences are between #XRECV and #XTCPRECV etc.

Parents
  • Hi!

    The documentation for the SLM application is unfortunately still a work in progress, so there is a lot of missing information. 

    The reference you linked to is the AT Commands Reference Guide, but the AT commands you are using in the application is the Serial LTE Modem proprietary AT commands. 

    I've attached the most recent documentation I can find regarding these AT commands but please keep in mind that they might be outdated. I've asked about the most recent documentation. 

    slm_at_commands_v1.1.xlsx

    Best regards,

    Heidi

Reply
  • Hi!

    The documentation for the SLM application is unfortunately still a work in progress, so there is a lot of missing information. 

    The reference you linked to is the AT Commands Reference Guide, but the AT commands you are using in the application is the Serial LTE Modem proprietary AT commands. 

    I've attached the most recent documentation I can find regarding these AT commands but please keep in mind that they might be outdated. I've asked about the most recent documentation. 

    slm_at_commands_v1.1.xlsx

    Best regards,

    Heidi

Children
No Data
Related