My photons are hanging after calls to ‘WiFi.clearCredentials()’ when multithreading is enabled. The photon’s LED is slowly flashing blue and the user application is not executing after the call to ‘WiFi’. Is this happening to anyone else?
At the moment this seems to be default (but will be reworked - look here) as Listening Mode itself is blocking user code. One reason is the shared resource Serial that is taken hold of for entering credentials this way, to avoid app firmware interfering.
I guess one workaround might be to change for a non-AUTOMATIC SYSTEM_MODE and disconnect WiFi before clearing credentials.
OK, I’ve now tested your code, but added some D7 blink to actually see if user code still runs and I also added some code to prevent user::process() from permanently retriggering the WiFi test, once isTime became true (I think this is required).
And now I’m sort of stuck, since I can’t see any hanging.
This is my serial output
My blink only ever stopped for a brief moment while acquiring the WLAN_CIPHER and reconnecting to the cloud for about a second.
With SEMI_AUTOMATIC there was no observable delay in the blink at all.