nRF9160 SLM add PPP

HI,

I am currently working on a project where, for now, I only use the nRF9160 as an LTE-M modem connected to the main MCU which is an ESP32.

I am using the SLM application and everything works as expected when I use AT commands.

Now I want to use the nRF9160 in PPP mode because this is the most straightforward way to integrate it in the ESP SDK as all its components (http, qttt, ...) are base on lwIP.

I originally thought that the AT#XSEND command was what I needed to enter PPP mode but then I realized it is only intended to send raw data to an already opened socket.

Then I found that PPP is already implemented in the MoSH sample.

So before I dive into the code, my questions are:

- do I have to "only" integrate the PPP code in the SLM app and create custom AT commands that enters/exit PPP mode ?

- is there any red flag that will prevent it from working ?

- do you have any advise regarding this work ?

Thanks.

Regards

PS: I know that this sounds stupid to not take advantage of the nRF9160 TCP/IP stack but this will requires lot of work to integrate it to the ESP SDK and I want a working example asap.

Parents
  • Hi,

    I am not very familiar with PPP, but yes, I believe it will work. You might have to use a second UART for PPP, similar to what the MoSH does.

    You might also be able to simply use the MoSH sample directly, though I haven't looked at the current consumption of the MoSH sample. It might end up being higher than the SLM where you have the #XSLEEP command.

    Best regards,

    Didrik

    P.S. Due to holiday vacations, responses might be slower than normal. We apologize for the inconvenience.

  • Hi   and happy new year,

    I investigated the code and how PPP works in the MoSH example and from what I understood it is not possible to use a single UART for the SLM and the PPP interface.

    It seems that the configured UART is exclusive to the PPP interface and that it cannot be used like I wanted to which is "shared" with the SLM by adding an SLM_PPP_MODE in addition to SLM_AT_COMMAND_MODE, SLM_DATA_MODE.

    I hoped that I could enable the PPP interface by adding a function like enter_pppmode() in the slm_at_host.c file.

    If you have any information or advice about that that would be awesome.

    Regards.

  • Zoptune said:
    It seems that the configured UART is exclusive to the PPP interface and that it cannot be used like I wanted to which is "shared" with the SLM by adding an SLM_PPP_MODE in addition to SLM_AT_COMMAND_MODE, SLM_DATA_MODE.

    The easiest solution will be to just use 2 UARTs. You could potentially use a switch to direct the UART signals, and that way only use one UART on the ESP32.

    Another possibility would be create a new "UART driver" on the nRF9160, which reads the UART traffic, checks if it is an AT command or PPP command, and sends it to the right handler from there. I don't think it will be easy to express that in the device tree, but if you re-write the PPP code and SLM code to not use the device tree macroes to the the "UART device", I think it is doable.

    A third option, is to use the HTTP, MQTT, etc. commands in the SLM, and not use PPP at all. It will let you avoid having to deal with the FW on the nRF9160, but might require more work on the ESP32 (depending on how much code you already have there)

Reply
  • Zoptune said:
    It seems that the configured UART is exclusive to the PPP interface and that it cannot be used like I wanted to which is "shared" with the SLM by adding an SLM_PPP_MODE in addition to SLM_AT_COMMAND_MODE, SLM_DATA_MODE.

    The easiest solution will be to just use 2 UARTs. You could potentially use a switch to direct the UART signals, and that way only use one UART on the ESP32.

    Another possibility would be create a new "UART driver" on the nRF9160, which reads the UART traffic, checks if it is an AT command or PPP command, and sends it to the right handler from there. I don't think it will be easy to express that in the device tree, but if you re-write the PPP code and SLM code to not use the device tree macroes to the the "UART device", I think it is doable.

    A third option, is to use the HTTP, MQTT, etc. commands in the SLM, and not use PPP at all. It will let you avoid having to deal with the FW on the nRF9160, but might require more work on the ESP32 (depending on how much code you already have there)

Children
Related