-
Notifications
You must be signed in to change notification settings - Fork 151
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
BG96 - automatic CMUX mode (ESP_MODEM_MODE_CMUX) - how to reinit PPPOS (IDFGH-14662) #767
Comments
I'd suggest using CMUX manual mode if you need to resume PPP connection on the data channel. |
Hi David,
In current CMUX mode, I am using PPPOS and also get +CMTI and signal change events. How that changes if I use 2nd method (CMUX_MANUAL)? Or better question, in manual cmux mode, how to use PPPOS and AT at the same time? Thanks, |
Hi Gabrijel, Yes, that's what I meant:
further than that, you can also try mode detection. This would send some probes to the device in order to detect which mode it's actually in. In case of CMUX it'd go over the virtual terminals and runs detection on these as well. Thanks, |
Hi David, I already tested CMUX auto->COMMAND->CMUX auto but the modem refused to enter CMUX modem returning -1 as error code. It's the same as if I try to enter CMUX mode without exiting to COMMAND mode. What I also tried was just check what mode esp_modem is when PPPOS drops, and it reported mode 0. I'll try DETECT and switch to CMUX to see if that'll do any difference. If I understand you well, the best way to go is CMUX manual mode. However, I am a little confused about MANUAL_DATA, MANUAL_COMMAND and MANUAL_SWAP. Can you please clarify this ( from: https://docs.espressif.com/projects/esp-protocols/esp_modem/docs/latest/README.html): For the autodetect results after in CMUX manual mode PPPOS drops...I'll make a log using console example and post here. Do you want full log communication with the modem or just what DETECT mode reports? Regards, |
Hi David, using modem_console, PPPOS is now active for almost 3hours! What happened is that my computer went to BSoD so I had to restart it (and had to disconnect serial to ESP32S3, while still having external power on my board). After restart, I connected to serial monitor and that restarted ESP32. Then I tries to execute AT commands but it was an error. So i entered set_mode AUTO and this set all to proper state(s). Then I tried to switch to any other mode but I had no success. See all in log. Im my code, I've used PPPOS example and implemented all required. What's different from modem_console is that I am using C and not C++. I also configure and bring up AP mode on Wifi of ESP32 before starting up PPPOS. Can something of that be the reason of PPPOS disconnect after 1 hour? BR, |
If you're in some CMUX mode
Cannot think of anything that would cause these disconnections, it's really weird that it happens always, exactly after 1 hour. Do you have any client connected to the AP? what's the DHCP lease time? do you see any disconnection/lease renewal on the client side? Are you using NAT to route packets from PPPoS? |
Hi, sorry for the delay. To answer the questions, the disconnect happens regardless if there are client connected to AP or not. Lease time is default and I didn't noticed any renevals on client side (I didn't even look for them). Beside default network settings, I am not using anything special on ESP32 (it's almost that I have used example for PPPOS and AP mode putting all together. I first init network then AP and then PPPOS). In the end, I did as you proposed and use CMUX manual mode(s). After attaching to GPRS network, I enter CMUX manual mode and then switch to CMUX manual data mode. When I get disconnected event, I switch to CMUX manual command mode, check signal and connection to GPRS network and then enter CMUX data mode. This makes modem connected to PPPOS again and all working fine. There is no need to use CMUX switch. So this seems to solve my problem. I am still not sure what happens when using CMUX (automatic) and DETECT mode but it looks like the esp_modem module gets "lost" in some state-machine "state" and replay to all other modes as "error" when trying to switch modes. Gabrijel |
Answers checklist.
General issue report
I've implemented PPPOS as in the example and all works ok except that, after an hour of being connected, I get IP_EVENT_PPP_LOST_IP. So I tryed to make reconnection. What I tested for now is:
What to do and how to make PPPOS reconnect?
Thanks.
The text was updated successfully, but these errors were encountered: