Replies: 3 comments 10 replies
-
How long does the device advertise for? It could be that the device is advertising on a different channel than the scanner at these moments, the solution to that is to make the interval and window the same and short, something like 50/50. |
Beta Was this translation helpful? Give feedback.
-
That limitation is basically the definition of iBeacons. All iBeacons function this exact same way. You can adjust the TX power higher for a stronger signal, and you can adjust the interval, but you can NOT adjust the "window" of a beacon since it is only sending its little data packet once per interval. Like you said, the scanner has to be listening on the right channel during the tiny little burst transmission from the beacon. So you might think this is the source of the problem, but... If you remember back a few messages earlier, I noted that when I adjust the interval of the beacon, the problem still remains that same:
If the scanner is missing the little burst from the beacon, you would think that sending multiple little bursts would solve the problem. Imagine the scanner is set at 800/800 (interval/window). During the scanning window (800 x 0.625 = 500ms), the scanner should only have to see the beacon burst one time, then it would be able to report that during that 500ms window, it saw beacon xyz. No missed scans at all. (I am not sure but I think the scanner does not report the same beacon twice, so even if the beacon broadcasts 5 times during that 500ms window, the scanner would only report it once) But that is not happening. At 500ms beacon interval, I get periodic gaps in the scan results lasting 1-2 seconds. When I adjust the beacon interval to 200ms, I get gaps in the scan results lasting 400-800ms. It's interesting that the scan gaps are a simple multiple of the beacon interval, but I can't figure out why. By the way, the timing of the periodic gaps in scan results don't seem to show any pattern. Sometimes the gaps pop up after 40 successful scans in a row, then sometimes they pop up after 3 scans, or 8, or 28, or 1. Side issue: Setting the scanner at 800/800 interval/window works for a while, but then the ESP freezes up after some random period of time (1 hour to maybe 4 hours). Literally stops everything, even a simple heartbeat serial print in the void loop stops. Changing it to 800/750 works, and the scanner never freezes up the ESP. Lots of discussion about this in the ESP github for a couple years now. |
Beta Was this translation helpful? Give feedback.
-
I can post a simple sketch that I am using for this testing if you like. I can also send a you an iBeacon that you can use for testing too. Just send me your mailing address in some confidential way. (Is there DMing on GitHub?) |
Beta Was this translation helpful? Give feedback.
-
I'm trying to scan for a beacon (using whitelist) and capture each of the advertisements from the beacon. The beacon is advertising every 500ms, and the ESP is scanning continuously. But no matter how I adjust the window/interval settings, I still get frequent missed broadcasts, i.e. the beacon broadcasts but the ESP misses it.
My sketch is:
Results in the serial from the above sketch are as follows (note the bold items where I have added comments). The first number is the number of milliseconds since the last broadcast scan result:
502: Found dd:34:02:06:34:17 with RSSI -77
501: Found dd:34:02:06:34:17 with RSSI -76
502: Found dd:34:02:06:34:17 with RSSI -71
508: Found dd:34:02:06:34:17 with RSSI -77
1515: Found dd:34:02:06:34:17 with RSSI -77 (missed two broadcasts)
503: Found dd:34:02:06:34:17 with RSSI -77
1012: Found dd:34:02:06:34:17 with RSSI -78 (missed one broadcast)
1000: Found dd:34:02:06:34:17 with RSSI -76 (missed one broadcast)
508: Found dd:34:02:06:34:17 with RSSI -70
503: Found dd:34:02:06:34:17 with RSSI -77
502: Found dd:34:02:06:34:17 with RSSI -76
502: Found dd:34:02:06:34:17 with RSSI -69
501: Found dd:34:02:06:34:17 with RSSI -77
505: Found dd:34:02:06:34:17 with RSSI -76
502: Found dd:34:02:06:34:17 with RSSI -69
501: Found dd:34:02:06:34:17 with RSSI -78
500: Found dd:34:02:06:34:17 with RSSI -76
503: Found dd:34:02:06:34:17 with RSSI -70
506: Found dd:34:02:06:34:17 with RSSI -78
505: Found dd:34:02:06:34:17 with RSSI -76
502: Found dd:34:02:06:34:17 with RSSI -70
504: Found dd:34:02:06:34:17 with RSSI -79
1001: Found dd:34:02:06:34:17 with RSSI -75 (missed one broadcast)
509: Found dd:34:02:06:34:17 with RSSI -69
505: Found dd:34:02:06:34:17 with RSSI -78
502: Found dd:34:02:06:34:17 with RSSI -75
509: Found dd:34:02:06:34:17 with RSSI -70
503: Found dd:34:02:06:34:17 with RSSI -79
1515: Found dd:34:02:06:34:17 with RSSI -79 (missed two broadcasts)
504: Found dd:34:02:06:34:17 with RSSI -75
1522: Found dd:34:02:06:34:17 with RSSI -71 (missed two broadcasts)
505: Found dd:34:02:06:34:17 with RSSI -78
507: Found dd:34:02:06:34:17 with RSSI -75
508: Found dd:34:02:06:34:17 with RSSI -70
506: Found dd:34:02:06:34:17 with RSSI -79
502: Found dd:34:02:06:34:17 with RSSI -75
506: Found dd:34:02:06:34:17 with RSSI -69
503: Found dd:34:02:06:34:17 with RSSI -72
503: Found dd:34:02:06:34:17 with RSSI -76
509: Found dd:34:02:06:34:17 with RSSI -78
502: Found dd:34:02:06:34:17 with RSSI -77
506: Found dd:34:02:06:34:17 with RSSI -79
506: Found dd:34:02:06:34:17 with RSSI -76
504: Found dd:34:02:06:34:17 with RSSI -78
1010: Found dd:34:02:06:34:17 with RSSI -75 (missed one broadcast)
503: Found dd:34:02:06:34:17 with RSSI -78
1011: Found dd:34:02:06:34:17 with RSSI -75 (missed one broadcast)
505: Found dd:34:02:06:34:17 with RSSI -78
503: Found dd:34:02:06:34:17 with RSSI -78
I have played around with all different variations of interval and window in the pBLEscan settings: both commented out, 100/99, 500/490, 1000/900, 10000/9500, 50/49, 200/180, 600/560. No matter what the setting, I still get missed broadcasts (sometimes two!) as shown above.
Any idea why and how to fix this?
Beta Was this translation helpful? Give feedback.
All reactions