Hi all,
I started to use OMG two days ago.
My use-case is a simple BLE-sniffer: I want to glue cheap beacons to my garbage bins, and check by reception strength whether they are close to their default location or moved to the street for pickup.
My broker is the one embedded into ioBroker, which is based on MQTT.js.
I was able to set a whitelist like this, with the retain flag enabled:
Not knowing much about ioBroker, where in your MQTT message is the retain flag set to true though? If the white-list is sent with the retain flag set to true the MQTT broker should send the white-list again after every restart of the ESP32.
If you connect to your MQTT broker with an app like MQTT.fx or MQTT Explorer, does the white-list message show up as retained there when you subsribe to your OpenMQTTGateway?
I actually resend different white-lists, depending on other variables like presence and security state, via OpenHAB, by monitoring for the LWT state of OMG, which sends an “online” after every restart (Actually also a retained message, along with another one containing the version number - both great for checking to see if retained messages correctly show up for you). I’m sure this would also be possible with ioBroker, but a correctly set retain=true with your white-list message should do the trick for you.
Thanks for your explanation. I was searching the last posts, but didn’t find your old question.
In ioBroker the retain flag is global for the whole MQTT adapter, but apparently it does not work as expected. When I subscribed to OpenMQTTGateway I got several thousands of (old) messages from previous BLE scans. It looks like all messages are retained internally, which is most likely not expected.
But your suggestion to monitor LWT is great: this is what I tried now and it seems to work nicely. Will check back in few days and see if any other devices that the ones on my whitelist were pushed to the MQTT server on ioBroker.
Three days alter only a single device “bypassed” the whitelist, i.e. was detected before the whitelist was published to the OMG.
That’s pretty good and I’m happy with the solution to monitor LWT and then publish the whitelist:
Good to hear that this is also working fine for you
Please also let us know how this is working out for you with the beacons attached to the garbage cans. Is there quite a substantial distance between their usual place and the street pick up location? As the reported distance/rssi can vary within a range, and also seems slightly weather/humidity sensitive, especially outdoors.