flux_led
flux_led copied to clipboard
sock.sendto
I'm getting the following error, which I can't seem to fix. Thanks in advance!
File "/Users/Programs/LED Light/flux_led-master/flux_led.py", line 759, in scan
sock.sendto(msg, ('
Are you using python3? I ran into a similar issue updating to py3. The solution was to do msg.encode(utf-8) before sending the bytes to the socket.
I added the fix to the code. Not sure when the repo owner will be able to merge
Thanks! If you commit the changes in your fork, I can just download it from there.
I tried to fix this last night and your suggestion worked for the error I noted, but then I got the same type of problem a few lines later, where the same fix didn't seem to work: File "/Users/Programs/LED Light/flux_led-master/flux_led.py", line 775, in scan item['ipaddr'] = data.split(',')[0] TypeError: a bytes-like object is required, not 'str'
right, and because you want to use the response, you should decode the message as well -facepalm-
it's an equally simple fix. just add data = data.decode(utf-8) to lines up and it should work.
i updated my fork. let me know if it works.