question

95504669 avatar image
0 Votes"
95504669 asked 95504669 commented

Azure sphere network switching

I use Avnet Starter kit Rev2 board. I followed the Azure IOT sample code provided.
https://github.com/Azure/azure-sphere-samples/tree/master/Samples/AzureIoT

Both Ethernet and wifi network interface is working. I implemented both Eth and wifi network in the same code so that the device can switch between these two network.
But I noticed that switching between network took 2 min 20 seconds. The "AzureTimerEventHandler" restarted when there was no data sending from device to HUB. This took around 2min 20 seconds.

How can I make the device switch its network immediately without waiting for a long time.

Thank you.

azure-sphere
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@95504669 Usually network switch happens immediately. To debug the issue further, could you please confirm the Azure Sphere SDK version and OS version which you are using? Are you connecting to a network through a proxy server? Please check the network logs by following troubleshooting guide : Get network diagnostics and see if it helps identify the issue.

0 Votes 0 ·
95504669 avatar image 95504669 AshokPeddakotla-MSFT ·

159543-image.png
159515-image.png
159574-image.png

159487-image.png
I get this connection retry expired message. Then the AzureIOT event handler restarts again.
159469-image.png


0 Votes 0 ·
image.png (19.2 KiB)
image.png (6.0 KiB)
image.png (6.5 KiB)
image.png (5.4 KiB)
image.png (12.7 KiB)

1 Answer

AshokPeddakotla-MSFT avatar image
0 Votes"
AshokPeddakotla-MSFT answered 95504669 commented

@95504669 Thanks for sharing the additional information. You will get IOTHUB_CLIENT_CONNECTION_RETRY_EXPIRED message when the maximum retry time is expired to reconnect the IoT hub client.

The Azure IoT Hub Client has a feature called RetryPolicy (which can be set using IotHubClient_SetRetryPolicy). It has a property that limits the maximum time the client can attempt to reconnect when failures occur. If that maximum time is reached, the Connection Status is invoked with status UNAUTHENTICATED and reason RETRY_EXPIRED.

Please see Connection and retry for Retry patterns for more details.

Regarding AzureTimerEventHandler and network switch delay, since there are no exact details available and/or logged, I suggest you please file a support request @ https://aka.ms/azsupt? Please let me know if you do not have a support plan.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @95504669 ,
Please share with us if you have any other questions related with your original post. Otherwise could you go ahead and mark this as answer?

Thank you so much.

Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

1 Vote 1 ·

Hi @AshokPeddakotla. Thank you for your response. I don't have a support plan. So I can't raise a support request. What should I do?

0 Votes 0 ·