PPPoS interface disconnection event is not always calling the registered disconnect callback function
- rajkumar patel
- Posts: 29
- Joined: Mon Apr 10, 2017 12:43 pm
- Location: india
PPPoS interface disconnection event is not always calling the registered disconnect callback function
hi,
in my implementation, i am getting internet connectivity for esp32 from a modem(BM817C-E1) over PPPoS interface. after several hours of faithful communication i am getting the disconnection event for the PPP interface. i am getting this event on uart interface, and this event is passed to the LWIP pppos stake for internal process and then in turn to call the registered disconnection callback function.
so this is the flow.
as soon as i am getting the disconnection event i am starting a state machine to reestablish the ppp connection. but, it is observed that, when i get the disconnection event over uart it gets entered into the lwip(pppos)stake but the registered callback function for disconnection event is not getting called always. and due to this my state machine fails to recover the connectivity.
has anyone faced the same issue? please give your comments.
p.s : i have used v2.1 idf.
in my implementation, i am getting internet connectivity for esp32 from a modem(BM817C-E1) over PPPoS interface. after several hours of faithful communication i am getting the disconnection event for the PPP interface. i am getting this event on uart interface, and this event is passed to the LWIP pppos stake for internal process and then in turn to call the registered disconnection callback function.
so this is the flow.
as soon as i am getting the disconnection event i am starting a state machine to reestablish the ppp connection. but, it is observed that, when i get the disconnection event over uart it gets entered into the lwip(pppos)stake but the registered callback function for disconnection event is not getting called always. and due to this my state machine fails to recover the connectivity.
has anyone faced the same issue? please give your comments.
p.s : i have used v2.1 idf.
Regards,
Rajkumar M. Patel
Rajkumar M. Patel
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Hi Loboris,
We have taken below example for our reference purpose regarding PPP component porting and facing some issues while testing with GSM Module which is mentioned above.
https://github.com/loboris/ESP32-PPPOS- ... ents/pppos
so, Would you please check from your side and provide comment or feedback if any regarding that issue
We have taken below example for our reference purpose regarding PPP component porting and facing some issues while testing with GSM Module which is mentioned above.
https://github.com/loboris/ESP32-PPPOS- ... ents/pppos
so, Would you please check from your side and provide comment or feedback if any regarding that issue
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Hi Loboris and Espressif Developer,
Did you get chance to look above issue which right now we are facing while testing PPP component over GSM module?
Let me know if need any more details regarding issue.
Did you get chance to look above issue which right now we are facing while testing PPP component over GSM module?
Let me know if need any more details regarding issue.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Hi Loboris,
Did you face this type of issue at your end?
Did you face this type of issue at your end?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Hi Ritesh, have you found a solution or workaround for this issue?
I have the same problem, for example if ESP is downloading a file via GSM and I remove the SIM card (just to simulate an interruption of the connection) the program gets stuck because PPP callback isn't called...
Do you think is a bug from PPP library?
Can't find anymore information about this on this forum, only this thread
Thanks in advance
I have the same problem, for example if ESP is downloading a file via GSM and I remove the SIM card (just to simulate an interruption of the connection) the program gets stuck because PPP callback isn't called...
Do you think is a bug from PPP library?
Can't find anymore information about this on this forum, only this thread
Thanks in advance
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Hi,mr1000 wrote:Hi Ritesh, have you found a solution or workaround for this issue?
I have the same problem, for example if ESP is downloading a file via GSM and I remove the SIM card (just to simulate an interruption of the connection) the program gets stuck because PPP callback isn't called...
Do you think is a bug from PPP library?
Can't find anymore information about this on this forum, only this thread
Thanks in advance
We have put GSM Module reset state machine into LWIP Library which we have developed for our GSM module
I think you need to add handler or provision regarding PPP callback function into your state machine once you get SIM card removal detection event.
Would you please check it from your PPP application component first which is giving this type functionalities or not?
Also, Would you please provide few more details regarding GSM module which you are using and your end application into brief so that it will be helpful to provide response for same as quickly as possible.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
My GSM module don't support SIM card removal detection, but I'm removing it to simulate I lose connection with network.Ritesh wrote: Hi,
We have put GSM Module reset state machine into LWIP Library which we have developed for our GSM module
I think you need to add handler or provision regarding PPP callback function into your state machine once you get SIM card removal detection event.
Would you please check it from your PPP application component first which is giving this type functionalities or not?
Also, Would you please provide few more details regarding GSM module which you are using and your end application into brief so that it will be helpful to provide response for same as quickly as possible.
My program is similar to Loboris example (https://github.com/loboris/ESP32-PPPOS-EXAMPLE)
I'm using the GSM module to download a 70-100kb file from a server using HTTPS and store it to ESP32
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Ok. Understood.mr1000 wrote:My GSM module don't support SIM card removal detection, but I'm removing it to simulate I lose connection with network.Ritesh wrote: Hi,
We have put GSM Module reset state machine into LWIP Library which we have developed for our GSM module
I think you need to add handler or provision regarding PPP callback function into your state machine once you get SIM card removal detection event.
Would you please check it from your PPP application component first which is giving this type functionalities or not?
Also, Would you please provide few more details regarding GSM module which you are using and your end application into brief so that it will be helpful to provide response for same as quickly as possible.
My program is similar to Loboris example (https://github.com/loboris/ESP32-PPPOS-EXAMPLE)
I'm using the GSM module to download a 70-100kb file from a server using HTTPS and store it to ESP32
If you GSM module doen't support SIM Card removal detection then you need to implement which will reset your GSM module based on retried of command response.
After that once GSM module will be reset then you will get initially like SIM Card is not inserted from GSM init process itself.
Hope this will be helpful for your requirement to fulfill it. Still, let me know if any doubt regarding that
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Thank you Ritesh.Ritesh wrote:Ok. Understood.
If you GSM module doen't support SIM Card removal detection then you need to implement which will reset your GSM module based on retried of command response.
After that once GSM module will be reset then you will get initially like SIM Card is not inserted from GSM init process itself.
Hope this will be helpful for your requirement to fulfill it. Still, let me know if any doubt regarding that
So in the GSM state machine where I send bytes to tcpip layer, I should check there the data and see if I'm reading some error message from GSM?
Code: Select all
int len = uart_read_bytes(gsm_uartNum, (uint8_t*)gsm_data, GSM_BUF_SIZE, 30 / portTICK_RATE_MS);
if (len > 0)
{
//do a check for errors of what I read from GSM before calling ppos_input_tcpip?
err_t err = pppos_input_tcpip(ppp, (u8_t*)gsm_data, len);
if( err != ERR_OK )
{
#if GSM_DEBUG
sprintf( debugBuffer, "GSM: err: %d\n", err);
uart_write_bytes( UART_NUM_2, debugBuffer, strlen(debugBuffer) );
#endif
}
xSemaphoreTake(pppos_mutex, PPPOSMUTEX_TIMEOUT);
pppos_tx_count += len;
xSemaphoreGive(pppos_mutex);
}
Re: PPPoS interface disconnection event is not always calling the registered disconnect callback function
Yeah. something like that you need implement state machine for thatmr1000 wrote:Thank you Ritesh.Ritesh wrote:Ok. Understood.
If you GSM module doen't support SIM Card removal detection then you need to implement which will reset your GSM module based on retried of command response.
After that once GSM module will be reset then you will get initially like SIM Card is not inserted from GSM init process itself.
Hope this will be helpful for your requirement to fulfill it. Still, let me know if any doubt regarding that
So in the GSM state machine where I send bytes to tcpip layer, I should check there the data and see if I'm reading some error message from GSM?
CheersCode: Select all
int len = uart_read_bytes(gsm_uartNum, (uint8_t*)gsm_data, GSM_BUF_SIZE, 30 / portTICK_RATE_MS); if (len > 0) { //do a check for errors of what I read from GSM before calling ppos_input_tcpip? err_t err = pppos_input_tcpip(ppp, (u8_t*)gsm_data, len); if( err != ERR_OK ) { #if GSM_DEBUG sprintf( debugBuffer, "GSM: err: %d\n", err); uart_write_bytes( UART_NUM_2, debugBuffer, strlen(debugBuffer) ); #endif } xSemaphoreTake(pppos_mutex, PPPOSMUTEX_TIMEOUT); pppos_tx_count += len; xSemaphoreGive(pppos_mutex); }
Regards,
Ritesh Prajapati
Ritesh Prajapati
Who is online
Users browsing this forum: Baidu [Spider] and 246 guests