1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hyperion.ng Yeelight Bridge

Discussion in 'Archive' started by Squizzy, 6 January 2020.

Thread Status:
Not open for further replies.
  1. Lord-Grey

    Lord-Grey Moderator Staff Member Developer

    Messages:
    368
    Hardware:
    RPi3, 32/64bit
    Hi

    the Yeelight S1 is treated as not discovered, as it has a different model identifier which is not considered in the current code.

    I suggested a fix in the answer of the issue pho08 raised at GitLab.
    The fix will suport S1 and Stripe in addition.

    https://gitlab.com/tobimiller/hyperion-yeelight-bridge/-/issues/1

    Happytesting!
     
  2. pho08

    pho08 Member

    Messages:
    56
    thanks so much for this @Lord-Grey

    now the configurator script finds the lights.


    after a lot of errors trying to get the service/bridge.py running, i think i finally managed it (it was apparently just a stupid mistake with ""s in the config file)
    calling sudo systemctl status hyperion-yeelight-bridge.service now returns
    Code:
    [email protected]:~/hyperion-yeelight-bridge $ sudo systemctl status hyperion-yeelight-bridge.service
    ● hyperion-yeelight-bridge.service - Hyperion Yeelight Bridge
       Loaded: loaded (/etc/systemd/system/hyperion-yeelight-bridge.service; enabled; vendor preset: enabled)
       Active: active (running) since Fri 2020-04-10 18:28:46 CEST; 3s ago
    Main PID: 2181 (bridge.py)
        Tasks: 2 (limit: 4915)
       Memory: 17.4M
       CGroup: /system.slice/hyperion-yeelight-bridge.service
               └─2181 /usr/bin/python3 /home/pi/hyperion-yeelight-bridge/bridge.py
    
    Apr 10 18:28:46 raspberrypi systemd[1]: Started Hyperion Yeelight Bridge.
    
    stopping the service and running bridge.py manually returns:
    Code:
    [email protected]:~/hyperion-yeelight-bridge $ sudo python3 bridge.py
    waiting on port: 5568
    discovering bulbs...
    streaming rgb data to yeelight...
    
    BUT alas the lights don't react at all

    :edit (no#315413513)
    okay i think i am going insane with this... now all of a sudden after rebooting/restarting everything ONE of the the three lights actually turned on and seems to be getting signals!! it changes luminance and colors while playing a file in kodi!
    But the colors are all wrong (basically just white and green) and the other two lamps i have configured still don't react at all :( -- but it's something!

    :edit
    restarting again ANOTHER lamp turns on than before (left front, before it was right front --still only one though) and still just white and green (even though there is no green in the picture on TV)


    outdated errors solved(?)
    but now it seems there is a general problem with numpy(?):
    after the configuration finished the lights didn't turn on or show any sign of life

    sudo systemctl status hyperion-yeelight-bridge.service
    returned
    Code:
    "libf77blas.so.3: cannot open shared object file: No such file or directory"
    so after a quick google search i ran
    sudo apt-get install libatrlas-base-dev and restarted the service


    now i get the following error from sudo systemctl status hyperion-yeelight-bridge.service
    Code:
    [email protected]:~ $ sudo systemctl status hyperion-yeelight-bridge.service
    ● hyperion-yeelight-bridge.service - Hyperion Yeelight Bridge
       Loaded: loaded (/etc/systemd/system/hyperion-yeelight-bridge.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Fri 2020-04-10 16:31:57 CEST; 23min ago
      Process: 1960 ExecStart=/home/pi/hyperion-yeelight-bridge/bridge.py (code=exited, status=1/FAILURE)
    Main PID: 1960 (code=exited, status=1/FAILURE)
    
    Apr 10 16:31:57 raspberrypi bridge.py[1960]: Traceback (most recent call last):
    Apr 10 16:31:57 raspberrypi bridge.py[1960]:   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    Apr 10 16:31:57 raspberrypi bridge.py[1960]:     self.run()
    Apr 10 16:31:57 raspberrypi bridge.py[1960]:   File "/usr/lib/python3.7/threading.py", line 865, in run
    Apr 10 16:31:57 raspberrypi bridge.py[1960]:     self._target(*self._args, **self._kwargs)
    Apr 10 16:31:57 raspberrypi bridge.py[1960]:   File "/home/pi/hyperion-yeelight-bridge/bridge.py", line 45, in _player_status
    Apr 10 16:31:57 raspberrypi bridge.py[1960]:     if speed['result']['speed'] > 0:
    Apr 10 16:31:57 raspberrypi bridge.py[1960]: KeyError: 'result'
    Apr 10 16:31:57 raspberrypi systemd[1]: hyperion-yeelight-bridge.service: Main process exited, code=exited, status=1/FAILURE
    Apr 10 16:31:57 raspberrypi systemd[1]: hyperion-yeelight-bridge.service: Failed with result 'exit-code'.
    weirdly when i check the installed version of numpy i get the following
    Code:
    [email protected]:~ $ python -c "import numpy; print(numpy.__version__)"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named 'numpy'
    (the command might be wrong though)

    if i check installed packages via "pip list" then numpy shows up as version 1.16.2 (NOT the required 1.17.2 as specified on gitlab/req.txt)

    however, trying to uninstall numpy via "pip uninstall numpy" returns
    Code:
    [email protected]:~ $ pip uninstall numpy
    Not uninstalling numpy at /usr/lib/python2.7/dist-packages, outside environment /usr
    Can't uninstall 'numpy'. No files were found to uninstall.
    uninstalling via "pip3 uninstall numpy" on the other hand returns
    Code:
    Uninstalling numpy-1.18.2:
      Would remove:
        /usr/local/bin/f2py
        /usr/local/bin/f2py3
        /usr/local/bin/f2py3.7
        /usr/local/lib/python3.7/dist-packages/numpy-1.18.2.dist-info/*
        /usr/local/lib/python3.7/dist-packages/numpy/*
      Would not remove (outside of prefix):
        /usr/bin/f2py
        /usr/bin/f2py3
        /usr/bin/f2py3.7
    Proceed (y/n)? y
      Successfully uninstalled numpy-1.18.2
    

    so i installed the exact version specified by squizzy v1.17.2 via "pip3 install numpy==1.17.2 which returned
    Code:
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    Collecting numpy==1.17.2
      Downloading https://www.piwheels.org/simple/numpy/numpy-1.17.2-cp37-cp37m-linux_armv7l.whl (10.5MB)
        100% |████████████████████████████████| 10.5MB 42kB/s
    Installing collected packages: numpy
      Found existing installation: numpy 1.16.2
        Not uninstalling numpy at /usr/lib/python3/dist-packages, outside environment /usr
        Can't uninstall 'numpy'. No files were found to uninstall.
    Successfully installed numpy-1.17.2
    
    now when i check pip3 list numpy shows up as v 1.17.2

    but i still get the same error when checking hyperion-yeelight-bridge.service status
    Code:
    systemctl status hyperion-yeelight-bridge.service
    ● hyperion-yeelight-bridge.service - Hyperion Yeelight Bridge
       Loaded: loaded (/etc/systemd/system/hyperion-yeelight-bridge.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Fri 2020-04-10 17:16:49 CEST; 5s ago
      Process: 3874 ExecStart=/home/pi/hyperion-yeelight-bridge/bridge.py (code=exited, status=1/FAILURE)
    Main PID: 3874 (code=exited, status=1/FAILURE)
    
    Apr 10 17:16:49 raspberrypi bridge.py[3874]: Traceback (most recent call last):
    Apr 10 17:16:49 raspberrypi bridge.py[3874]:   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    Apr 10 17:16:49 raspberrypi bridge.py[3874]:     self.run()
    Apr 10 17:16:49 raspberrypi bridge.py[3874]:   File "/usr/lib/python3.7/threading.py", line 865, in run
    Apr 10 17:16:49 raspberrypi bridge.py[3874]:     self._target(*self._args, **self._kwargs)
    Apr 10 17:16:49 raspberrypi bridge.py[3874]:   File "/home/pi/hyperion-yeelight-bridge/bridge.py", line 45, in _player_status
    Apr 10 17:16:49 raspberrypi bridge.py[3874]:     if speed['result']['speed'] > 0:
    Apr 10 17:16:49 raspberrypi bridge.py[3874]: KeyError: 'result'
    Apr 10 17:16:49 raspberrypi systemd[1]: hyperion-yeelight-bridge.service: Main process exited, code=exited, status=1/FAILURE
    Apr 10 17:16:49 raspberrypi systemd[1]: hyperion-yeelight-bridge.service: Failed with result 'exit-code'.

    does anybody have an idea? Would be much appreciated



    :edit
    pip3 freeze lists numpy 1.17.2
    pip freeze still lists numpy 1.16.2



    running sudo python3 bridge.py manually returns
    Code:
    [email protected]:~/hyperion-yeelight-bridge $ sudo python3 bridge.py
    Traceback (most recent call last):
      File "bridge.py", line 155, in <module>
        HyperionYeelightBridge(kodi, yeelights, hyperion_port)
      File "bridge.py", line 65, in __init__
        self.socket.bind(("", port))
    TypeError: an integer is required (got type str)
    Exception in thread Thread-1:
    Traceback (most recent call last):
      File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
        self.run()
      File "/usr/lib/python3.7/threading.py", line 865, in run
        self._target(*self._args, **self._kwargs)
      File "bridge.py", line 45, in _player_status
        if speed['result']['speed'] > 0:
    KeyError: 'result'
    
     
    Last edited: 10 April 2020
  3. Lord-Grey

    Lord-Grey Moderator Staff Member Developer

    Messages:
    368
    Hardware:
    RPi3, 32/64bit
    „restarting again ANOTHER lamp turns on than before“
    Have you had a look into the bridge‘s Config file? If I remember correctly, the Config script created duplicate namings.
     
  4. Lord-Grey

    Lord-Grey Moderator Staff Member Developer

    Messages:
    368
    Hardware:
    RPi3, 32/64bit
    For testing you may just go into Directory
    itself cd /home/pi/hyperion-yeelight-bridge/

    and execute directly until it works

    python3 bridge.py

    There you should also find the Config File
     
    • Like Like x 1
  5. pho08

    pho08 Member

    Messages:
    56
    thanks for the reply! yes that's how i am testing it

    during the testing i noticed that the only lamp which was actually reacting to the signals sent from hyperion.ng was displayed as "offline" in yeelight app.

    anyway, so i edited the config.json and changed the names of the lamps (even though there were no duplicates) and restarted bridge.py. But now nothing happens anymore. rebooting the system didnt help

    so i restored the original config.json (with the original names) , rebooted, but nothing, made sure that the yeelight-bridge service was running but the lamp doesn't react to hyperion anymore...
    i tried running the configurator.py again but it returns
    Code:
    [email protected]:~/hyperion-yeelight-bridge $ python3 configurator.py
    Traceback (most recent call last):
      File "configurator.py", line 6, in <module>
        import yeelight
    ImportError: No module named 'yeelight'
    
    what the hell?

    what's worse it is still offline in yeelight app. So i hardware-resetted the lamp but now i can't even find it in the yee app anymore >.<
     
  6. pho08

    pho08 Member

    Messages:
    56
    okay so apparently there is a bug in the newest firmware of the yeelights 1s. If you update and at some point in the future your yeelight app loses connection it is a pain in the ass to get it reconnected (connection attempt timed out). after trying countless times last night to reconnect i gave up. this morning all of a sudden it reconnected as if nothing had ever happened.


    anyway i finally managed to get the bridge running and correctly adress a bulb. Colors change according to Kodi playback....

    BUT i can always only get ONE of the bulbs to work. The configurator.py sometimes finds 1 or 2 bulbs (never all 3) but even if i set up these 2 correctly, at the end only one bulb will actually light up/respond to the UDP signals.

    is there a way to manually add/register more bulbs with their actual IP adress? I am not talking about the config.json in the program dir (this one only has their nicknames). But the file where there physical adress is stored? Couldn't find that.

    Cheers
     
  7. Squizzy

    Squizzy New Member

    Messages:
    24
    Hardware:
    RPi2
    new version online.

    please check it out.

    this looks like you have not installed the dependencies ;)
     
  8. pho08

    pho08 Member

    Messages:
    56
    Woah thanks. Dont mind my whining/babbling above, all errors seem to be fixed and i already got it working :)

    One thing though: blacks are somehow screwed. Meaning the lamps wont dim/turn off on black scenes but randomly show blue/red (probably the color that comes closest) in full saturation ....and in pitch black scenes the lamps go full white . But maybe thats only happening with the 1s bulb?
     
    Last edited: 13 April 2020
  9. Squizzy

    Squizzy New Member

    Messages:
    24
    Hardware:
    RPi2
    that’s exactly the behavior I had with the newer hardware version I have. What I have read in the yeelight forum is that the new version getting worse in color accuracy with low brightness. So I will stay with my first gen yeelights. Maybe we should scale the brightness for newer yeelights.
     
Thread Status:
Not open for further replies.