Photon losing Wifi

Hey,

I have a Photon laying on my desk connected to the local wifi. The problem I have is this

  1. It loses connection to the wifi
  2. blinks green searching for wifi
  3. finds wifi and starts blinking cyan
  4. locks up and never leaves the authentication phase
  5. I press reset and it does it all over again with the difference that it connects directly and start breathing cyan

I have observed this multiple times over a couple of days now. Any thoughts?

I’m on a WPA2 network in a office setting.
Flashed through the cloud with a neopixel example code for the rainbow.

2 Likes

@sjunnesson, can’t vouch for the 4.0 version of the firmware currently on the web IDE but I can tell you that LOTS of updates will be included in the upcoming release which may fix this condition. Perhaps @BDub or @mdma have something to add?

Having much the same problem. Have tried with antenna and seems to make no difference. I have a spark core which seems a lot more stable. Couple of questions: does the photon automatically detect a UFL connected antenna -and is there any update I should be doing through the cli? Greatly appreciate any help,have 3 photons and so far not seeing the improvements expected after the core.

@DRCO, the Photon does not auto-detect the antenna. The (soon to be released) firmware update has a command for switching the antenna. :slight_smile:

1 Like

If not done already, please update to the 0.4.3 version of firmware from our github releases page.

2 Likes

Hi @mdma - thanks for your response. I’ll need to put the obligatory newbie warning here, so bear with me…
When I try to update the firmware online (using the CLI) I get:
" I couldn’t find that: system-part1-0.4.3-photon.bin"
To be clear on process,
*I log on to the CLI (using email / password)
*type in "particle flash MY PHOTON’S NAME system-part1-0.4.3-photon.bin"
By Photon’s name, I take it you actually mean the name eg: “Harry” not the device number or something.

Also to use the DFU: the Github repo notes:
*Put the device in DFU mode (flashing yellow LED)
*open a terminal window, change to the directory where you downloaded the files above, and run these commands: dfu-util -d 2b04:d006 -a 0 -s 0x8060000:leave -D system-part2-0.4.3-photon.bin

There are no files “above” - I assume it is referring to the downloads at the bottom of the page:

So,am I right in assuming the process would be:

*Download the files from the"download" section of Github repository to a directory on my PC (Windows 7) presumably the same directory the DFU files exist as I’d need to open the command line prompt there for it to work
*Connect Photon to PC USB - set Photon in DFU (flashing yellow) mode
*Open a command line prompt in the directory the downloaded files are stored
*type in: “dfu-util -d 2b04:d006 -a 0 -s 0x8020000 -D system-part1-0.4.3-photon.bin”
*wait for a response
*type in: dfu-util -d 2b04:d006 -a 0 -s 0x8060000:leave -D system-part2-0.4.3-photon.bin
*wait for a response
*Disconnect Photon…
Happy days…
Have I got this right?

That sounds correct to me! Thanks for working this through in detail.

The intent was that this information would be in a wiki page so that we don’t have to repeat it for each release. I’ll update the wiki based on the level of detail in your notes so that everyone is clear on the process! :+1:

1 Like

OK, maybe off topic here but when trying the DFU mode update I keep getting:
Opening DFU capable USB device… Cannot open device
I have updated the drivers for photon and device manager sees it as Photon DFU Mode, though there is a little yellow sort of exclamation symbol next to the icon. Any ideas?

@DRCO, the triangle means the driver is not working. Did you install the Zadig driver as per the documentation?

1 Like

I believe Homer Simpson would have said, : “Doh…!” Thanks Peekay123 - seems to have worked.

2 Likes

This was a response to me asking if the antenna will work on the Photon. Is this incorrect?

1 Like

[quote=“peekay123, post:4, topic:12321, full:true”]
@DRCO, the Photon does not auto-detect the antenna. The (soon to be released) firmware update has a command for switching the antenna.
[/quote] asking because of this

Hi @mdma, Just wanted to confirm that I only download the two relevant photon.bin files - and run the commands as described in the github repo. Thing is, while I had no problem running them from DFU, I can’t seem to connect the Photon via USB / CLI for wifi setup.
I keep getting:

C:\Users\xxxx\Desktop>particle setup wifi

! serial: No devices available via serial. Any ideas on that one - may be way off topic here?

