Hello to all!
I’m using OpenHAB with an arduino network powered by mysensors.org project. Mysensors has a central gateway with on one site an ethernet network and on the other side it comunicates with other arduinos via radio. The gateway has a library to handle MQTT.
OpenHAB is working well using a MQTT connection to this arduino gateway. Until here all works fine.
I would like to add a second MQTT broker on the mysensors network, because I would like to add a second arduino gateway with a different radio hardware.
Can Openhab handle the same time comunication to TWO MQTT brokers?
I cannot try because I need to buy the needed hardware and I would like to do it only if I know it’s working.
Many thanks for the help!
The gateway has on one part the hardware with Nrf24L01+ radio to talk with sensors, and the other side network connection.
I cannot add a second radio (RFM69) on the same gateway, so I need to add a second gateway.
Both gateways are then talking to openhab as MQTT broker, so I would need to add a second MQTT instance on OpenHAB. But if it works, than that’s enoug. i hope
Well @robconnolly, I’m using mostly the libraries without going in deep to apply some modifications.
I could install a mosquito server on openhab server and use the arduino MQTT gateways as MQTT client forwarder. This is something I’ve discovered now, but there is a problem.
Seems the MQTTclientForwarder is in development and not fully completed. In additcion the sketch exceed the maximum flash memory available, so I need to migrate my arduino UNO to a MEGA256 with more memory.
I would avoid to purchase new hardware because I already have my arduinos working well.
Apart of the memory issues, the client forwarder would be the best approach, I know. I could in this way handle troubleshooting and debug much more easier. Actually, the MQTT broker on Arduino handles only one connection. So I cannot subscribe on it manually. This causes the disconnection of the OpenHab client.
So, definetly for now I’ll stay on two MQTT broker on arduinos and I’ll handle on OpenHab two instances. Then, as soon the MQTT client forwarder would be more stable, I’ll try to use it.
Ah, now it makes sense, although it is a very weird architectural choice by the mysensors developers. I agree with not buying any new hardware - especially if what you have is working.
I’m using the mqtt client gateway from the development branch of mysensors on a uno and it works great. I run mosquito on the same rpi as openhab.
I find mosquito more reliable than the arduino broker.
This way you can just connect both gateways to the same broker.