-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error running Parse Example Code in Readme.md #16
Comments
Running Python 3.6.0, all I get with the above code is 'None'. No errors. Which version of Python are you using? |
Forgot to update parse data example when added support for different data types. Also not sure if data in that example is valid. I'll have to inspect more. b85047f#diff-12c3cc89af19a6fa3f633f7fca29f169R57 Can you try if this works? from ruuvitag_sensor.ruuvi import RuuviTagSensor
from ruuvitag_sensor.decoder import UrlDecoder
full_data = '043E2A0201030157168974A5F41E0201060303AAFE1616AAFE10EE037275752E76692F23416A7759414D4663CD'
data = full_data[26:]
# convert_data returns a tuple which has data type id and encoded data
encoded = RuuviTagSensor.convert_data(data)
sensor_data = UrlDecoder().decode_data(encoded[1])
print(sensor_data) |
Ok pi@raspberrypi7:~ $ python3 parse_data2.py Thanks |
Old firmware sent base91 encoded data and that example is still from that time. Good that you noticed this, so we got correct example to README. Updated example 7fd32ec |
The following is some example code under the heading of Parse Data within the Readme file:
When I run this code as follows , I get the following error:
The text was updated successfully, but these errors were encountered: