nkolban / esp32-snippets

Sample ESP32 snippets and code fragments
https://leanpub.com/kolban-ESP32
Apache License 2.0
2.36k stars 710 forks source link

optimal setInterval and setWindow for BLE Scanning only #858

Open mm108 opened 5 years ago

mm108 commented 5 years ago

My requirement is to purely scan for ble devices, advertisements - with no connection whatsoever to any other ble devices. I was wondering if anyone here has an idea as to what the optimal values (setInterval, setWindow) for pure ble scanning would be? Default of 100/99 seems to work but sometimes it does miss some devices that are nearby even though my scantime is 10 seconds and the ble devices advertise every 3-4 seconds.

As we speak I am trying to write a little program that will vary the values for setInterval/setWindow and "keep a count of hits". This way I can narrow down on the values that gives better result. But I thought I'd drop in a question in case someone has some ideas on this? Wonderful library btw, thanks

axa88 commented 5 years ago

not esp32 specific but the only data ive come across. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5751532/

seems to indicate to me a .650s window with 1.250s interval optimal for power. but who knows.