vanviegen / hue-thief

Factory reset Philips Hue bulbs using an EZSP-based Zigbee USB stick. After a reset, bulbs can easily join any type of compatible bridge.
GNU General Public License v3.0
178 stars 20 forks source link

macOS compatibility? #19

Open metawops opened 1 year ago

metawops commented 1 year ago

I'm trying to run this on macOS with a Sonoff ZBDongle-E (CH9102F EZSP serial interface, Silicon Labs EFR32MG21 Chip). The device got added as /dev/tty.usbserial-202208161433041.

Followed the installation instructions and got two warning at the end that the /Users/stefan/.local/bin folder is not in my PATH. Added that and then tried to run hue-thief. Got this:

╭─    ~/hue-thief  on   master ······································································································································· 1 ✘  took 1m 28s   base   at 17:54:47  ─╮
╰─ python3 hue-thief.py /dev/tty.usbserial-202208161433041                                                                                                                                                                  ─╯
/Users/stefan/hue-thief/hue-thief.py:126: DeprecationWarning: There is no current event loop
  asyncio.get_event_loop().run_until_complete(steal(sys.argv[1]))
Traceback (most recent call last):
  File "/Users/stefan/miniconda3/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/stefan/hue-thief/hue-thief.py", line 126, in <module>
    asyncio.get_event_loop().run_until_complete(steal(sys.argv[1]))
  File "/Users/stefan/miniconda3/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/Users/stefan/hue-thief/hue-thief.py", line 26, in steal
    s = await util.setup(device, baudrate=57600)
  File "/Users/stefan/.local/lib/python3.10/site-packages/bellows/cli/util.py", line 108, in setup
    await s.reset()
  File "/Users/stefan/.local/lib/python3.10/site-packages/bellows/ezsp.py", line 84, in reset
    await self._gw.reset()
  File "/Users/stefan/.local/lib/python3.10/site-packages/bellows/uart.py", line 221, in reset
    return await asyncio.wait_for(self._reset_future, timeout=RESET_TIMEOUT)
  File "/Users/stefan/miniconda3/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

Factory-resetting a Hue bulb didn't work.

Any other macOS users here? Any advice? (Interesting that miniconda3 is used here, too ... 🤔)

meadowsjared commented 1 year ago

@metawops I had something similar in Linux during my installation. My fix was adding the bin folder to my path. However, I'm not sure how that works with macOS? 🤔 Another option would be to run the program from the bin directory, just so the dependencies can be found. Then again, your mileage may vary, and I have no way to test this.