MySensors MQTT gateway and serial rs485 sensor node communication
-
Hi all,
I would like to setup an sensor network with an ethernet gatway and wired connected sensor nodes. (RS485)
Gateway: Arduino Uno R3 with W5100 ethernet shield.
Sensor Nodes: Nodes are connected with gateway via wired rs485 connection (cable).Connection Flow 1 # Get sensor values:
Arduino Sensor Node (RS485) --> Gateway --> MQTT --> OpenHab2Connection Flow 2 # Issue commands to sensor node: (e.g. activate relay)
OpenHab2 --> MQTT --> Gateway --> Arduino Sensor Node (RS485)Is that possible with the MySensors library?
Because the RS485 gateway example I found on this page doesnt seem to use MQTT communication to OpenHab?Regards,
Simon
-
@ehome welcome to the MySensors community!
It should be as easy as changing
#define MY_GATEWAY_SERIAL
to
#define MY_GATEWAY_MQTT_CLIENT
and add the configuration parameters listed on the mqtt gateway page.
-
Thanks for your fast reply.
That sounds easy.
And you think that the communication between sensor nodes and Gateway are still possible via wired RS485?I tried to find an example on this site for sending Information from Gateway to sensor nodes. (via SendMessage ?)
For example I like to Switch on/off an light that is connected to an relay board at my sensor node.Communcation Flow:
OpenHab2 --> MQTT --> Gateway --> RS485 --> Sensor Node --> Relay BoardCurrently I have an working RS485 Connection between my Arduino Uno's with the use from SoftwareSerial library.
During my testings I realized, that the message that I triy to send "Hello" will be sent to the other arduino char by char. Is that true?Because I tried to raise up an pin on HIGH with "if(msg == "Hello")..." But it doesn't worked.
Will the sendMsg method from the MySensor library handle this out of the box?
Regards,
Simon
Suggested Topics
-
Is there a Gateway connection timeout?
General Discussion • 6 Feb 2022, 11:55 • A3V 6 Feb 2022, 18:48 -
Raspberry Pi2 + MQTT Gateway in one box!
My Project • 18 Apr 2015, 03:36 • kunall 21 Apr 2015, 09:08 -
💬 HALO : ESP32 multi transport GW/Bridge for Mysensors
OpenHardware.io • 29 May 2017, 10:43 • openhardware.io 15 Dec 2019, 18:25 -
How to check if serial gateway is operational ?
Development • 7 Jun 2015, 13:07 • joshmosh 8 Jun 2015, 18:31 -
RFM69HW Raspberry Pi 2 Gateway
Troubleshooting • 2 Aug 2017, 12:39 • NickB149 2 Aug 2017, 14:30 -
💬 Mysensors 2.0 ethernet gateway (W5100) build.
OpenHardware.io • 1 Sept 2016, 18:35 • openhardware.io 5 Feb 2018, 07:05 -
Sensor for Vallox DigitSE RS485 ventilation system with integration into FHEM.
My Project • 8 Feb 2015, 19:48 • Heinz 10 Jul 2020, 12:16