Arm Mbed and Pelion Device Management support forum

Wi-Fi not reconnecting after connectivity loss

Hi,

I’m hope I’m missing some basic. With a simple Pelion app publishing regular value changes over Wi-Fi this works fine for periods from an hour to maybe a day or two until it loses connectivity. It then does not reconnect. I’m assuming some momentery loss is happening I can easily recreate by disabling the Wi-Fi access point when connected.

Is there anything I can to to either enable it to reconnect automatically or handle some notification of loss and manually re-connect?

The Serial USB reports 2 errors:
client_error(6) -> Client in reconnection mode NetworkError
client_error(12) -> Client in reconnection mode DnsResolvingFailed

It the client appears to be in a reconnecting state but never succeeds.

To reproduce: I’ve tried two example applications (the second below appears to have the latest mbed-cloud-client.lib). Simply downloaded to the online compiler, changed the Wi-Fi SSID/password and deployed/run.

A similar report but no follow-up.

Board: https://os.mbed.com/platforms/ST-Discovery-L475E-IOT01A/

Examples:
https://os.mbed.com/teams/ST/code/pelion-example-disco-iot01/

Thanks,
Chris

Hi Chris,

I tried building mbed-os-example-pelion on DISCO_L475VG_IOT01A, and connect it to my mobile’s wifi hotspot. I disable/enable hotspot to make device re-connect about 5 times, it works every time.

Could you provide reproduce steps and the frequency?
And for detail log, please set "MBED_TRACE_MAX_LEVEL=TRACE_LEVEL_DEBUG" and "mbed-trace.enable" : 1 in mbed_app.json

Regards,
Desmond

Hi Desmond,

Thanks for looking into this. Intesresting that you don’t see any issues. The steps to reproduce are:

  1. Import new project into the online compiler using the link you used.
  2. Add the required Connect cert.
  3. Change the SSID to match
  4. Compile and deply
  5. Initially it connects and changes to the Counter come through to the Portal etc.
  6. Wait for a few value updates to come though.
  7. Stop and start the WiFi access point. It only needs to be down for the shortest time.
  8. Observe that it starts logging ‘send already in progress’ with 'm bed-trace.enable set.
  9. Observe that it gives the errors above and never reconnects in my tests.
  10. Observe that it starts logging ‘object NULL, in reconnection mode or not registered’

I’ve tried 2 local WiFi routers and a mobile Hotspot (picking-up from your testing), all with the same results.

If I enable TRACE_LEVEL_DEBUG the log is very busy and it often doesn’t seem to fully register with Pelion.

Is there anything else I can tweak to provide better logging?

I’ve not figoured out how to attach a text file. Attached an image of the relevant output with ’ mbed-trace.enable’ set.

Thanks,
Chris

In case it helps, a DEBUG log is here:
https://gist.github.com/Envoid/510244e4d56e213891fbdd0ea1740245

What Wi-Fi firmware version are you using? The ISM Wi-Fi module firmware should be updated, if possible. Reconnection issues in DNS resolving typically means that the Wi-Fi (or other connectivity module in question) is not responding/working normally anymore. You should update the firmware and report possible issues with the Wi-Fi module to the Wi-Fi driver repository;

Hi @jannek,

Thanks for the reply and the links, I’ll give it a try. It could well be the firmware, I hadn’t thought of that. (I would have hoped that recent boards would come with reasonably late firmware already). I’ll report back.

Chris