Understanding Return Values from the Cloud

I followed the annotated example for setting up a LM35 temperature sensor. When I make a call to the webpage I get infomation returned but it is not at all what I was expecting.

    {
  "cmd": "VarReturn",
  "name": "temperature",
  "result": [
    0,
    0,
    8,
    30
  ],
  "coreInfo": {
    "last_app": "foo",
    "last_heard": "2013-12-19T05:03:23.905Z",
    "connected": false,
    "deviceID": "REDACTED"
  }
}

Using the tinker app I see a value of about 438 on A0 so I was expecting a similar number from the webpage. Instead I am presented with 4 values? Also the coreInfo->last_app doesn’t seem right as I don’t have any apps named foo.

Can anybody explain to me what I am seeing?

It’s a bug right now. You are seeing a “byte code” response instead of an int. See https://community.spark.io/t/reading-data-from-core-comes-in-a-weird-format/767

Dave O

1 Like

I was thinking it was encoded in Hexidecimal format as well, but 0x830 = 2096 which seems like a railed 11 bit + 1 reading.

Yup, it’s a known high priority bug. Thanks!