-
Notifications
You must be signed in to change notification settings - Fork 46
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
How to make it working with Python3 #13
Comments
Hi @pierrot10 , This is not a Python3 specific error. This is caused by not converting the string to bytes correctly. You will need to encode whatever you are sending as bytes using >>> s = "this is a string"
>>> data = s.encode("hex")
'54686973206973206120737472696e67'
>>> data.decode("hex") If you want to copy lines 100 to 110 in this issue it might be easier to find out why this error is being thrown. |
I'm getting the same error for the same section of code (sleep): I used the same code in the aqi.py file in this repo, so the issue is in the block beginning on line 84. I'm not sure what I should be encoding/decoding and where. Anyone with slightly more specific instructions to follow? Thanks! |
I have the same error and I'm going crazy, by any chance did you solve it? or found any workarounds? Alberto Ruga |
Year 2024-May and am also having this exact issue. Wish somebody knowledgeable in Python3 initiate a fix. From extensive googling, looks like the only fix for us noob is to use Python2. |
Maybe checkout https://sensor.community/en/sensors/airrohr/ We use it since many years and it runs very reliable (and is also cheaper). Instead of the SDS011 we use a PMS5003 PM2.5 sensor. |
Hello,
Thank a lot for that code.
I need to make it working with Python3 but it generate this error message
Is there a adapted script for Python3?
Thank a lot
The text was updated successfully, but these errors were encountered: