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
-
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 -
💬 ArduCure
OpenHardware.io • 31 Jan 2017, 06:47 • openhardware.io 31 Jan 2017, 06:47 -
💬 Reperter/Gateway USB Mysensors
OpenHardware.io • 5 Feb 2022, 17:10 • openhardware.io 5 Feb 2022, 17:10 -
Arduino Mega2560 and multifunction gateway issues/questions
Troubleshooting • 13 May 2020, 13:25 • fdlou147 13 May 2020, 15:24 -
PiGatewaySerial doesn't write to virtual serial device /dev/ttyMySensorsGateway
Troubleshooting • 5 Nov 2015, 16:46 • Michele Rappazzo 5 Nov 2015, 20:43 -
Watchdog on 2.0
General Discussion • 11 Sept 2016, 16:10 • CrankyCoder 7 Jan 2017, 11:57 -
Energy Pulse Meter strange behaviour
Troubleshooting • 13 Dec 2014, 14:00 • mbj 3 Jan 2015, 20:44