monitor
monitor copied to clipboard
Is it possible to porting monitor to ESP32?
Thanks a lot for your wonderful program!
ESP32 has ble & wifi with very low price (about 25 RMB/5 USD in China), with very low power consumption and sufficient performance. If monitor could be run on esp32, the world could be more beautiful, I’m sure!
https://github.com/jptrsn/ESP32-mqtt-room Does almost the same
https://github.com/jptrsn/ESP32-mqtt-room Does almost the same
Nope. The repo you mentioned is just a beacon presence detector, almost the same as esphome ble components, witch can not support smart phones who send random mac in advertisement. But "monitor" use name query, witch is the best choice for smart phones.
I've had the same question a while back, since I have a bunch of ESP32's laying around anyway. I have since been working on a partial port of this script to the ESP32. At the moment it is still very much tailored to my own needs with a lot of hard-coded stuff and let's say in a very pre-alpha state ;)
Currently I have at least the mqtt triggered scanning figured out based on basically the known_static_addresses provided.
Depending on my progress though I may upload it to github at some point in the future.
That would be awesome.
I've had the same question a while back, since I have a bunch of ESP32's laying around anyway. I have since been working on a partial port of this script to the ESP32. At the moment it is still very much tailored to my own needs with a lot of hard-coded stuff and let's say in a very pre-alpha state ;)
Currently I have at least the mqtt triggered scanning figured out based on basically the known_static_addresses provided.
Depending on my progress though I may upload it to github at some point in the future.
Hi, did you have any progress yet? I'm also searching for a solution which based on ESP32
@XingKongSync pls check this repo: https://github.com/dansonskywalker/esp_ble_tracker it's not a porting of monitor script, but could track ios devices by esp32.
Hi @XingKongSync, I did get this to work pretty decent so far. I've got a setup running at my place with 3 ESP32's running my 'monitor script port' together with 2 on raspberry pi's. Not all features are yet supported though, and I was really hoping to be able to distribute this with the option for ESPHome. The main problem is that my current implementation depends on both the arduino framework, and some bluetooth functions that have only been implemented in the latest ESP-IDF framework. The 2 of which are not quite as compatible as hoped for. Getting this to compile and function for people other than myself, it would require some tinkering ;)
Nevertheless, I plan on cleaning up my codebase a bit over the weekend and making the Github repo public afterwards. At least that way others can weigh in on it :)
I'll keep you posted!
@XingKongSync pls check this repo: https://github.com/dansonskywalker/esp_ble_tracker it's not a porting of monitor script, but could track ios devices by esp32.
Thanks!
Hi @XingKongSync, I did get this to work pretty decent so far. I've got a setup running at my place with 3 ESP32's running my 'monitor script port' together with 2 on raspberry pi's. Not all features are yet supported though, and I was really hoping to be able to distribute this with the option for ESPHome. The main problem is that my current implementation depends on both the arduino framework, and some bluetooth functions that have only been implemented in the latest ESP-IDF framework. The 2 of which are not quite as compatible as hoped for. Getting this to compile and function for people other than myself, it would require some tinkering ;)
Nevertheless, I plan on cleaning up my codebase a bit over the weekend and making the Github repo public afterwards. At least that way others can weigh in on it :)
I'll keep you posted!
Thank you for your reply, that will be awesome!
@XingKongSync, @xcray Apologies for the delay, life suddenly had other plans for me... -_-'
It took some additional effort to get it to compile on a clean checkout of the codebase, but it's up for grabs now: RoboMagus/ESP32-MQTT-Bluetooth-Monitor. As a pre-release there are pre-compiled binaries available for the Wemos D1 Mini 32.
Should you have any feature requests, or issues please do let me know. I intend to continue development on this and some interesting new ideas might prove to be a good addition ;)
Feel free to share this link in other places, I'm not currently active on e.g. reddit and the HomeAssistant forums.
@XingKongSync, @xcray Apologies for the delay, life suddenly had other plans for me... -_-'
It took some additional effort to get it to compile on a clean checkout of the codebase, but it's up for grabs now: RoboMagus/ESP32-MQTT-Bluetooth-Monitor. As a pre-release there are pre-compiled binaries available for the Wemos D1 Mini 32.
Should you have any feature requests, or issues please do let me know. I intend to continue development on this and some interesting new ideas might prove to be a good addition ;)
Feel free to share this link in other places, I'm not currently active on e.g. reddit and the HomeAssistant forums.
Awesome! Thanks for sharing, I will try.
Thanks xcray for the port to esp32. Is there any advantages or disadvantages for presence detection to use an esp32 over a raspberrypi zero w with monitor? I don't have both. Thx.
There's not really an advantage over using one or the other. It's mostly about what hardware you have available and what features you need.
I ported it mostly because I have a bunch of ESP32s laying around anyway and I did not want to invest in multiple Pi zeros.
I have no evidence to back this up, but I think that iterating over the list of bluetooth devices for name querying is a tad faster on the ESP32, as it does not have to wait a second for every device query performed.
But if you rely on other scan triggers than the MQTT scan calls I suggest you stick to andrewjfreyers script, as I have not yet had the time to port the passive scanning logic ;)
passive scanning logic
Thanks for the reply. I don't understand your remark on the missing of passive scanning logic. By default in the monitor readme is passive mode mentioned.
What I understand by "passive" is that the script is run every x seconds and scans for known ble devices and reports by a mqtt message if a device is seen yes/no. Your esp32 port seems to have the same behavior. What am I missing on the passive mode in your esp version?
I'm not quite sure on how to propperly describe the passive mode, but it is not the same as scanning for known devices every x seconds. It's best described in the oversimplified analogy, but basically when a new random MAC address is found while passively listening (instead of performing an active scan) then Monitor performs an arrival scan. Then when after some time this same MAC does no longer show up, Monitor performs a departure scan.
My port currently only supports MQTT triggered scans, and performing a scan (both arrival and departure) every x seconds. The passive listening for and keeping track of found mac addresses and performing specific scans based on that is on my To-Do list, but I've not been able to spend time on it just yet.