Hi,
I’m seeing an occasional incorrect spark.variable() value when reading via the api. This has happened on more than one device/app so it’s not something in my firmware. The variable appears to take the value of a different variable.
Most recent is reading a variable that should not have changed from 0 without outside interaction and is only ever assigned a value of 0 or 1 but was read back as 4827, the json from api call below.
I’ve removed the device id for obvious reasons.
2015-09-15 01:21:40.6675|TRACE|Read variable state for , Value: {
"cmd": "VarReturn",
"name": "state",
"result": 4827,
"coreInfo": {
"last_app": "",
"last_heard": "2015-09-15T00:21:39.974Z",
"connected": true,
"last_handshake_at": "2015-09-14T10:49:16.182Z",
"deviceID": "2d0.............739",
"product_id": 6
}
}
Yesterday I had something similar where the value that was for a variable named ‘humidity’ was returned for a request for the ‘temperature’ variable, it is identical to lots of decimal places and was not from an incorrect sensor read as I also published the values when read from the sensor and have them via the streaming api so I knew exactly what had been read. See below. First 2 lines are the published values (with appropriate values - the sensors in a humidity controlled environment), then the result of the variable read follows that.
2015-09-14 21:13:42.3825|TRACE|NewSparkEventEvent -> DeviceId: 290...739, EventName: Humidity Data: Measured humidity as: 21.450562
2015-09-14 21:13:42.4138|TRACE|NewSparkEventEvent -> DeviceId: 290...739, EventName: Temperature Data: Measured temperature as: 27.946829
2015-09-14 21:13:55.2888|TRACE|Read variable humidity for , Value: {
"cmd": "VarReturn",
"name": "humidity",
"result": 21.4505615234375,
"coreInfo": {
"last_app": "",
"last_heard": "2015-09-14T21:13:52.370Z",
"connected": true,
"last_handshake_at": "2015-09-14T20:00:02.562Z",
"deviceID": "290...739",
"product_id": 6
}
}
2015-09-14 21:13:55.2888|TRACE|Read variable temperature for , Value: {
"cmd": "VarReturn",
"name": "temperature",
"result": 21.4505615234375,
"coreInfo": {
"last_app": "",
"last_heard": "2015-09-14T21:13:53.253Z",
"connected": true,
"last_handshake_at": "2015-09-14T20:00:02.562Z",
"deviceID": "290.....739",
"product_id": 6
}
}
Both these devices have been flashed recently (last 7 days or so) so should be running the latest Particle firmware.
I also constantly see last_app as “”, I’m guessing that’s just broken?
Cheers.
Steve.