SOS hard fault with (official) ThingSpeak library on Core

I am trying to get the official ThingsSpeak library running on my Core but I’m getting a SOS hard fault. It actually shows to sequences of SOS + single flash.

I’ve added extra debug statements to isolate the point of failure but it’s not quite the same every time. I’ve also added an 10 s delay at the beginning of the loop to allow connections to Particle cloud to be established. The code runs to the top of the connectThingSpeak() method and seems to fail around a trivial statement. This and some reading of posts on other users’ SOS problems might suggest a time out or something happening with connections in the background. But I have no idea to resolve the issue. I thought previous known SOS problems had been remedied…

My code is here.

Anybody that has gotten the official ThingSpeak library to run on their Cores? Any other suggestions? I’m getting desperate…

Hi. I’ve gotten it running on Photons and Electrons, though I have to admit that I haven’t tried any of the recent versions on the core. Can you post your code? I’ll warm up the cores I have an double check that I haven’t broken them.

-Rob

Hi Rob! Thanks for the input. Did you have to do any changes to the library code? At least the dtoa()/dtostrf() would need some amending I guess.

I’ve linked to my code in original post towards the end.

Rob @rpurser, did you have an opportunity to try the code out?

I tried the same code on my Photon and the result was the same: SOS + 1 flash (twice).

How to debug this? I currently use the web IDE. Do I need to go local and get some JTAG debugging going?

I think you have a possible zero-div exception if tot is zero (which would only happen after a relatively long time, tho’)

  tot++;
  frac = (float) fails/tot;

And in your code client is only a local/automatic variable and will cease to exist once you leave setup().
Try to make client global.

Arghh, how could I miss this. Just shows how blinded one becomes staring at one’s own code.

I’m not too worried about the divide-by-zero :wink:

Thanks for the help, @ScruffR!

1 Like