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
11k stars 6.69k forks source link

modem_cellular: a lost network registration causes network to hang #77881

Closed emillindq closed 2 weeks ago

emillindq commented 3 months ago

Describe the bug Using modem_cellular with U-Blox SARA-R5 and U-blox LARA-R6. All works well until the modem reports lost cellular network registration. This causes a transition in states from CARRIER_ON, via a call to net_if_carrier_off(), to enter state RUN_DIAL_SCRIPT causing it to send AT commands again on the PPP DLCI channel.

Personally I don't see how this could work, because the DLCI channel assigned to PPP is still in the data call, only speaking PPP. The modem of course doesn't reply and so we're stuck in a timeout loop.

According to the AT command manual (p. 236) the modem exists the data session once

I'd really appreciate some input from @bjarki-andreasen here what the idea about what should happen is, because I don't understand this. Is it working on Quectel BG95? Thanks!

NOTE: I am using PAP

To Reproduce

  1. Build application using modem_cellular.c driver
  2. Gain internet access over 2G/3G/4G
  3. Disconnect antenna, or mock a deregistration event

Expected behavior Once network registration comes back, network access should recover and a data call can be placed once again

Impact Unrecovered cellular connection; need to use external watchdog-ish to suspend & resume modem

Logs and console output State transitions (no output on the UART) image

Environment (please complete the following information):

github-actions[bot] commented 1 month ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.