Long Term Photon Connection Stability


#101

I just had another reconnect failure with the fast flashing cyan. What does that mean exactly?

I’m trying to see if I can close the physical gap between my router and Photon.

Maybe I should cannibalize an old laptop I’ve got laying around to extract the antenna… maybe give it a little boost…

This isn’t looking good for when I want to finally mount this setup on my roof :frowning:


#102

Fast flashing cyan means the device has connected to wifi, and has connected to the cloud, and is waiting for the handshake to complete.

We can add timeouts to this so that the connection is retried if it doesn’t succeed in say 1 minute.


#103

I’ve brought the unit inside (closer to the router) and the device has been working reliably now for over 14 hours, which I don’t think I’ve ever achieved in the past (certainly not when it’s in its desired location outdoors). I think I may need to add an antenna for more reliable use, but there is definitely a case to be made here for a “reconnect timeout - retry” implementation. I look forward to your implementation, @mdma!

(edit) Remove irrelevant information about an issue I introduced myself.


#105

After cannibalizing an antenna with a u.FL connector from an old laptop, I have had rock solid connection stability for over 43 hours with the unit placed outside, where prior I was getting constant hangs on flashing cyan. I think this pretty solidly confirms that the Photon has some issues with completely stalling while trying to reconnect when placed in less–than–favorable signal situations.


#106

I am having this problem as well. Wifi signal is ok in my entire house but is also crowded: all channels have multiple SSIDs on them. The “uptime” of my photon after a hard reset is something like ten minutes.

I believed that firmware 0.4.6 removed this issue, but I keep getting it. (updated firmware by flashing tinker using online IDE).

The product that I am trying to build can not use an external antenna, and has to run tinker. (as soon as first proto is “publishable” I will share it here and explain why, cause it is a cool project :-))

So: main question: can a timeout be build into the flashing cyan? preferably a very short one, because my product needs to be online continuously for days.

thanks in advance,

Rolf

PS related: when claiming a photon for the first time, it does a firmware update. I assume with the latest firmware, ie. 0.4.7?


#107

Is there anything we can log/test to debug this issue ?
I get it after a few days, I have the RGB led off, but the D7 LED still flashes in a pattern that shows my program is running, yet the photon never reconnects untill I press reset.


SYSTEM_THREAD - full device hang
#108

I have this problem too . My app sometimes hangas after an undetermined (long) time. It can be 3 days to more than one week without problem.
I’m using SYSTEM_THREAD(ENABLED) but it does not prevent my app to hang at a point while the firmware thread was flashing cyan. After a simple reboot it was OK again.
I probably have to verify if all send data to wifi are encapsulated with connection checks before, but there’s probably still something wrong with the firmware :-/


#109

I’m also seeing this issue, but only after a very long time. I have two dozen devices that have been running 0.4.7 continuously for about 3 months. In the last month or so, 5 of them have gotten stuck in the flashing cyan state until I gave them a hard reset. @mdma are you still planning to add a timeout to retry the connection when it gets stuck in that state? Because that would be awesome.


#110

I was seeing this a lot in 0.4.7 and think this has been fixed in 0.4.8-rc1 … Will be in the 0.4.9 if you need to wait for a non-rc release, although 0.4.8-rc1 is pretty stable from what I can see.


#111

I’ve been poking around on GitHub looking for 0.4.8-rc1 for Photon that contains the UDP::stop() fix, and can’t seem to find any pre-built part1/part2 binaries for that release (looks like everything is going towards the Electron at the moment). Has anyone built this already to save me the time of building it myself? I desperately need this fix (tired of trudging through snow every four days to reset the device)


#112

Sorry for the difficulties this is causing. 0.4.9 is scheduled for release early next week which contains the fix.


#113

That’s great, thanks @mdma!


#114

I am facing the same problem, restart and could not work after fails the connection.
Still waiting for the solution to this problem.
Thanks


#115

Think this has been fixed for a while, are you running with v0.4.9 particle firmware? If so try and post some detail on what is failing and we can see if it’s the same thing :slight_smile:


#116

@mhazley : Thanks for the response.
I am sorry, a bit late and my device is Core instead of Photon. I used 0.4.9 particle firmware from Web IDE by simply testing a simple routine program for scheduling every 3 minutes measurement.
Herewith my code:

'#include "application.h"
int tstep, pstep;

// interval measurement every 3 min
int interval = 3;

void setup() {
 Serial.begin(9600);
 Serial.println("Starting");

// Particle time initalzation 
   Particle.syncTime();
   Time.zone(+9);
}

void loop(){
    int sec;
    tstep = Time.minute();
    sec = Time.second();

// If the time has come
    if((pstep != tstep) && ((tstep % interval) == 0)){
        pstep = tstep;
        // doing measurement here
        Serial.println("sensing");
    }

}

At first, it works for 15-20 minutes (by checking from serial terminal and status from $particle list on cli). But, somehow it fails, the status is offline and the led always blinking green – breathing cyan – and white flash with small red led, then restart again…

Pressing the reset button does not help, hardware resets (take power off) works well to re-starting the service.

Does anyone have the same issues up to now? and maybe can share how to deal with it.

Thanks.


#117

@mdma @mhazley Hi, I am facing the same issue, my photon running v0.4.9 sometimes stuck with blinking green led (slow blinking not rapid blinking) until I restart photon and seems like my code loop() stops running. Sample code below:

SYSTEM_MODE (MANUAL);
SYSTEM_THREAD(ENABLED);

void loop() {
	if((millis() - timeExternalInterruptRetry) >= 300){
		timeExternalInterruptRetry = millis();
		external_interrupt();
	}

	if (mqttHandler.isConnected()) {
		mqttHandler.loop();
	}else if(Particle.connected()){
		// below time check should be greater than keep alive
		if((millis() - timeMqttRetry) >= 10000){
			timeMqttRetry = millis();
			mqttConnect();
		}
	}

	if (Particle.connected() == false) {
		Particle.connect();
	}else{
		Particle.process();
	}
}

My internet is not very stable here. When internet gets back, photon still in slow green blinking.


#118
if (Particle.connected() == false) {
		Particle.connect();
	}else{
		Particle.process();
	}

This is one possible factor contributing to your problem,
Particle.connect() should not be called during a connection attempt.
Add a timeout > 30sec before any subsequent call to Particle.connect().

In addition you could also check the WiFi status (not only cloud).


#119

@ScruffR Thank you for replying
This code works fine, but when my internet malfunctions in that case it stuck to slow green led blinking.

When photon is in rapid green or rapid cyan blinking and my internet fails then it retries itself with no issue.

I am trying to totally rely upon system firmware for cloud connection, so that I don’t have to write my own logic for internet connection.

And the code reference I got from official reference


#120

Yup, that official reference is “old” code that just shows the general use (not necessarily best practice), but I’ve had multiple cases where the suggested treatment helped the users issues.


#121

@ScruffR Ok I implement as you suggest. Thank you very much. :smile: