Unverified Commit b2c805a1 authored by Me No Dev's avatar Me No Dev Committed by GitHub

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

Modem will try to switch to CMUX and then back to COMMAND in order to allow communication with the modem.
parent 019855ff
...@@ -324,8 +324,17 @@ bool PPPClass::begin(ppp_modem_model_t model, uint8_t uart_num, int baud_rate) { ...@@ -324,8 +324,17 @@ bool PPPClass::begin(ppp_modem_model_t model, uint8_t uart_num, int baud_rate) {
} else { } else {
// try to communicate with the modem // try to communicate with the modem
if (esp_modem_sync(_dce) != ESP_OK) { 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); 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) { if (esp_modem_sync(_dce) != ESP_OK) {
log_e("Modem failed to respond to AT!"); log_e("Modem failed to respond to AT!");
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment