Python + Xbee - interpreting binary data for analog samples -
i've been working on project digi xbee series 2 (zigbee) modules. have python script receives data on coordinator device , saves database. script has been looking , parsing "samples" key in returned data.
i've since bought digi xbee l/t/h sensor (http://www.digi.com/wiki/developer/index.php/xbee_sensors) , have found returns data using "rf_data" key. appears binary. i'm failing able process , read actual values it.
can tell me if can re-program sensor send "samples" key, or how read/convert binary data?
i've been trying this:
h=struct.unpack('f',response['rf_data'][0:4])[0]
but i'm out of depth knowing i'm doing ;-)
thanks in advance can give....
it's returning i/o sample, described in digi knowledge base article.
the page linked includes formulas converting adc readings temperature, humidity , light readings.
section 3.2 of python-xbee documentation seems imply i/o samples parsed of version 2.1. make sure you're using version, , see if can access adc-1
through adc-3
of i/o sample, , convert readings light, temperature , humidity values.
Comments
Post a Comment