I currently have a setup where all my input switches are on a single unipi controller and all the relay outputs are on another. The connection between the 2 of these is done with an automation in home assistant, using MQTT.
So, pushing a push button to switching on the light means:
- push button triggers MQTT event (on a neuron L303)
- MQTT event is picked up by home assistant (on a dedicated x86 computer) and send out another MQTT event
- MQTT event triggers a relay toggle (on a neuron L403).
While this has been working OK for me, I have been thinking about some redundancy and would like the overall basic system to still working without home assistant and without a network connection.
I was reading https://www.unipi.technology/news/the-four-ways-to-set-up-your-automation-project-257 the other day, and I did notice the possiblity to link some unipi controllers directly using RS485 / modbus RTU. My idea would be that a button press on the L303 would then just directly send a command over modbus RTU to the L403. Apart from that I would also still keep the MQTT interface, such that home assistant can still work with it.
Up to now however, I haven't been able to connect the 2 together.
What I did try:
- wiring; I did use 2 wires from a CAT6 ethernet cable and put these into the RS485A / B connectors
- DIP switches: I read somewhere these need to be on such that the line is properly terminated (tried actually in a bunch of on / off configurations)
- software: the evok interface shows me the serial 1.01 ports for both controllers is 19200 baud rate, 8 bits, no parity stop bit 1
- I did try reading data from the serial line using
mbpoll
, e.g.
sudo mbpoll -t 0 -m rtu -P none -a 15 -b 19200 -r 100 -c 20 /dev/extcomm/1/0
mbpoll 1.4-12 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright © 2015-2019 Pascal JEAN, https://github.com/epsilonrt/mbpoll
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'mbpoll -w' for details.
Protocol configuration: Modbus RTU
Slave configuration...: address = [15]
start reference = 100, count = 20
Communication.........: /dev/extcomm/1/0, 19200-8N1
t/o 1.00 s, poll rate 1000 ms
Data type.............: discrete output (coil)
-- Polling slave 15... Ctrl-C to stop)
Read discrete output (coil) failed: Connection timed out
-- Polling slave 15... Ctrl-C to stop)
Read discrete output (coil) failed: Connection timed out
^C--- /dev/extcomm/1/0 poll statistics ---
2 frames transmitted, 0 received, 2 errors, 100.0% frame loss
Any clue what I'm doing wrong?