Two cores breathe cyan, but "offline" [RESOLVED]

Hi all, hope you can help.

Got a couple of Spark Cores the other day. I made a simple temperature sensor using a DHT22 and an example from a library.

This evening I added a longer wire to the DHT22, plugged it all in and… nothing. Core was acting offline even though it was breathing cyan. Took it out of the circuit - same. Breathing cyan but acting offline.

Weird, thought I. But then over the past 24 hours it has been randomly going offline, restarting and needing a reset. So I unboxed my second core, claimed it, swapped it in, and flashed it. Exactly the same as above.

So I reset it by holding down “MODE” until the quick-blue-blinks tell me it’s wiped and the slow blue blinks tell me it’s listening. I use the CLI spark setup to claim it again, and all is fine until it gets to “breathing rainbows” which doesn’t work (but it does breathe cyan). Anyway, I skip past that and I can see it is claimed on my account.

Here’s the extra-weird bit. Every time I pull the power and re-plug it, the online build IDE will give it a little “online” icon next to it, BUT I cannot get at it via cURL and “spark list” shows it as offline. Refreshing the IDE removes the icon. My code shouldn’t be killing it, because the reset removes it, right?

Totally confused and a little afraid that I’ve irreparably damaged my new toys, even though I can’t see how this circuit would do so (it’s this one: https://github.com/piettetech/piettetech_dht ).

Suggestions?

OK, so as soon as I posted I unplugged and re-plugged again. One of them came online and stayed online for a few minutes. It’s gone again now. Wait - while finishing this it came back.

I can see that my code wasn’t wiped as the variables are still reporting. And “spark list” seems to either take seconds, or close to a minute…

So, are you guys having cloud issues perhaps?

1 Like

i don’t think there’s a cloud issue since its not reported or heard of.

Maybe you can share the code for us to take a look? :wink:

Small side note; you mention that you reset the Core by holding down the MODE button. Although it’s true that something it’s being reset, it’s unfortunately only the wifi credentials.
To reset the Core to factory firmware, you’ll need to do a factory reset. The steps to do that are explained here: http://docs.spark.io/connect/#appendix-factory-reset
It comes down to holding the MODE button, and clicking the RESET button. Continue holding MODE until it starts banking white, after which you can release. Before it flashes white, it’ll flash yellow to indicate DFU mode, so make sure you keep holding until it’s white.

2 Likes

Thanks for the tip on resetting the firmware. Managed to do that and cores behave normally. So it must be in the code.
I stumbled upon other people with the same issue who are using the same library for the DHT22. For example: https://community.spark.io/t/breathing-cyan-but-not-connected/9093

My suspicion is with the wiring. When I added a longer wire, I imagine that it wasn’t a good connection, and failing to read the sensor was blocking execution and making the core unresponsive, so it’s breathing cyan but won’t respond to cloud requests. The blip in the IDE would be when it first comes online, reports to the cloud, then dies.

Got it working again by reversing my steps with the wiring and refactoring the way the code executes. If people have similar issues:

  • Put your wiring back to how it was(!)
  • Update any libraries
  • Debug over serial

If you’re specifically having this issue doing DHT22 stuff, then decouple your code so that failure to read doesn’t stop execution. The latest examples in PietteTech_DHT library is a good starting point.

3 Likes

I also had this same issue though I wasn’t using DHT. Just using the Serial1 comms. Had to reset in the same way and all worked again.

So what does the breathing cyan actually mean if its not "online"
I have seen this off and on for days while working with a photon.

Sometimes the last message I get from “particle subscribe mine” is “offline” and
"particle function list" shows the photon "has 0 functions or is offline"
But it is still breathing cyan.

A reset or reprogram and it will actually go online fine it seems.

What code are you running on it?

The firmware version is 0.4.4

Place the Photon in Safe mode and see what happens?

I am pretty sure this isn’t my code causing this: This happens maybe 1 out of 20 or so programming attempts.

I will do a program and see the event

{"name":"spark/status","data":"offline","ttl":"60","published_at":"2015-09-07T17:39:30.707Z"...

The photon LED looks all normal programming and then going into cyan breathing

particle function list
shows as offline

It will stay like this indefinitely, appearing connected but it is not.

All it takes is a reset to show

{"name":"spark/status","data":"offline","ttl":"60","published_at":"2015-09-07T17:43:18.300Z","coreid":"..."}
{"name":"spark/status","data":"online","ttl":"60","published_at":"2015-09-07T17:43:18.615Z","coreid":"..."}
{"name":"spark/cc3000-patch-version","data":"wl0: Nov  7 2014 16:03:45 version 5.90.230.12 FWID 01-f368ac30","ttl":"60","published_at":"2015-09-07T17:43:18.697Z","coreid":"..."}

(That is another offline event by the way)

And now it is connected fine and my function calls are working.