mirror of
https://github.com/espressif/arduino-esp32
synced 2024-09-21 10:28:04 +00:00
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.
This commit is contained in:
parent
019855ff90
commit
b2c805a139
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user