PhracturedBlue / ESP8266MQTTMesh

Self-assembling Mesh network built around the MQTT protocol supporting OTA
GNU General Public License v3.0
267 stars 79 forks source link

Mesh Network publish conflict #70

Open OmarAlkassab opened 5 years ago

OmarAlkassab commented 5 years ago

Make sure you have the latest version of ESP8266MQTTMesh before reporting an issue.

Please Provide the following information:

If you are you using platformio or Arduino, which one? platformio

Description of problem: I have built a mesh network of 2 NodeMCU v1.0 (ESP-12E) just for testing, and I have set the credentials of each one separately. When the 2 modules can see the router, they publish the data for each board client id, but when one of them use the mesh technology, the message is published by the nearest module to the router! How I can always ensure each module publish to its account?

simone1999 commented 5 years ago

you can only ensure that by seperating the Modules in two Networks. This is done by giving each node one of two different Mesh passwords, nodes with different Mesh Passwords don't connect together so 2 completely seperated Meshes will be formed. The mqtt Message will always be send to the MQTT Server defined by the Node with direct Connection to the Router! if you don't want to seperate the Meshes my Advice would be to let them all send to the same MQTT Broker and then forward the packets to the real different MQTT Brokers. if your Programming Skills or Motivation is not high enough to write a own Programm, which handles the Packet detection and sending to the right Broker, you could just use Node-Red, it has a MQTT interface and with the Nodes the Seperation of the Packages should not be hard. Feel free to write back if you need more Help/Informations