Newbie question about how the mysensors gateway connects to controller
-
I read and watched a lot about mysensors, but didn't manage to learn the following.
My question regards only the part of how the mysensors gateway (in my case: Arduino nano) connects to the controller (in my case Raspberry Pi 4 with Home Assistant Hass.io).
It does not regard how the gateway connects to sensors (which I guess wil be wireless and probably RFM69 in my case).I prefer a cabled connection between the gateway and the controller.
Maybe this is also what is recommended?I can imagine connecting the gateway (Nano) through an ethernet cable (via a W5100 module) to my switch/router which should make it possible for the controller to communicate with it if it is on the same network.
Is this what you call an ethernet gateway?But I guess a USB cabled direct connection between the gateway (Nano) and the controller (Raspberry Pi with Hass.io) is also a technical possibility (they will probably be located next to each other anyway).
Is this possible and is this what you call a serial gateway?Which is recommended?
Are both equally good?
I don't want to invent a new connection method.
I just want to follow the guidelines, but got confused down the line and was afraid that the gateway needed to communicate with the controller via 2.4GHz which I hope to avoid.
-
yes you are correct, the serial gateway will connect to your controllers (Hassio) serial port and the Ethernet gateway will connect over your wired network connection. Both will work well, i guess the Ethernet approach gives you the flexibility of having the gateway away from the controller if needed.
In my setup I have two gateways, both are built on NodeMCU boards and connect via wifi. they have proven very reliable as well.
-
@Boots33
Thanks a lot for the quick response.
I now have my Nano running as a serial gateway and it is connected via a USB cable directly to my controller (Raspberry Pi 4 running Home Assistant / Hass.io).
I added a local motion sensor to the Nano gateway HW and pasted the mysensors MotionSensor example code to the setup(), presentation() and loop() functions as well as to the definitions in the top of the GatewaySerial example code.
I disabled the radio definitions as I currently have no radio capability in my gateway (not sure if this was necessary).
In Home Assistant / Hass.io I updated the configuration.yaml with the following text (as described on the Home Assistant integration help):mysensors:
gateways:
- device: '/dev/ttyUSB0'And it works
In Home Assistant Developer Tools under States I can now see my motion sensor go on and off by the flick of my hand.I had expected a bit more bumps on the road just to get this far, but wow - I am obviously walking in the foot prints of people who have worked hard to make it easy for the rest of us.
I am sure I will hit bumps on the way when the radios have to send results to the gateway (thick concrete walls with lots of steel), but for now I will enjoy this big success.Thanks again Boots33
Suggested Topics
-
Data collection
My Project • 22 Sept 2014, 00:36 • pvoj 22 Sept 2014, 01:52 -
Serial Baud Rate for Adapter
Mozilla WebThings Gateway • 29 Sept 2020, 11:38 • Westie 5 Jan 2021, 11:50 -
Ethernet Gateway and Vera 3 on UI7
Troubleshooting • 20 Sept 2014, 03:34 • Homer 21 Sept 2014, 08:20 -
Raspberry Pi Ethernet Gateway with local sensors
Hardware • 28 Feb 2021, 13:27 • jvdk 3 Mar 2021, 03:51 -
Raspberry Pi Zero WH as gateway?
Hardware • 18 Jan 2018, 18:22 • sentur 18 Jan 2018, 20:08 -
Integrate with ThingsBoard
Development • 17 Apr 2021, 02:40 • chamroeun ou 18 Apr 2021, 06:13 -
Have anyone experienced MySensors gateway with GPRS(MQTT)?
General Discussion • 29 Dec 2017, 14:28 • jkandasa 31 Mar 2018, 16:54 -
MySensors plugin : Cannot send command - communications error
Troubleshooting • 29 Dec 2014, 15:13 • BulldogLowell 17 Jan 2015, 21:01