I’ve followed the directions about the number of red blinks, but I can’t for the life of me count them. Anyone see what error code it is?
Here is a pastebin to my code. I’m thinking the problem is either in my use of the httprequest or the pid library I’m using but I can’t interpret the error so I don’t know what to look for yet. http://pastebin.com/1eetXqyv
The error you are getting is one red flash which indicates a hard fault. This is similar to a segmentation violation on Window or other computers where you are following a bad pointer or using something as a pointer that isn’t one.
The way to read the red flashes is: first there is an SOS … — … pattern, the a pause and then the number of flashes for the error code. Then it repeats with SOS followed by error code.
As @peekay123 answered while I was typing this, the “&” is your problem most likely.
I checked the fault code page. It was just hard for me to visually see it because of how fast the blinks were and since I had never seen an example. It might be worthwhile to collect an example video of the different error codes for a point of reference. I ended up having to slow the video down on vlc to see it was a hard fault.
The crash still happens with the string lines fixed.
It works properly for a minute or so and then when I send it:
curlhttps://api.spark.io/v1/devices/DEVICE_ID/setPoint -d access_token=ACCESS_TOKEN -d "args=140"
It works and changes the variables properly and then a couple minutes later it still crashes.
Interestingly enough I have removed the extra variable lines completely (Now I'm just using allInfo) and so far it hasn't crashed at all. It's possible the first flash with the ampersands removed wasn't successful and I just didn't notice. So it looks resolved.
Nevermind. It is still crashing just much less frequently. I'm going through the pid library and the rest of my code to see what could be going on. If anyone else sees anything obvious, let me know!