Reading Sensor Data

Home Forums mDot/xDot Reading Sensor Data

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14529
    Zia Syed
    Participant

    Hi,

    I am trying to read the sensor data. I can see the packet format here, but not sure how to convert, for example two bytes of temperature reading, into a single value. http://www.multitech.net/developer/software/dot-box-and-evb-software/data-packet-format/

    Is there a sample code that demonstrates doing that?

    Here is the raw hex data “\x0e\x00\x00\x10\b\x062}\x05\x00\xe3\v\x01\xce”
    Found Temperature Data bytes: 1 205

    The mDot screen shows Temperature 28.88C

    Thanks,

    #14605
    Zia Syed
    Participant

    Here is the base64 of the payload DgAAEAgGMn0FAOMLAc4=

    If we decode that using this site http://tomeko.net/online_tools/base64.php?lang=en

    we get

    0x0E 0x00 0x00 0x10 0x08 0x06 0x32 0x7D 0x05 0x00 0xE3 0x0B 0x01 0xCE

    Here Temperature is 01CE, which is binary 0000 0001 1100 1110

    I am not sure how to convert this into decimal temperature value.

    #14606
    Mike Fiore
    Blocked

    Zia,

    Sorry for the delayed response.

    The Temp portion of the payload is indeed 0x1CE. According to the payload format document the temp is transmitted in units of 0.0625 degrees C.

    So all you need to do is multiply the value by 0.0625.

    temp = int(0x1CE) * 0.0625
    temp = 462 * 0.0625
    temp = 28.875

    Cheers,

    Mike

    #14607
    Zia Syed
    Participant

    ok we figured it out. For others:

    01CE = 462 decimal

    462*.0625 = 28.875

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.