PPP over Serial (PPPoS) support for SIM800 within ESP-IDF for ESP32

Introduction

While we have been looking for MicroPython libraries for the SIM800 module the other day, we found there’s PPPoS support for the SIM800 module within the Espressif ESP-IDF 3.3 for ESP32 already.

Bump. Just wanted to let you know that starting with ESP-IDF v3.3 for the ESP32, there are already C-level PPP over Serial (PPPoS) client implementations for the SIM800L and the BG96 around, see also esp-idf/README.md at release/v3.3 · espressif/esp-idf · GitHub. The implementation for the SIM800 can be found within sim800.c.

The example program pppos_client_main.c already does MQTT communication using this, based on the standard MQTT protocol implementation within the ESP-IDF.

When there’s interest and time permits, I will be happy to dive into the details in order to provide a MicroPython wrapper around it [1].


P.S.: While the development head of Pycom MicroPython is currently based on ESP-IDF v3.2, it might be possible to backport this feature [2]. Starting February 2020, the Pycom ecosystem is based on ESP-IDF 3.3.1 through ESP-IDF v3.3.1 by husigeza · Pull Request #16 · pycom/pycom-esp-idf · GitHub.


  1. https://micropython-dev-docs.readthedocs.io/en/latest/adding-module.html ↩︎

  2. However, I also recognized Pycom’s engineers started to work on support for ESP-IDF v3.3 and ESP-IDF v4.0 just recently, see

    ↩︎
1 Like

@clemens asked

Well, why not? You know this SIM800L guy already and you actually did HTTP communication yourself with your https://hiveeyes.org/docs/arduino/firmware/node-gprs-http/README.html the other day.

Because some libs supporting some protocols only. Sodaq’s GPRSBee lib does support HTTP and I think FTP but not MQTT. So I fear it could be the some here, but vice versa MQTT only.

Regardless of being on the C-level anyway, we are talking about real network stack implementations here in comparison to any maybe-hybrid drivers coming from the Arduino ecosystem. Out of the PPP link gained from the modem through the respective DTE / DCE implementation, we gain a regular IP connection.

https://github.com/espressif/esp-idf/blob/release/v3.3/examples/protocols/pppos_client/main/pppos_client_main.c#L214-L217

On top of that IP connection, any application protocol should work. There are already HTTP client examples within the ESP-IDF, see

which should be capable of being swapped in here.

How to bring that into MicroPython land is a total different story but should certainly be doable as all the primitives are just there. However, for people not knowing about these details yet like me, some research will have to be done on how to connect these bits together.

1 Like

will probably centered around the latter example

as this is based on lwIP [1] already. Through the respective Espressif-specific port [2], regular POSIX sockets are coming into MicroPython land through modlwip [3].


  1. lwIP - A Lightweight TCP/IP stack - Summary [Savannah] ↩︎

  2. https://github.com/espressif/esp-lwip ↩︎

  3. micropython/extmod/modlwip.c at v1.11 · micropython/micropython · GitHub ↩︎

The information within these tickets and recent commits might be helpful when having problems ramping up a PPPoS connection.

On this issue,

Pavel Slechta just commented:

I have a working MQTT connection. Code is here
slechta/esp-idf@650f286

It looks like Espressif may be gradually refactoring (parts) of the code supporting PPPoS [1] into a separate ESP-IDF component, see GitHub - espressif/esp-protocols: Collection of ESP-IDF components related to networking protocols.


  1. esp-idf/examples/protocols/pppos_client at v4.3.1 · espressif/esp-idf · GitHub ↩︎

Diese Komponente wird konstant weiterentwickelt. Schönes Ding.

History for components/esp_modem - espressif/esp-protocols · GitHub

Folgende aktuelle commits bzgl. MQTT haben auf sich aufmerksam gemacht.

fix(esp-modem): Example to use variable mqtt topic/data · espressif/esp-protocols@8958d5e · GitHub
feat(modem): Add mqtt example in AT-only mode · espressif/esp-protocols@7547267 · GitHub
fix(modem): AT-only example: support MQTT over TLS on BG96 · espressif/esp-protocols@31d4323 · GitHub

Und die Version 1.0.0 ist gelandet, vor kurzem erst.

fix(modem): Example to use 1.0.0 · espressif/esp-protocols@afb6930 · GitHub

See also espressif/esp_modem.

1 Like