Photon and wifi

hello
am using photon in my project
my q is
how I can make the photon reconnect to the cloud again wen there is internet?
so wen I have internet I want it to be connecting to cloud and when there is no internet I want it to work also ,so wen the internet come I want it to reconnect to cloud again ?
I tried the
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_MODE(AUTOMATIC);
before setup(void)
it works with out internet or cloud but wen there is internet it not reconnecting to cloud again
how I can make it like that Auto to work with internt cloud and with out ,
thanks

You can stick with AUTOMATIC when you use it in conjunction with SYSTEM_THREAD(ENABLED).

You can also use the functions shown in the docs, to probe for WiFi and Internet and/or the Particle cloud
Just have a look there
https://docs.particle.io/reference/firmware/photon/#wifi
https://docs.particle.io/reference/firmware/photon/#cloud-functions

There are also lots of similar questions that can be found with the search feature of this forum :wink:

2 Likes