Hi, I need advice from more experienced developers.
Let me describe my topology.
Currently I have working network using NR24L01 modules.
I have one main(master) server Arduino Mega and other nodes Arduino Pro Mini.
It is quite simple, nodes control different sensors, sends information back to the master.
I have built my communication using RF24 Mesh library.
I have created my custom communication protocol, it is like HTTP. It has GET command to obtain information from nodes, POST/PUT to set some sensor data(for example enable it or disable) and some custom like ALARM an so on. It is custom.
As I mentioned main server is Arduino Mega it plays role of broker (not really MQTT broker). And at first I have handle HTTP request on master server and response back with required information.
But recently I have realized such great protocol MQTT. It is made exactly for devices and very lightweight.
So for the sake of studying and learning some new technologies, I wanna to integrate it with my topology.
What I need to get from the outside of the local NRF24 network ?
Still it is like HTTP REST service.
- Get list of sensors, nodes.
- Get their states.
- Set periodical update.
- Get notifications
- Control nodes and sensors.
- And other common stuff.
Previously I implemented notifications using GCM (Google cloud messaging) but it was quite painful, MQTT has bidirectional communication support, so it is great.
I don't understand how should I integrate MQTT into my topology. Again my nodes don't have separate IP address (they are in NRF24 network) and cannot handle communication like ESP modules.
I wonder where should be MQTT broker in my architecture should it be current master server or master server will be like a bridge between internal network and MQTT protocol ? (If so I think it will slow down communication)
Please help to integrate MQTT into my existing topology. Give some advice how to build all this stuff correctly.