jarkko-hautakorpi / iBeacon-indoor-positioning-demo

Indoor positioning of iBeacon tags (tagged people, dogs, cats and objects) by trilateration, using ESP32.
MIT License
183 stars 99 forks source link

How to: predefined MAC #23

Closed DasAuryn closed 1 year ago

DasAuryn commented 1 year ago

Hi,

actually it's running fine, but how can i just publish a specified device, and not everything around me? :)

jarkko-hautakorpi commented 1 year ago

Then perhaps a MAC filter should be implemented into ESP32 firmware. Maybe a filter topic in MQTT to read the wanted list of MAC addresses from (into) ESP32 so you can dynamically manage the list. ESP32 would subscribe to this filter topic.

DasAuryn commented 1 year ago

Thank you. Maybe my question was a little bit misleading. Not ESP sided, I ment from dashboard. Like a whitelist/known beacons or something like that.

jarkko-hautakorpi commented 1 year ago

You could for example implement MAC whitelist/blacklist list and check it here to discard all unwanted MAC addresses: https://github.com/jarkko-hautakorpi/iBeacon-indoor-positioning-demo/blob/10a22d9427e63cdf199e63d87789e0770ee3ac6c/dashboard/src/MessageStack/MessageStack.js#L27C24-L27C24

`

if(msg !== null) {
            for(let i=0; i<msg.e.length;i++) {
                let mac = msg.e[i].m.toLowerCase();
                if(this.blacklist.includes(mac)
                    break; // Skip message if mac is blacklisted

` Probably a button to MAC list items in UI to add it to the list would be good, and persisting the list to localstorage or something..