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
-
MySensor constructor should accept serial device or stream object
Feature Requests • 5 Jan 2015, 23:42 • Heinz 6 Jan 2015, 09:30 -
serial, Ethernet to MQTT
MyController.org • 14 Jun 2021, 09:38 • jkandasa 14 Jun 2021, 16:56 -
Total noob's question about building a PWM light controller
General Discussion • 3 Jul 2015, 05:03 • JoeStrout 3 Jul 2015, 17:45 -
Gateway not working on VeraLite + UI6 - No Serial Port configuration available
Vera • 22 Feb 2015, 04:23 • cdrum 28 Feb 2015, 01:17 -
Strange value being sent from controller using mixed temp/relay node
Bug Reports • 2 Feb 2015, 13:56 • Gambituk 27 Mar 2015, 22:44 -
Multiple virtual nodes on a gateway
Troubleshooting • 7 Feb 2019, 16:00 • pvoj 12 Feb 2019, 23:14 -
Method to reveal sketch inside node or g/w
General Discussion • 19 Oct 2015, 01:36 • 5546dug 19 Oct 2015, 19:22