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

serial_lte_modem HTTP example

Hi,

I'm trying to use the nRF91 as a Modem for an Arduino. Is there some example on how to use the AT commands of the serial_lte_modem sample to send a HTTP (or at least TCP) request to a server?

Best,
trembel

Parents
  • Hi Trembel,

    If you are running NCS v1.3.1 you should have more or less all the updates and features of the Serial LTE Modem application.
    We are working on improving the documentation of the SLM application.

    You can use the commands given here,

    I recommend that you enable CONFIG_SLM_TCP_PROXY=y in prj.conf:

    e.g.

    AT#XSOCKET=1,1,0
    AT#XSOCKET?
    AT#XCONNECT="<ip_address>",50001
    
    at#xtcpcli=1,"<ip_address>",50001
    AT#XTCPSEND=<datatype>,<data>
    AT#XTCPRECV[=<length>]
    
    AT#XSOCKET=0

    Best regards

    Martin  L.

  • Hi Martin,

    Thanks for your response. What do I type into <datatype>?
    Assuming I want to make a get request to google, would the following be the "correct" command order?

    AT#XSOCKET=1,1,0
    AT#XSOCKET?
    AT#XCONNECT="172.217.168.3",80
    
    at#xtcpcli=1,"172.217.168.3",80
    
    AT#XTCPSEND=<datatype>,"GET / HTTP/1.0"
    
    AT#XTCPRECV=256
    
    AT#XSOCKET=0

    Best,

    trembel

Reply Children
Related