Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of CMUX (GSM 07.10) protocol for PPPoS and GSM modules (IDFGH-2608) #4688

Closed
GeorgeGkinis opened this issue Jan 29, 2020 · 9 comments
Labels
Resolution: Done Issue is done internally Status: Resolved Issue is done internally Type: Feature Request Feature request for IDF

Comments

@GeorgeGkinis
Copy link

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.

@GeorgeGkinis GeorgeGkinis added the Type: Feature Request Feature request for IDF label Jan 29, 2020
@github-actions github-actions bot changed the title Make use of CMUX (GSM 07.10) protocol for PPPoS and GSM modules Make use of CMUX (GSM 07.10) protocol for PPPoS and GSM modules (IDFGH-2608) Jan 29, 2020
@gunarkroeger
Copy link

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.

@suda-morris
Copy link
Collaborator

@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.

@GeorgeGkinis
Copy link
Author

GeorgeGkinis commented Mar 11, 2020

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 : zephyrproject-rtos/zephyr#22353 (comment)

@d3vil-st
Copy link

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

@suda-morris
Copy link
Collaborator

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

@olliiiver
Copy link

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

@d3vil-st
Copy link

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.

@AxelLin
Copy link
Contributor

AxelLin commented Mar 2, 2021

Hi @d3vil-st @olliiiver

What is the recommend error handling if esp_dte->buffer[0] != SOF_MARKER or Missing end SOF?

@olliiiver
Copy link

@d3vil-st Haven't had the chance to test something other than MQTT
@AxelLin Like mentioned in my repo a small buffer size leads to problems. There is currently no implementation to recover lost frames.

@espressif-bot espressif-bot added Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed Resolution: Done Issue is done internally Status: Resolved Issue is done internally and removed Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed labels Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Resolved Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

7 participants