Core flashes and works perfectly, photon flashes but blocks

This has probably been answered already - but I’m struggling to find an exact reference.

My problem is quite strange. I am only using the Web IDE to write, save, verify and flash my code. I have 2 Spark Coress and 2 Photons. I have been able to successfully verify my code and flash it to a core. This works as I expect it to (more or less but that’s probably down to my dodgy wiring - removing this functionality makes it work completely as expected).

My problem arises when I try and flash a Photon. The code verifies fine and is targeting the photon. The flash is successful and the Photon reboots, and seemingly joins the cloud. I say seemingly because the RGB LED turns cyan but does not breathe cyan. The Particle app shows the photon as offline, however the Particle Dashboard reports that it has connected. Furthermore refreshing the web IDE shows it as connected. I haven’t tried the API yet (I suspect that will report as offline as well).

Can anyone explain as to why this may happen?

I can get back from this by doing a complete factory reset, but I’m unable to flash firmware over the top…

Surprisingly the API is reporting them as online - even a Spark core that hasn’t been online for >12 hours.

Adding to this. I’ve just refreshed one of the photons with a very simple program, which appears to be working correctly. I can only put this down to the program I successfully flashed being incompatible (somehow) with the Photon but not the Spark Core. This is something the compiler doesn’t pick up at all. Happy to share the source code if needed - but perhaps not tonight :wink:

Rather than doing a factory reset, try Safe mode next time, it’s way more convenient.
Sharing the code might be helpful to check if there’s anything in there that can cause issues.

Hi @elbeardo,

Hmm, it sounds like maybe the app is causing the photon to freeze up? In that case having our firmware team look at the code would be helpful, so we can try to find any bugs that might be causing this on the Photon.


DId you replace SPARK_WLAN_Loop() for Spark.process() on the photon?

Are you using TCPClient as well ?

1 Like

@elbeardo, here are a couple of “gotcha’s” that I have found through experience:

---- GOTCHA #1 ----
Note CORE vs PHOTON issues with PHOTON
    Serial2 - not implemented and blocks processing

---- GOTCHA #2 ----
Serial1.begin() & Serial2.begin() BLOCK if called in setup (but I think this is an issue for both CORE and PHOTON)

Hi all,

I was about posting the same issue about serial2. Logic state is always high on D0, and low on D1 no matter what.
In a loop with println on serial1 and serial2 every 5 seconds, both photons going south after 6 iterations. If you comment serial2 println, all ok.


Would this affect a SPI device? I am trying to get my nRF24 radio working and it locks up everything no matter what I do. Not sure where to start. Does SPI map to Serial1?