zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.12k stars 6.21k forks source link

modem: gsm_ppp: Support for PPP modems that doesn't support DLCI #33999

Open ycsin opened 3 years ago

ycsin commented 3 years ago

Is your enhancement proposal related to a problem? Please describe. Currently, gsm_ppp uses DLCI to mux between PPP traffic and AT traffic. Quectel EC2X for example, doesn't support this, and switches from PPP to AT either by escape sequence:

  1. Wait for 1 second
  2. Send +++ to the UART
  3. Wait for 1 second
  4. Wait for the OK replied from the modem

or by gpio method:

  1. Pull the DTR pin from low to high
  2. Wait for the OK replied from the modem

To return to PPP:

  1. Sends ATO
  2. Wait for the CONNECT ... message from the modem

Also, EC2X modem output its GPS NMEA messages from a debug UART port instead of DLCI.

Describe the solution you'd like A kconfig to switch between the DLCI method and the escape sequence/gpio sequence. However, different manufacturers might have different way of doing this and therefore this might becomes ugly in the future.

For the GPS, kconfig might be possible to switch between the DLCI and another UART port in the driver, however I'm not sure how can this be configured in the dts

Describe alternatives you've considered A seperate PPP driver for modem that doesn't support DLCI?

jukkar commented 3 years ago

The GSM muxing is optional and not enabled by default in GSM modem driver. It should not be a big task to add another way of multiplexing the data in the drivers/modem/gsm_ppp.c. Patches are welcome if you want to implement this.

RomainPelletant commented 1 year ago

I am investigating that way to switch between PPP and AT commands (using DTR pin) and I am facing some issues.

Once PPP is working, switching from PPP to AT commands requires to call (else cmd handler is not receiving data) ret = modem_iface_uart_init_dev(&gsm2->context.iface, DEVICE_DT_GET(GSM_UART_NODE));

To go back into PPP mode (after ATO0 cmd), it seems we should call (from ppp.c) the following lines to get back to PPP: struct ppp_driver_context *context; uart_irq_callback_user_data_set(context->dev, ppp_uart_isr, context); uart_irq_rx_enable(context2->dev);

Do you see a more conveniant and proper way to do that? Adding a new in _const struct pppapi with a .ppp_pause and ppp_resume? Using GSM_MUX feature with additionnal code?

zephyrbot commented 5 months ago

Hi @bjarki-trackunit,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@ycsin you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!