Skip to content

fix(ppp): Fix PPP not working after reboot if no RST #10264

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

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion libraries/PPP/src/PPP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,17 @@ bool PPPClass::begin(ppp_modem_model_t model, uint8_t uart_num, int baud_rate) {
} else {
// try to communicate with the modem
if (esp_modem_sync(_dce) != ESP_OK) {
log_v("Modem does not respond to AT, maybe in DATA mode? ...exiting network mode");
log_v("Modem does not respond to AT! Switching to COMMAND mode.");
esp_modem_set_mode(_dce, ESP_MODEM_MODE_COMMAND);
if (esp_modem_sync(_dce) != ESP_OK) {
log_v("Modem does not respond to AT! Switching to CMUX mode.");
if (esp_modem_set_mode(_dce, ESP_MODEM_MODE_CMUX) != ESP_OK) {
log_v("Modem failed to switch to CMUX mode!");
} else {
log_v("Switching back to COMMAND mode");
esp_modem_set_mode(_dce, ESP_MODEM_MODE_COMMAND);
}
}
if (esp_modem_sync(_dce) != ESP_OK) {
log_e("Modem failed to respond to AT!");
goto err;
Expand Down
Loading