Esp-idf: Make use of CMUX (GSM 07.10) protocol for PPPoS and GSM modules (IDFGH-2608)

Created on 29 Jan 2020  路  7Comments  路  Source: espressif/esp-idf

Is your feature request related to a problem? Please describe.

While the PPPoS example works, the need to exit PPPoS and enter command mode to send
AT commands or read NMEA information from the GSM modems proves difficult and requires alot of task handling.

There is also a delay of 1 second required to successfully exit PPPoS mode.

This proves problematic in practice when frequent measuring/sending of data is required.

_Describe the solution you'd like_

I would like to see the GSM 07.10 protocol implemented.
Possibly in the modem component.

I suppose the solution could be to implement something like _virtual UART_ ports.
Each Channel would be a different UART virtual device.

This would allow compatibility with libraries to parse NMEA, send/receive AT commands, lwIP/PPPos and other GSM module related libraries.

The following channels are desired :

  • PPPoS : to be used by the network stack.
  • AT Command : to be able to control the module without disconnecting.
  • NMEA: to read incoming GPS information without affecting communications.

_A clear and concise description of what you want to happen._

I would like to :

  • Setup network connectivity via PPPoS and utilise the ESP32 Network stack.
  • Be able to send/read SMS while staying connected
  • Be able to send various AT commands to the module while staying connected
  • Be able to receive and parse incoming NMEA sequences

_A clear and concise description of any alternative solutions or features you've considered._

For the solution I am working at I communicate via MQTTS to the internet.
I can use the modems MQTTS capabilities via AT commands and only connect through PPPoS for OTA firmware updates.

This keeps me in AT Command mode and I can read/send SMS, read NMEA sequences and send telemetry.

If another communication protocol needs to be used like HTTPS, the complexity would increase significantly and also power usage and data overhead,
as disconnecting from PPPoS would break all my connections and handshakes should be performed at each reconnect.

_Please give as many details as you can. Include suggestions for useful APIs or interfaces if relevant._

The gsm07.10 protocol IS used within the bluedroid component in ESP-IDF.
More details here
It seems that repurposing that library would be the quickest route to add this feature.

A basic driver is created for linux here.
Beware, the licence is GPL.

The OVMS project has a wonderful implementation of GSM 07.10
and is the only ESP32 compatible solution that I have found so far.
Check this post

Unfortunately it cannot be used directly as a component in ESP-IDF without including a host of other OVMS modules.

Implementing a generic UART based GSM 07.10 protocol for ESP-IDF could really boost it's popularity, as there seems to be no (open source) implementation anywhere for embedded systems...

Additional context

Nothing more to add right now.

Feature Request

Most helpful comment

I'll add that the pppos example does not work that well. There are some unresolved issues that make using GSM in a comercial product unreliable. But I agree with @GeorgeGkinis that even if pppos worked reliably, not being able to even get the rssi while connected to internet is really bad.

All 7 comments

I'll add that the pppos example does not work that well. There are some unresolved issues that make using GSM in a comercial product unreliable. But I agree with @GeorgeGkinis that even if pppos worked reliably, not being able to even get the rssi while connected to internet is really bad.

@GeorgeGkinis Cool, thank you for such a detailed request and I agree it's a nice idea!
But we still need some time to get this feature implemented.

I understand that it will be a complicated task to seamlessly integrate with the network stack.
Thanks for showing interest!

By the way there is work being done relating to multiplexing at the Zephyr project : https://github.com/zephyrproject-rtos/zephyr/pull/22353#issuecomment-597771173

I've made PoC with current component to support CMUX as an option and it eventually works.
At least I'm able to connect to MQTT broker, but seems there are a lot of work to make it stable.
Once it was able to make OTA update with this CMUX implementation.
https://github.com/d3vil-st/esp-idf/tree/release/v4.1

Congratulations @d3vil-st It's really nice to have this feature!

Thanks @d3vil-st for your contribution. I was able to use your component. On top I did some work for better frame handling.

Currently I can talk to MQTT servers (TLS enabled as well) without any issues.

The Repo can be found here:

https://github.com/olliiiver/esp_lte_modem

Thanks @d3vil-st for your contribution. I was able to use your component. On top I did some work for better frame handling.

Currently I can talk to MQTT servers (TLS enabled as well) without any issues.

The Repo can be found here:

https://github.com/olliiiver/esp_lte_modem

Cool and nice to hear!

Did you tried to perform OTA update through this? Cause in my implementation it was able to perform it only in 1 from 10 attempts.

Was this page helpful?
0 / 5 - 0 ratings