ceandre / radonreader

Read current radon level from RadonEye RD200
GNU General Public License v3.0
56 stars 27 forks source link

Python3? #4

Closed rucknapucknavitz closed 3 years ago

rucknapucknavitz commented 3 years ago

Wondering if this works under Python3?

I'm getting the following error:

rpi4:radonreader:% python3 radon_reader.py -a FB:74:xx:yy:zz:aa -v
Connecting...
Writing...
string argument without an encoding
Failed, trying again (1)...
Connecting...
Failed to connect to peripheral FB:74:xx:yy:zz:aa, addr type: random
Failed, trying again (2)...
Connecting...
Failed to connect to peripheral FB:74:xx:yy:zz:aa, addr type: random
Failed, trying again (3)...
Connecting...
Failed to connect to peripheral FB:74:xx:yy:zz:aa, addr type: random
Failed.

The Bluetooth indicator on the device does turn on during this process.

Any and all ideas appreciated. Thanks!

rucknapucknavitz commented 3 years ago

Python2 is required and fixed my issue. Works great now.

juergen2345 commented 2 years ago

I changed the shebang to #!/usr/bin/env python3 and line 49 in radon_reader.py: RadonEyeWrite.write(bytes("\x50")) to RadonEyeWrite.write(b"\x50") and it works in python 3. but i did not test the mqtt and argparser part because i didn´t need it (removed it) maybe this can help