Hi, I am new to prototyping with the Feather and I was wondering if there was an example or a place to get started to send AT commands from the firmware upon bootup.

When I run the sms example and use the LTE Link Monitor to monitor the system, the AT commands are just displayed in the console and not actually sent to the modem

    I know that sending SMS can be a bit weird and is defiantly carrier dependent. I know for me the SMS example in nrf/samples/nrf9160/sms worked, and hologram told me that they sent the text, but I never actually received it. Nordic has a whole SMS handler abstraction layer if you wanted to use it. In digging I found that you basically can’t send SMS to US phone numbers from most IOT sims now a days. You can only send them between different devices or send to the device which is a real bummer. Not quite sure what your application is. For us we ended up just using a hologram route that then sent to phones via the emails that most carriers have. number@vtext.com for verizon for example and that worked. We are doing a prototype for our senior capstone project. If I had to go and do it again, I would probably just use AWS IOT and AWS SNS to send my messages and do it that way but it’s a lot of backend work for something so simple.

    What cell carrier are you using?

    Hello cchoi22915,

    It looks like you may be asking two questions in your post today, with “how to send SMS” the bigger question. I may be able to help with the smaller one. If you have a need to send AT commands from your application to the LTE modem, and you’re using an nRF9160 based board, the API routine at_cmd_write() is the one I have been using for about the past three months. Jared cued me into this API routine.

    In a Zephyr based application you can call this routine so long as your source file has the following include stanza:

    #include <modem/at_cmd.h>

    Here is an example of how I call this routine, and capture any character string wise response the modem may give in reply:

    char buffer_at_response[SIZE_OF_MESSAGE_MEDIUM] = { 0 };
    char lbuf[DEFAULT_MESSAGE_SIZE] = { 0 };
    uint32_t rstatus = ROUTINE_OK;
    //
    rstatus = at_cmd_write("AT%XMONITOR", buffer_at_response, sizeof(buffer_at_response), NULL);
    snprintf(lbuf, DEFAULT_MESSAGE_SIZE, "(5) %s returns: %s%s", "AT%XMONITOR", buffer_at_response, ONE_NEWLINE);
    printk_cli(lbuf);

    The printk_cli() is a local routine I wrote to direct diagnostics and non-AT commands to a UART other than LTE modem’s preferred and selected UART.

    So this API routine is the way Jared shared with me to have firmware interact on demand with the LTE modem. No human intervention required.

    This does not answer your larger question about sending SMS messages. I haven’t worked with that sample app yet. But hope this can help you.

    • Ted

      My goal is to show a simple SMS message being successfully sent to my cell phone and then start sending data to an AWS server. Thank you to everyone who replied.

      ThomasFike I was not aware that I could not even send SMS to a non soracom device! Which is probably partially why I had so much trouble trying to get it to work haha. Thank you.

      tedhavelka66 I discovered the at_cmd_write() as well, but never got to the point of implementing a response handler. So are you opening another UART line instead of pins 23 and 24 (IIRC or it is 22 and 23) and using a separate serial USB to UART to output another channel of debug lines?

      Since it turns out I cannot even send an SMS, I will move on to sending packets of data to an AWS server.

      It is hard for me to get in the groove and follow function definitions as VSCode does not import the header files correctly. I have the C/C++ configurations with the include path as: ${workspaceFolder}/** but the files still fail to be located. The code compiles successfully though.

      5 days later

      Hello @cchoi22915,
      To your question yes, in my Zephyr plus nRF9160 based project I configure the SiP’s UART2 on board serial peripheral, and assign RX and TX to available GPIOs. There are times I have used two FTDI cables, one to capture Zephyr’s “chosen” UART communications, UART0, and the other to interact with my firmware project at a simple, custom command line interface.

      On a couple of development boards including Sparkfun Thing Plus nRF9160 I acheived a very basic command line interface (CLI). Upon moving to a custom board the CLI was suddenly sharing a UART with Nordic’s AT modem command handler. The AT command handler consumed all character input entering the SiP, so all which I typed was interpreted as an AT command. That’s when I looked into enabling a second UART. So long as I am not using too many I2C and or SPI peripherals, I can configure two UARTs and yet have a couple of serial peripherals available on the nRF9160’s Cortex-M33 application processor.

      Regarding VSCode I am sorry I cannot help you there. I have very little experience with VSCode. I set it up a couple months ago, and could build my project with it, but I found that it changes some local files as I import or simply open a project which I have been building at the command line with west and related tools. It became clear I would need to clone another copy of my project’s git based repo and use that with VSCode, in order to continue a smooth development work flow with west. And I’d only looked into VSCode in order to obtain thread aware debugging, which I could not get working with VSCode.

      While a bit slower and considered clunky by some, I would be happy to share with you a few command line techniques I use to track down function definitions and defined symbols in third party code bases. In the end it’s not much more effort than the “intelli-sense” features of some modern code editors, and you can use it where ever you have a project on a Unix or Linux based host. Very portable that way.

      Cchoi I hope you are making good progress with your AWS and Zephyr based project. Good weekend to you, stay safe!

      • Ted
      Terms and Conditions | Privacy Policy