Open PatriceRobert opened 2 years ago
Dear all,
I think the issue has been found, in fact the file homebridge-magichome-platform/src/flux_led.py
is using the latest python defined on the system (so python3
in my case) but the code is not compatible:
$ python3 flux_led.py
File "/home/magic/npm/node_modules/homebridge-magichome-platform/src/flux_led.py", line 124
print ''.join('{:02x} '.format(x) for x in bytearray(bytes))
^
SyntaxError: invalid syntax
$
With python2
:
$ python2 flux_led.py
Usage: usage: flux_led.py [-sS10cwpCiltThe] [addr1 [addr2 [addr3] ...].
$
flux_led.py: error: An operation must be specified
So changed the header of the file to use: #!/usr/bin/python2
and it is now working fine back !!!!
-- Patrice
How do you do that from homebridge? I can't seem to find the files
How do you do that from homebridge? I can't seem to find the files
Well, without python2
on your system, you may also want to 're-write' all the print
functions in this flux_led.py
file:
print "response too short!"
becomes
print("response too short!")
@CsabaVK
I managed to find the file, but Im unsure how too rename the header, as Im using SSH connection to access my pi and doubt I could open the file from here?
I managed to find the file, but Im unsure how too rename the header, as Im using SSH connection to access my pi and doubt I could open the file from here?
Looks good, just replace the file by the one sent in a post earlier (remove the .txt of course....)
Im not sure if Im doing it correct as Im new to this, but -I downloaded your file, -the path seems to be correct, -the file don't have the .txt anymore -the ssh connection is on
and I get this error when Im trying to replace
Im not sure if Im doing it correct as Im new to this, but -I downloaded your file, -the path seems to be correct, -the file don't have the .txt anymore -the ssh connection is on
and I get this error when Im trying to replace
That's just because you shall use an scp
tool from your windows to transfer the file, something like WinSCP
or putty
I tried with PuTTY gave me the same error :(
Try to launch:
curl -sL https://github.com/sahilchaddha/homebridge-magichome-platform/files/12706444/flux_led.py.txt > flux_led.py
from the home dir of user pi through your ssh session, the file should be written in your home dir.
I just did that, and it give the same error as in your first post, I downloaded the file from the link inside the command to check, and in the header it says
Could that be the problem?
Thank you for the help, I figured out the rest,
So I had to put this
pscp c:\Users\csaba\Desktop\flux_led.py pi@192.168.178.59:/var/lib/homebridge/node_modules/homebridge-magichome-platform/src/flux_led.py
into the windows shell while I have the connection open on PuTTY
but it works!
please consider a pull request
This plugin was working just fine up to an upgrade of the raspberry pi to 'bullseye' version:
Linux raspberrypi 5.15.56-v7l+ #1575 SMP Fri Jul 22 20:29:46 BST 2022 armv7l GNU/Linux
Now the plugin loads correctly, as before but nothing happens via homekit. Tried the 'homebridge-magichome-dynamic-platform' plugin and it can control the lights but has less options than this current one (scenes: presetSwitches).-- Patrice.