scrool/xled

If mac address isn't in cache, gets stuck in loop

mikebryant opened this issue · 1 comments

(.venv) m@spore:~/go/src/github.com/scrool/xled$ xled --verbosity-auth DEBUG --verbosity-discover DEBUG --verbosity-control DEBUG --hostname 192.168.4.33 get-mode
Looking for device with address: 192.168.4.33...
DEBUG:xled.discover:Sending ping
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Ignoring ping message received from network from 192.168.4.21.
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.38.
DEBUG:xled.discover:Received b'&\x04\xa8\xc0OKTwinkly_36DE85\x00'
DEBUG:xled.discover:Getting hardware address of b'192.168.4.38'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/m/go/src/github.com/scrool/xled/.venv/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/m/go/src/github.com/scrool/xled/xled/discover.py", line 465, in handle_beacon
    hw_address = bytes(hw_address, "utf-8")
TypeError: encoding without a string argument
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.39.
DEBUG:xled.discover:Received b"'\x04\xa8\xc0OKTwinkly_396D45\x00"
DEBUG:xled.discover:Getting hardware address of b'192.168.4.39'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/m/go/src/github.com/scrool/xled/.venv/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/m/go/src/github.com/scrool/xled/xled/discover.py", line 465, in handle_beacon
    hw_address = bytes(hw_address, "utf-8")
TypeError: encoding without a string argument
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.43.
DEBUG:xled.discover:Received b'+\x04\xa8\xc0OKTwinkly_3C5095\x00'
DEBUG:xled.discover:Getting hardware address of b'192.168.4.43'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/m/go/src/github.com/scrool/xled/.venv/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/m/go/src/github.com/scrool/xled/xled/discover.py", line 465, in handle_beacon
    hw_address = bytes(hw_address, "utf-8")
TypeError: encoding without a string argument
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.40.
DEBUG:xled.discover:Received b'(\x04\xa8\xc0OKTwinkly_35F259\x00'
DEBUG:xled.discover:Getting hardware address of b'192.168.4.40'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/m/go/src/github.com/scrool/xled/.venv/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/m/go/src/github.com/scrool/xled/xled/discover.py", line 465, in handle_beacon
    hw_address = bytes(hw_address, "utf-8")
TypeError: encoding without a string argument
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.36.
DEBUG:xled.discover:Received b'$\x04\xa8\xc0OKTwinkly_36FC01\x00'
DEBUG:xled.discover:Getting hardware address of b'192.168.4.36'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/m/go/src/github.com/scrool/xled/.venv/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/m/go/src/github.com/scrool/xled/xled/discover.py", line 465, in handle_beacon
    hw_address = bytes(hw_address, "utf-8")
TypeError: encoding without a string argument
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.32.
DEBUG:xled.discover:Received b' \x04\xa8\xc0OKTwinkly_377851\x00'
DEBUG:xled.discover:Getting hardware address of b'192.168.4.32'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/m/go/src/github.com/scrool/xled/.venv/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/m/go/src/github.com/scrool/xled/xled/discover.py", line 465, in handle_beacon
    hw_address = bytes(hw_address, "utf-8")
TypeError: encoding without a string argument
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.42.
DEBUG:xled.discover:Received b'*\x04\xa8\xc0OKTwinkly_35E54D\x00'
DEBUG:xled.discover:Getting hardware address of b'192.168.4.42'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/m/go/src/github.com/scrool/xled/.venv/lib/python3.8/site-packages/tornado/platform/asyncio.py", line 189, in _handle_events
    handler_func(fileobj, events)
  File "/home/m/go/src/github.com/scrool/xled/xled/discover.py", line 465, in handle_beacon
    hw_address = bytes(hw_address, "utf-8")
TypeError: encoding without a string argument
DEBUG:xled.discover:Sending ping
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Ignoring ping message received from network from 192.168.4.21.
DEBUG:xled.discover:Waiting for a beacon.
DEBUG:xled.discover:Received a beacon from 192.168.4.36.
DEBUG:xled.discover:Received b'$\x04\xa8\xc0OKTwinkly_36FC01\x00'
DEBUG:xled.discover:Getting hardware address of b'192.168.4.36'.
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):

I suspect this is only an issue on Py3 - the checks here are in the wrong order, PR to follow

Similarly to comment in #57 - this should be fixed with #63. Please reopen (or comment) if you still see this issue.