I would like to get an RFLink gateway working with HASS running on a NUC (a Gigabyte Brix GB-BXBT-1900) and Ubuntu server. I can muddle my way through getting HASS running but am stumped about how to get the RFLink working so would appreciate any pointers, please.
I have built and loaded the firmware onto the Arduino Mega and tested it using RFLinkLoader.
When I connect it to the NUC running HASS nothing seems to happen so I’m unsure how to make it work or even debug the problem.
i have got nearly the same configuration. My config looks like this:
rflink:
port: /dev/ttyUSB0
I think you must ssh to the console on your host to determine the right usb-port. Or perhaps this page shows the available serial ports
http://yourhassip:8123/hassio/system click on the hardware button.
a while ago i made this to translate rflink to mqtt GitHub - lubeda/RFLink-to-FHEM-via-MQTT but this only translates the serialdata to mqtt it is no high level integration.
Thanks, @lubeda - I had not even realised that screen was there so I ran it once, then connected the RFLink and ran it again. Compared the output and /dev/ttyACM0 had appeared (which is the same as @Adorem listed above) so it seems I’m on the right track. I added that to the configuration.yaml, as well as the entries @Adorem used.
Restarted HASS but can’t see any indications it has connected - or errors in the logs.
Run out of time tonight so will continue tomorrow.
Well, tomorrow became next week but I have got back to it!
The HASS NUC now seems to at least recognise that there is a RFLink attached - it has this in the error log. I’ve no idea currently what it means and how to fix it, though, so that is my next challenge!
Log Details (ERROR)
Thu Jun 20 2019 22:03:01 GMT+0100 (British Summer Time)
Error doing job: Exception in callback <bound method SerialTransport._read_ready of SerialTransport(<uvloop.Loop running=True closed=False debug=False>, <rflink.protocol.RflinkProtocol object at 0x7f76dbb00eb8>, Serial<id=0x7f76dbb0c048, open=True>(port='/dev/ttyACM0', baudrate=57600, bytesize=8, parity='N', stopbits=1, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False))>
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 2: invalid start byte
And Logviewer is reporting this so it looks like python issue but I’m now totally out of my depth!
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
2019-06-20 22:37:09 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback <bound method SerialTransport._read_ready of SerialTransport(<uvloop.Loop running=True closed=False debug=False>, <rflink.protocol.RflinkProtocol object at 0x7f7db5840d68>, Serial<id=0x7f7db5840cc0, open=True>(port='/dev/ttyACM0', baudrate=57600, bytesize=8, parity='N', stopbits=1, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False))>
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 2: invalid start byte
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 5: invalid start byte
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 0: invalid start byte
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 1: invalid start byte
But I know Hass is seeing the signals from RFlink - pushing the Somfy remote button gives the following in logviewer:
2019-06-20 22:41:11 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback <bound method SerialTransport._read_ready of SerialTransport(<uvloop.Loop running=True closed=False debug=False>, <rflink.protocol.RflinkProtocol object at 0x7f7db5840d68>, Serial<id=0x7f7db5840cc0, open=True>(port='/dev/ttyACM0', baudrate=57600, bytesize=8, parity='N', stopbits=1, timeout=0, xonxoff=False, rtscts=False, dsrdtr=False))>
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 2: invalid start byte
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 1: invalid continuation byte
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3: invalid start byte
Traceback (most recent call last):
File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
File "/usr/local/lib/python3.7/site-packages/serial_asyncio/__init__.py", line 106, in _read_ready
self._protocol.data_received(data)
File "/usr/local/lib/python3.7/site-packages/rflink/protocol.py", line 46, in data_received
data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x86 in position 0: invalid start byte
OK, well the ESP expansion board worked but was flaky and kept failing to work. I’m not entirely sure what the issue was but it was primarily dropping off the WiFi and then HA could not find it.
I decided to try a different approach after finding this post about the problem and a possible solution.
Has anyone managed to have a slave instance of hassio run the RFlink? As its now broken on my NUC I wanted to connect via TCP to a slave Pi running hassio+RFLink but can’t get it to work. If anyone could share their experience/config that would be great
Ah, I misunderstood, sorry. No idea - I’m no expert on this. I experimented with serial2net before getting to my final solution - that may be an option possibly?
Yeh thanks I might have to try this if I can’t get it to work, last night I tried reconfiguring my rflink on my NUC and it went into a crazy loop, filing the log with thousands of lines of errors and bringing down hassio, and everything else on the NUC for many hours. nightmare!