-
Notifications
You must be signed in to change notification settings - Fork 138
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
PPPos seems to use some non generic AT command, making it incompatible with others LTE modems, defeating the purpose of PPPos. (IDFGH-13334) #623
Comments
i tried to force the result of the function to 8, a valid value, it passes this error but stil fails at the next step: int PPPClass::networkMode() const {
if (_dce == NULL) {
return -1;
}
if (_mode == ESP_MODEM_MODE_DATA) {
log_e("Wrong modem mode. Should be ESP_MODEM_MODE_COMMAND");
return -1;
}
int m = 8;
// esp_err_t err = esp_modem_get_network_system_mode(_dce, m);
// if (err != ESP_OK) {
// log_e("esp_modem_get_network_system_mode failed with %d %s", err, esp_err_to_name(err));
// return -1;
// }
return m;
}
|
Do you really need to call About the last failure, I'd suggest checking the APN settings with your provider. |
actually i am not explixitely calling AT+CNSMOD, this is called by the PPP wrapper of the ESP32 core, which calls get_network_system_mode from esp_modem_command_library.cpp. That is why i wonder how PPP relies on this non generic command. Regarding the APN, i did set it here I run this example as is, after adjusting GPIOS, APN and modem type to GENERIC (i tested all others, too) The APN is correct, and i have tested the modem with AT command, everything works fine, including MQTT, it connects and get an IP in 2 seconds or less. I set the debug level to verbose, still i do not get much, i would have expect a lot more debug messages during the PPP connection setup. |
And just for the check, still with the ESP32C3 i tested another modem : AIR780, based on the excellent Eigencomm EC618, this time another (presumably non generic) AT command fails and the PPP does not get a chance to be set up.
Here again, the APN is correct and it has been tested to connect and work fine when controled with AT commands. |
@david-cermak is there any update on this? |
Sorry, no update here, as I believe those non-standard commands are being sent by arduino, or some upper layer libs. This library sets only these before switching to PPP: esp-protocols/components/esp_modem/include/cxx_include/esp_modem_dce_module.hpp Lines 51 to 60 in b65cff3
which are I believe standardized under The only trouble regarding standard AT commands is that the commands defined in this library not grouped and all declared in one place, so the upper level libraries do not know which commands are "generic" and which are "specific". I'll address this in #685 and future PRs (but that might result in a breaking change) |
Answers checklist.
General issue report
So, the target is ESP32C3, i tried to use PPPos with and AIR724UG, an LTE CAT1 modem based on RDA8910 , at first everything works, the network is attached and i get an IP, however as soon as we reach get_network_system_mode it fails, this command is non standard and seems specific to SIMCOM, when i looked up AT+CNSMOD i could see it is a SIMCOM command, it doesnt exist in AIR724 (and presumably others CAT1 modems).
https://github.com/espressif/esp-protocols/blob/5964eadbf5591e8c12ffa5c724c7ace083423239/components/esp_modem/src/esp_modem_command_library.cpp#L565C39-L565C49
I have tested with different modem settings, BG96, SIM7600, GENERIC and it always fails here.
Now i wonder why this command was used, provided that it is not generic, and it could easily be replaced by a generic command, supported by all modems, doing the same thing. I understand not all modems can be supported, but it would be better if at least only generic commands were used, it would increase the chances of being compatible with most LTE modems, after all PPPos is a generic interface and it should work with any modern CAT1 / CAT4 modem, that is the purpose.
Also, there should be a simple way to pass a list of commands to use for connection of any modem, that is how it works on windows or linux, we can pass the list of commands required for a particular modem and it will always work. Here i did not found any way to make it work with other modems than SIM7xxx or BG96. The GENERIC mode still use the SIMCOM command CNSMOD for example, which is strange.
Now, i wonder how to fix this problem, there is an "user side" PPP library in the ESP32 core V3, but unfortunately it seems to only be a wrapper for the IDF library and i see no way to add, or better overwrite some functions to make it work with the AIR724UG or other modems. How should i proceed to make this possible?
Here is the log, we can see the network is attached, i get an IP (presumably) but then it fails as soon as it tried to call CNSMOD, and finally the IP gets lost after a while, presumably because the network stack stopped responding acks or something.
The text was updated successfully, but these errors were encountered: