Photon keeps syncing to cloud - but I'm not using cloud !?

My Photon has a good wifi connection, When iI start up it gets on to the AP really quickly.
But…
every now and again it flashes cyan and appears to be trying to cloud sync. I’m not doing any cloud stuff though. Sometimes it appears to disconect and reconnect to the wifi. Is this normal?

I’m just running a simple test sketch to read an analog pin and send the reading to
the serial port if it rises above a certain value( when I touch the pin with my finger).

Did try to use the log function to grab errors and see if the device lost wifi or rebooted but don’t think it
works if there is no serial connection.

TIA

Unless you've disabled the cloud (by coding) it will default to connecting to the cloud. Look for system modes in the docs for further info.

Thanks - I’m aware of the device modes and what the lights mean, but Its odd that it seems to keep reconnecting(?) (rapid flash - cyan) I would expect this once at boot up. Sometimes I see a green flash or 2, which I assume its is l connecting to the internet.
The system modes seem to let you have wifi or no wifi, but not wifi without cloud as far as I can see.
I need to know what its doing and what the possible reconnection cause is.

Just trying to make sure everything is robust before I start diving into complex stuff.

which one of the images on this page is it doing?

https://docs.particle.io/guide/getting-started/modes/photon/

“Connecting to the cloud” flashing cyan. sometimes for 20-25 seconds

do you have any 5ghz networks that are named the same as the 2ghz network you’re trying to connect to?.

Interesting - but no. I do have a 5ghz network but it has its own unique name. Photon does not work on 5ghz as far as I am aware. My 2.4ghz network is only used by the Photon and for flashing firmware.

no it doesn’t work on 5ghz but it cant seem to tell what network is 5ghz and which is 2ghz if they have the same name. Yes odd I know. No easy fix for you! :).

How long does it stay connected before a drop?

Ok I don’t think 5ghz is an issue then. Its connected most of the time (breathing cyan) then sometimes the cyan will flash for a second or 2. Sometimes 20-25 sec. Maybe a couple of times an hour, best case , worst case a few times
in a minute. As I mentioned I sometimes seea green flash which I guess means a wifi reconnect.

Not quite!
While AUTOMATIC mode does automatically hook you up to WiFi and cloud, SEMI_AUTOMATIC and MANUAL don't do either.
But all three modes allow you to control whether you want cloud or WiFi or none at all.

To control that, you have the WiFi.connect()/WiFi.disconnect() and Particle.connect()/Particle.disconnect() pairs.
While Particle.connect() (=hook up to cloud) does require WiFi.ready() to work and implicitly calls WiFi.connect() if it's not already WiFi.ready(), WiFi.connect() doesn't do anything to start a Particle cloud connection.

Hence being aware of the exitence of the SYSTEM_MODEs and understanding what they do and how they work are two things :wink:

1 Like

@ScruffR: Thats a concise and better explanation of System Modes in context, compared with how the System Modes doc. page explains it.

So… If I get a few rapid cyan flashes now and again but am not doing any linking to the cloud thats acceptable?

But: if I get a few green flashes just after the rapid cyan then the devices has gone through a disconnect/reconnect cycle?

I’m just concerned that whatever is going on during that cloud sync is sometimes causing a disconnect/reconnect.
Maybe I’'l just disable cloud and print wifi sig. strength to the serial port and see if it drops out or loses the serial port connection.

Yup, that might have multiple causes like temporarily "blocking" code or radio noise or so, but if you don't need the cloud who cares :wink:
I'd just decouple your code from the cloud tasks by use of SYSTEM_THREAD(ENABLED).

If you need WiFi but not the cloud, I'd go with this

SYSTEM_THREAD(ENABLED)
SYSTEM_MODE(SEMI_AUTOMATIC)

void setup() {
  WiFi.on();
  WiFi.connect();
  waitUntil(WiFi.ready);  // or waitFor(WiFi.ready, msTimeout)
  ...
}

You may still see WiFi disconnects due to radio noise, weak signal or even a IP release caused by your AP, so your code should be prepared for that at any time.

1 Like

good suggestion - thanks.

I’ll leave it running like this and see what happens.