-
Notifications
You must be signed in to change notification settings - Fork 735
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
Connection intermittant #1
Comments
Hi @STEPHER2, Am I correct is suggesting that you are using the low level code, that is the functions with LL in their name? I did encounter this myself once but I found that converting the code to use the high level functions addressed the problem. Since this is what my customer wanted anyway, I did not pursue this any further and assumed it was just a quirk on my system. I will attempt to reproduce this again and debug it. In the meantime you might try the high level API and see if it resolves the issue for you too. Mark Radbourne MSFT |
Hi @markrad Thanks for the reply, i am seeing other intermittent connection issues where it tries to connect and cant (assume the server is holding a connection open and the device is trying to reconnect to it again?) which then produces one of the following reasons: Failed to initialize the platform If any of these errors occur and i try sending a message to the hub i get: sys_init error and the device just sits spinning its wheels doing nothing except from flashing the on board red LED. Tried to find where this is happening byt it is impossible. Have you seen any of these errors? Many thanks Ryan |
Hi @STEPHER2, Yes. As it happens I was debugging this just yesterday. Though I can't be certain that you are hitting the same issue I was able to cause the sys_init error by calling the EthernetInterface::init function twice. This causes a second call to tcpip_init. The sad truth is that the quality of the code in EthernetInterface is very poor. It doesn't check return codes and it fails to expose the network connected/disconnected events. Furthermore I found it very difficult to implement network recovery in the code and resorted to forcing a hard reset. You can view my code here: https://developer.mbed.org/users/markrad/code/FXOS8700CQ_To_Azure_IoT/. Mark Radbourne MSFT |
Hi @STEPHER2, Since I didn't hear back from you I am closing this issue. Hopefully the code I provided was some assistance to you in recovering the network connection. You are welcome to reopen this issue if the problem persists. Mark Radbourne MSFT |
Enabled the use AMQP for Azure IoT Client PCL library.
This change fixes a memory corruption caused by message queue when the following scenario occurs: MESSAGE1 is enqueued (address #1) MESSAGE1 is put in progress by mq MESSAGE1 is destroyed by the app MESSAGE2 is enqueued (re-using address #1, which was made available by the previous step) MESSAGE2 is put in progress by the mq MESSAGE2 processing is marked as completed by the app > Here the message queue searches the list of in-progress messages by the message address in memory. Since MESSAGE2 now has the same address of MESSAGE1 (which was freed), message_queue picks the entry for MESSAGE1 for removing from the in-progress list, leaving MESSAGE2 behind.
This change fixes a memory corruption caused by message queue when the following scenario occurs: MESSAGE1 is enqueued (address #1) MESSAGE1 is put in progress by mq MESSAGE1 is destroyed by the app MESSAGE2 is enqueued (re-using address #1, which was made available by the previous step) MESSAGE2 is put in progress by the mq MESSAGE2 processing is marked as completed by the app > Here the message queue searches the list of in-progress messages by the message address in memory. Since MESSAGE2 now has the same address of MESSAGE1 (which was freed), message_queue picks the entry for MESSAGE1 for removing from the in-progress list, leaving MESSAGE2 behind.
Having an issue in that initial connection to the Iot Hub is intermittent, it seems to sometimes hang whenever it reaches:
/*Codes_SRS_IOTHUBCLIENT_LL_02_021: [Otherwise, IoTHubClient_LL_DoWork shall invoke the underlaying layer's _DoWork function.]*/ handleData->IoTHubTransport_DoWork(handleData->transportHandle, iotHubClientHandle);
inside iothub_client_II.c @ line 766
Im using the mBed platform and cant follow the code because i cant breakpoint where inside the function pointer it specifically holds up?
The text was updated successfully, but these errors were encountered: