I’ve bought two photons.
The first I put on a relay shield and made a basic remote-controlled light switch. Zero problems - it has been running for weeks without issue, only resetting when I have a temporary power outage. Absolutely love this board!
The second… worked pretty well for a while, but now I cannot get it to stay connected for longer than 5 minutes. In fact, it’s almost exactly 300 seconds every time I reset it. I’ve put it physically next to the other one (which is surrounded by a plastic enclosure and a nest of 14GA wire) and I have the same issue, so it can’t be the strength of my wifi signal. My router is a Netgear Nighthawk about 10 feet away, should be more than enough signal to go around.
The firmware for this second photon is just sensor readings - I have it on a custom PCB which has pinouts for OneWire, I2C, SPI and analog and all
loop() does is cycle through the sensors. I even added a call to
Particle.process() to each sensor’s read function even though none of them should be blocking for long. I have an LCD connected to the board via the TX serial pin and it continues to display updated readings after the RGB starts blinking cyan, so the firmware is running even though the WiFi doesn’t work. Nothing special happens at the 5 minute mark, or any other predefined time. According to the IDE I am using the latest firmware (0.5.1).
I have tried @rygh’s suggestion of resetting the WiFi when
Particle.connected() returns false at the beginning of
loop(), and that doesn’t seem to solve the issue at all. I have similarly used
System.reset() and that does work, in the sense that the device will be connected most of the time, but I lose calibration data stored in local memory. Obviously I could reload those values from the cloud but that seems like an overly cumbersome solution - especially considering I know a Photon can run for weeks without needing a reset.
Is it possible this is just defective hardware? For the first Photon, the setup process via the Android app worked the first time without issues - for the second it took a couple of resets and false starts to get it to connect. Not sure if that’s my phone or not but it definitely made me feel like the second board had some boggarts in it.