-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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: Uart Resync Problems (IDFGH-2354) #4482
Comments
I ran exactly into this issue during "implementation" of driver for modem M590E. I have the very same stack trace and the main reason why it crashes is in function
The flow of the example communicates with modem over UART prior the |
Hi, do you have by any chance an example of how you split esp_modem_setup_ppp ? I have had the same problem with a sim800l, the program boots the first time, crashes on esp_modem_dte_init call for the reason you described, then reboots and works without problem this time, and i don't know why. |
I haven't progress to prepare fix for esp-iot-solution. My work remained at the phase of workaround ModemManager.cpp:L39 where I mange the modem lifecycle on my own. (It is also related to significantly different flow and API of M590e modem) I simply make sure structure is fully initialized and then I call connection routine. I am sorry I can't help you bit more. My life made me to put this IoT project on hold for a while. |
Thanks a lot for your fast reply. So i studied your code a bit, and it seems to me we have quite similar codes for the ModemManager. I noticed there is a .init() method for initializing the dte which calls esp_modem_dte_init(&config), wouldn't that be the call that tries to do " pppos_input_tcpip(esp_dte->ppp, esp_dte->buffer, length) " ? Unless you modified it ? Because esp_modem_setup_ppp is still in the connect routine, which needs an initialized dte. I don't understand how to solve the paradox of both needing a ppp to initialize the dte because of the pppos_input_tcpip call and needing the dte to setup the ppp. Don't worry about it, this help is precious already. |
I think I understood why the program resets. The reason why esp_handle_uart_data is called before esp_modem_setup_ppp is because before setting up ppp, we apply the uart event routing (xTaskCreate(uart_event_task_entry)) in esp_modem_dte_init, but at this point the uart shouldn't receive a UART_DATA type of event as it needs the ppp to be set to call pppos_input_tcpip. However, it apparently does, according to this comment: #3506 (comment) . So the solution i found is adding a simple boolean in esp_modem.c that i turn on once esp_modem_setup_ppp has been called that allows the uart_event_task_entry to call esp_handle_uart_data. |
Thanks for reporting and sorry for slow turnaround, we have a fix under internal reviewing now, and the issue will close automatically once the fix is available on GitHub, thanks. |
Environment
git describe --tags
to find it): v4.1-dev-369-g4dac7c7df-dirtyProblem Description
Hi! I have been testing the PppoS example for a while and it seems i found a bug or something.
I will describe my project and then i will explain the particular problem.
Project:
I am connecting to internet through the module Sim800L and then i make different operations such as http post and more. Since the module consumes a lot of energy, i implemented a MOSFET to turn on and off when desired for connecting to internet.
Problem:
When i start running my program (pppoS example extended for deinit before turning off module and init again when is back on) everything works good until I try to resync when i turn on the module. It gets stuck when i try to access the PPP mode again. Looks like the deinit function is not doing the right job.
It seems that there's a blocking function called: "pppapi_ppos_create" in the file esp_modem.c that blocks my program causing a immediate reset on the ESP32.
Problems Checked:
Expected Behavior
When i run the script described, the module turns on/off, without reset, allowing me to connect to internet whenever i want by turning on the mosfet.
Actual Behavior
Everything works perfect until the modules turn on, after turning off and deinit, that's when the esp32 resets and all the program starts from scratch.
Question
Is there any way to resync the communication between the esp32 and the module without reseting?
Steps to repropduce
Code to reproduce this issue
PppoS example, copied exactly the same and added the following lines:
Debug Logs
Other items if possible
There are no other files than the ones in the example.
Thank you!!
The text was updated successfully, but these errors were encountered: