initialstate / beerfridge

Create a Beer/Wine Fridge of Awesomeness

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Script is broken?

jk101290 opened this issue · comments

Hi, I know this is a few years old but I'd really love to get this going. I'm trying to run wiiboard_test.py and its seems to be either broken or just very out dated. On my first try I got:

Traceback (most recent call last):
File "wiiboard_test.py", line 5, in
import bluetooth
File "/usr/local/lib/python2.7/dist-packages/bluetooth/init.py", line 282, in
"""
AttributeError: attribute 'doc' of 'instancemethod' objects is not writable

So, then I tried running in Python3 instead. I got passed that first problem but then I saw that there were no parenthesis on any of the print() functions. Fixed that, ran again. I get:

File "wiiboard_test.py", line 84, in init
for i in xrange(3):
NameError: name 'xrange' is not defined

I change the xrange to range, as well as the second "xrange" two lines down. Run it again. Now, I get:

Traceback (most recent call last):
File "wiiboard_test.py", line 297, in
main()
File "wiiboard_test.py", line 288, in main
board.connect(address) # The wii board must be in sync mode at this time
File "wiiboard_test.py", line 112, in connect
self.calibrate()
File "wiiboard_test.py", line 258, in calibrate
self.send(message)
File "wiiboard_test.py", line 240, in send
senddata += byte.decode("hex")
AttributeError: 'str' object has no attribute 'decode'

Now I'm stuck. Anyone still supporting this project?? I've tried several different scripts for a wii board scale and haven't had much luck. I'm using a Pi 4B with up to date Raspbian Buster.

Thanks in advance for any support!

I set this up four months ago on a Pi3 B+ (whatever the latest Raspbian was at the time) and ran it on Python 2.7 w/o any issues. I have never seen that initial error though. I will have to try to replicate your issue on a Pi4 with the latest Raspbian.

Thanks for the fast response!
Evidently the problem in python 2.7 is the bluetooth module. When I run the shell and type "import bluetooth" it returns the same error

@jrbail01 this is clearly a versioning issue with the Bluetooth module. If you post which version you have (pip freeze | grep bluetooth), then jk101 can install a matching/working version

I found the solution here:
pybluez/pybluez#320
Pybluez needs to be version 0.22 and not 0.23! :)