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

nrf9160 (NRF9160-SICA-R) as modem for sending/receiving data by AT Commands

Hi DevZone! 

I would like to use nrf9160 for sending/receiving data by interfacing it with my microcontroller over UART and sending AT commands. I have a nrf9160 Feather board (check here) which is flashed with the latest modem firmware. I have tested it with CoolTerm (serial terminal app) and it responds with AT Commands. Now I am looking for example set of commands which can help in sending/receiving data over TCP, this will really help a lot! 

Requesting your help/ any pointer

Thanks 

Silas 

Parents Reply Children
  • Hi Heidi

    Thanks for your prompt reply!

    I am actually new to using Segger Embedded Studio for nRF Connect. I could build the SLM application in SES and it produced merged.hex output file. How do I also get the .BIN file output which I need to load into the nRF Feather board? Sorry if I am asking a very common question :( 

    Thank you so much!

     Silas

  • Hey Silas,

    I wrote up some quick instructions on the subject in the nRF9160 Feather documentation. Hope it helps! Slight smile

    https://docs.jaredwolff.com/nrf9160-serial-lte-modem-sample.html

  • Jared's tutorial contains everything you need! Make sure to follow his steps to modify the Serial LTE Modem sample and you should be good to go.

    But to answer your specific question (for you and other viewers), to get the .bin file that you, enable bootloader functionality by adding CONFIG_BOOTLOADER_MCUBOOT=y to the "prj.conf" file. 

    Then when you build the file you need (app_update.bin) will be located here:

    <build_folder>/zephyr/app_update.bin

    Best regards,

    Heidi

  • Hi Jared & Heidi

    Thank you so much for your help! The SLM works for me now:)

    Now I am trying to send simple data to my Ubuntu server (on DigitalOcean). But not able to get through

    Here are the AT commands that I run in CoolTerm

    Ready
    AT+CFUN=1
    OK
    AT+CFUN?
    +CFUN: 1
    OK
    AT+CIND=1,0,1
    OK
    AT+CIND?
    +CIND: 1,0,1
    OK
    AT+CPIN?
    +CPIN: READY
    OK
    AT+CESQ
    +CESQ: 99,99,255,255,255,255
    OK
    AT+CEREG?
    +CEREG: 0,4,"FFFE","FFFFFFFF",7
    OK
    AT+CESQ
    +CESQ: 99,99,255,255,255,255
    OK
    +CIND: "service",1
    AT+CESQ
    +CESQ: 99,99,255,255,8,29
    OK
    AT+CEREG?
    +CEREG: 0,5,"0936","0C74150F",7
    OK
    AT+CGDCONT?
    +CGDCONT: 0,"IP","hologram","10.117.238.97",0,0
    OK
    AT#XSOCKET=1,1,0
    #XSOCKET: 1, 1, 0, 6
    OK
    AT#XBIND=1700
    OK
    at#xtcpconn="138.68.40.173",1700
    ERROR
    

    After turning on the nRF to full function, and waiting for sometime, it gets signal strength, but when trying to establish the connection, it gives error.  And on Hologram website, I see that the nRF did get connected, but no data sent.  What is going on? 

    Thanks

    Silas

     

  • Hi!

    #XTCPCONN is not an AT command, which is why it's returning an error. Try AT#XCONNECT="138.68.40.173",1700 instead. 

    Also AT#XSOCKET=1,1,0 closes a socket. Try AT#XSOCKET=0,1,0 to open a client socket or 0,1,1 to open a server socket. 

    Edit due to incorrect documentation: Also AT#XSOCKET=0,1,0 closes a socket. Try AT#XSOCKET=1,1,0 to open a client socket or 1,1,1 to open a server socket. 

Related