Is there anyone using MQTT as gateway for connecting to openHab running on another Rpi. If so please help with any links, post or any information to direct me on the right path.
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 Board
Currently 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
@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
Hi,
for everyone who reads all of this, forget about the last few posts.
I don't know why it works even when the Interrups are masked out on the radio, but it works now.
The error I had occured because of the config of the OrangePi-Gateway.
I removed:
--extra-cxxflags="-DMY_RF24_DATARATE=\(RF24_250KBPS\) -DMY_RF24_BASE_RADIO_ID=\(0x00,0xFC,0xE1,0xA8,0xA8\) -DMY_DEBUG_VERBOSE_RF24"
and wrote:
--extra-cxxflags="-DMY_RF24_DATARATE=\(RF24_250KBPS\) -DMY_DEBUG_VERBOSE_RF24"
Now I think I have an working OrangePi-Gateway without signing but with interrupt enabled.
If there are new problems I will come back here.
The next step for me is to activate signing again and bring the node into homeassistant.