No, I’m just trying to get very reliable scans, 1 per second.
I currently have an iBeacon set to advertise once per second.
And now I have set the BlueDuino to AT-SDUR1 (i.e. 1 second scan duration).
So, in theory, the iBeacon is advertising once per second, and the BlueDuino is scanning for one second, sooooo it should capture every single advertisement from the iBeacon and I should get 1 scan result per second, but…
When I run a simple sketch, I get too much variability in the scan results. For example, here’s what I get in the serial monitor (the RSSI number is incorrect; just ignore it):
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 965
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1010
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1976
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 963
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1011
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 963
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1012
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 964
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 3947
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1976
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1010
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 962
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1977
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1011
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 963
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1014
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 964
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 2986
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 963
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1012
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1972
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 962
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1014
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 963
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 2986
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1984
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 963
The RSSI of the target bluetooth LE 4.0 fob is: 2
Milliseconds elapsed since last string: 1011
You can see from the bolded numbers above that I am getting slow scans every few seconds. Not sure why though.
I am currently trying a different approach where the sketch writes AT+SCAN2 then reads results for 1 second, then writes AT+SCAN0 (stops scanning), then loops back to write AT+SCAN2 again, etc etc. It seems to be getting better results, but still not all 1 second scans.
So I am still brainstorming how to get 100% reliable 1 second scans. That’s why I asked the question about scan interval and scan window.