Particle OS 1.2.1 is unstable

Hi,

I have upgraded my photon with the latest version of particle OS 1.2.1.
Unfortunately my code freezes (worked on all version from 0.9.0 to 1.1.1), and the photon gets red led. I have a very complex code, with sd card and asynctcp library with:
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(MANUAL);

I started to find the problem, and I noticed:

void setup() {

WiFi.connect();

}

If I comment out (//WiFi.connect():wink: then my code does not freeze anymore.

I have tried to reduce my code without the libraries and use only the few line of code but it works then, so must be a conflict with something.

The other thing is that if the photon crashes it always flashes red and if it is connected to my macbook pro via usb, my laptop just starts to lag meanwhile I have never ever noticed my laptop to lag… if I disconnect the usb cable no lag at all…

Now I downgrade to 1.1.1 and works like should. (i did not find 1.2.0, i am not sure why there is no 1.2.0 version)

Hope it will be fixed soon.

Thanks

i went further and I found the issue:

Hope it will be fixed soon

Now I added this:
if (WiFi.ready()) {
IPAddress myAddr = WiFi.localIP();
.
.

}
And it seems to work. Can you please confirm that wifi.ready is safe to call with SYSTEM_THREAD(ENABLED);?

Thanks!

It is safe to be called with or without SYSTEM_THREAD(ENABLED)

BTW, whenever you mention something like this

You should actually tell us what exact red code you see - the blink count has meaning and hence should be stated.
You'll typically see an SOS code (...---...) followed by 1 to 14 slow blinks followed by another SOS that number of blinks between the SOSs is of importance.
https://docs.particle.io/tutorials/device-os/led/photon/#red-flash-sos

OK! Thanks for the information. Ok, next time I will be more careful with the red light! Sorry about it!

1 Like