I have an Imp that requests the json from my feed at
data.sparkfun.com/output/aGlx34p0*******ZgzqN.json?page=1
and it displays a graph from Google Charts and it has been working wonderfully until this week. The Imp program has not changed for weeks but now I am getting this error:
2016-01-04 12:54:48 UTC-6 [Agent] ERROR: Invalid JSON 2016-01-04 12:54:48 UTC-6 [Agent] ERROR: at getStreamData:377 2016-01-04 12:54:48 UTC-6 [Agent] ERROR: from GetHTMLResponse:136 2016-01-04 12:54:48 UTC-6 [Agent] ERROR: from requestHandler:125
Here is the code where the error occurs:
local trigger_url = "https://data.sparkfun.com/output/" + publicKey + ".json?page=" + page; local req = http.get(trigger_url, {}); //add headers local res = req.sendsync(); //send request <-- res.statuscode = 35 here.... server.log(res.body); local data = http.jsondecode(res.body); //<-- Invalid Json Error occurs here....
Here is a sample of the data from data.sparkfun
[{"temperature":"43.099998","humidity":"26.900000","wifi":"90","light":"28","timestamp":"2016-01-02T13:27:47.547Z"},{"temperature":"43.099998","humidity":"26.900000","wifi":"90","light":"28","timestamp":"2016-01-02T13:26:47.566Z"},{"temperature":"43.099998","humidity":"26.900000","wifi":"90","light":"27","timestamp":"2016-01-02T13:25:47.932Z"},{"temperature":"44.000000","humidity":"26.900000","wifi":"90","light":"28","timestamp":"2016-01-02T13:24:47.560Z"},{"temperature":"44.000000","humidity":"26.799999","wifi":"90","light":"27","timestamp":"2016-01-02T13:23:47.520Z"},{"temperature":"44.000000","humidity":"26.600000","wifi":"90","light":"27","timestamp":"2016-01-02T13:22:48.464Z"},{"temperature":"44.000000","humidity":"26.799999","wifi":"90","light":"29","timestamp":"2016-01-02T13:21:47.597Z"},{"temperature":"44.000000","humidity":"26.500000","wifi":"90","light":"30","timestamp":"2016-01-02T13:20:49.426Z"},{"temperature":"45.700001","humidity":"25.799999","wifi":"90","light":"27","timestamp":"2016-01-02T13:18:47.482Z"},{"temperature":"45.700001","humidity":"25.500000","wifi":"90","light":"27","timestamp":"2016-01-02T13:17:47.464Z"},{"temperature":"45.700001","humidity":"25.200001","wifi":"90","light":"27","timestamp":"2016-01-02T13:16:47.490Z"},{"temperature":"45.700001","humidity":"25.200001","wifi":"90","light":"27","timestamp":"2016-01-02T13:15:47.845Z"},{"temperature":"45.700001","humidity":"24.700001","wifi":"90","light":"27","timestamp":"2016-01-02T13:14:47.419Z"}]
Any idea why this is happening?