jnweiger / led-name-badge-ls32

Upload tool for an led name tag with USB-HID interface
GNU General Public License v2.0
223 stars 81 forks source link

TypeError under Mac OS #8

Open st20d opened 5 years ago

st20d commented 5 years ago

Hi,

With MacOS I don't get the script running.

First I must additional run sudo easy_install pip to get sudo pip install pyhidapi running and ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null to get sudo brew install hidapi running.

Maybe that's useful for the Help File.

Now the script is running but when I connect a device and try sudo python led-badge-11x44.py "Test" I get follow error code:

using [LSicroelectronics LS32 Custm HID] int=-1 page=1 via pyHIDAPI Traceback (most recent call last): File "led-badge-11x44.py", line 439, in <module> pyhidapi.hid_write(dev, buf[i*64:i*64+64]) File "/Library/Python/2.7/site-packages/pyhidapi/pyhidapi.py", line 638, in hid_write buf[n] = data[n] TypeError: one character string expected

Im Using MacOS Mojave 10.14.4.

jnweiger commented 5 years ago

Thanks for the install instructions! Added them to README.md

The type error looks like we broke python2 compatibility. python3 should work better.

jnweiger commented 5 years ago

@st20d is python3 an option on MacOS? The combination pyhidapi and python2 does not mix well. I'd avoid finding direct a solution for this, if possible. python3 with pyhidapi works well, and python2 with usb.core also does in the general case. This needs confirmation please what works on MacOS.