This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cellular fix to PPP only: recover from service denial. (#1206)
WARNING: this change is well tested on ESP-IDF, less well tested on Zephyr/Linux. Should you have issues with PPP not reconnecting across a service outage, the place to look is the uPortPppReconnect() function in the file <ubxlib_root>/port/platform/<your platform>/src/u_port_ppp.c, which now performs a PPP disconnect before it remakes the PPP connection. If either the network or the cellular module causes the PDP context to be deactivated while a PPP connection is active, that PPP connection will be deactivated by the cellular module sending an LCP Terminate Request over the PPP interface to the peer entity. At this point the PPP connection is dead, it will never be reactivated ever, and so when the PDP context comes back the inactive connection needs to be torn down and a new one brought up, What now happens: - on the CMUX side, don't leave the old "direct" AT client locked; this means that CMUX can be taken down again by any task (otherwise FreeRTOS complains that the task unlocking the mutex is not the same as the task that had the mutex locked), - for ESP-IDF, on the PPP side, no longer use the IP addresses passed in: ESP-IDF PPP picks these up during PPP LCP negotiation anyway, and not needing these allows the next bullet point, - uPortPppReconnect() now stops the PPP link up into ESP-IDF/Zephyr/Linux, disconnects and reconnects PPP from a cellular module standpoint and then restarts the PPP link up into ESP-IDF/Zephyr/Linux afterwards; this does a proper/full reconnection, which might not _always_ be necessary but sometimes is: better safe than sorry, - a URC, `+CGEV`, which indicates the state of the PDP context of a cellular module is now enabled; this is required for the case where a module moves from 2G to LTE or vice-versa, during which the module automagically re-enables the PDP context but does not re-establish the PPP connection, it is left there dead; with `+CGEV` enabled we can notice this, close the dead PPP link and re-establish it.
- Loading branch information
Showing
10 changed files
with
285 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.