Okay, this may be a really stupid question but here's the deal. My IoT device is subscribed to topic "Weather/Humidity". The device publishes real time humidity data to the broker. No problem there. Thing is, it also receives other devices which publishes humidity data, still no problem. But every time the device publishes the data, it gets a loop-back/echo from the broker, with the exact same message it just published.
I understand this is actually how things are supposed to work but is there any non-hassle way to filter out the device's own message it just published?
So far the scheme I thought of is that the published messages features an "ID" section. So if it's its own ID, it ignores it; if it's from other publishers, it heeds the message.
I couldn't help but suspect their are better, more clever ways to go about doing this.
Please help, thanks in advance.
You have 3 choices
Option 3 requires both a broker and a client library that supports MQTTv5