OK, just an update - but the DFU upgrade made no difference. The Photon is good for about 15 minutes, then goes into constant rapid blink cyan - same as before. Does not recover. I have a Core working fine in the same position. Unlike the Core I have run Blinky as a test program on the Photon, that seems to run fine while the unit is offline.

@DRCO , I’ve started using this code to deal w/ my photons losing their grip on the cloud:

1 Like

Hi @bpr, just a note to thank you for your help, I integrated your code into my sensor monitoring project and you’ve kept me up and running after multiple chokes. Great work! To add my 2 cents on causes for the dropout, I’ve tried to test while running microwaves, vacuum cleaner, mixers, hair dryers - anything I thought might cause RF interference and there’s no pattern I can see to to what’s causing the problem. In my case the Photon seems to spend more time offline than on - which is pretty poor performance compared to the Core which seemed to just chug along fine. I hope the Particle guys can sort this out - but for now at least I’m online enough to get readings.

1 Like

@bpr, @mdma Just an update from my end on the flashing Cyan disconnect problem - using bpr’s code improves things for a while - but the fault returns and terminates connection to WiFi after about three hours - with the flashing continuing until power down - reset. I have now had this fault on two of my three new Photons. I have sent details to the Particle guys and hope this can be resolved. For now I have to revert to the Particle Core - I’m up for any other suggestions and wonder how many people are having this problem - it doesn’t seem to be being widely experienced by forum members.

@DRCO , could it be a router issue?? I’m using an ASUS RT-AC56U with 5GHZ not enabled. You don’t happen to be using this model, do you? I hope I’m not speaking too soon, but I may have solved the problem for me by another iteration of the reconnect code, but also probably more importantly, I changed some of the stock settings on my router and now NO PROBLEM! Just sorry I have to throttle the router speed. @mdma Maybe we need a wiki for troubleshooting router settings for Particle devices.
Here’s the new reconnect code:

#include "application.h"
uint32_t lastTime;
volatile int lostconnectionTimeUnix = 0;

void setup(){
//Your normal setup code here
}//setup
    
void loop() {
    if (!Spark.connected()) {  //record when photon lost connection
        lastTime = millis();
        while(millis() - lastTime < 500) {Spark.process();}            
        Spark.connect();  
        lastTime = millis();
        while(millis() - lastTime < 500) {Spark.process();}      
        lastTime = millis();              
        while( (!Spark.connected()) && (millis() - lastTime < 3000) ) {Spark.process(); }
        if(firstlostconnectionTimeUnix == 0) {firstlostconnectionTimeUnix = Time.now();}    
    }//if (!Spark.connected())
 
    if (Spark.connected()){
        lostconnectionTimeUnix = 0;

//normal loop code here

    }//if (Spark.connected())       
}//loop

Here’s the settings I needed on my router:

Hope it helps.

1 Like

Hi @bpr, thanks again for your input, and the contributions of the other forum members. I’m not running the ASUS router - I have a Belkin ADSL / 4 port /WiFi , model F7D2401v1. I also used the Android WiFi Analyser app, suggested by one of the forum members and placed it next to the photon while it was disconnected and rapidly flashing blue - it showed pretty good coverage (about 2/3 signal strength compared to standing next to the router). I reset the Photon and it found the network quickly (breathing cyan) with no increase signal shown on the android app. Regarding slowing the router speed, it isn’t an option for me. For my purposes, I will not be able to access the routers at the point of installation, so I’ll need to have a reliable solution that’s configured in the Photon firmware - or maybe even a hardware reset using a MOSFET. I’ll be giving the second iteration of your code a go today and also @kennethlimcp 's code as well on one the other devices. Luckily I’m only sampling a sensor every 5 minutes or so - unfortunately the devices will be installed in places that are remote (from me) and in residential homes, so probably susceptible to RF or Microwave interference .
I’ll update how it all goes…

1 Like

Hi everyone, I tried @kennethlimcp 's code and it kept things going for a few hours - then the Photon went into the familiar constant blue flash again.I was unable to get the second iteration of @bpr 's code to run (returned “error: ‘firstlostconnectionTimeUnix’ was not declared in this scope”, and that is probably my fault - I mentioned at the beginning, I’m not an experienced programmer, but I do have a colleague who is - I’ll get him to look at debugging my attempt at using the various contributions (as applied to my project) and get back to you with the results. So far, bpr’s first iteration returned the best results.