I’m confused about the mechanics of the bluetooth scanning and have some questions. Apologies if these have been asked before:
Can you have multiple ESP32s scanning for BLE devices, or does one “connect” and then prevent further beacon to the remaining receivers ?
Do active / passive scans force the beacon to transmit, using battery for each scan? Or do passive scans just listen for beacons the device would transmit anyway?
If scan interval is every 55 seconds for 10 seconds, are any beacons outside of this 10 second window missed?
The mechanism used by OMG at this time is the scan of service data, meaning that we don’t connect to devices. We just read the data they expose to the world.
It listen for beacons, the devices would have advertised the information anymway.
Never did the test but take into account that BLE advertising devices can be a lot near you, if you are using OMG for presence detection you should set a white list of your BLE advertising devices.
Dear,
I’m busy with tests on BLE device SwitchBot Meter plus. What I understand : Source : passive vs Active
In passive mode, the gateway listen to broadcasted messages send by devices.
Messages packets contain sensor data and can be passively received by other devices.
This is better to spare battery of BLE devices.
Correct ?
But, when I set the Button to deactivate the “Active Scan” ,then the gateway is also OFF.
Which setting I have to set to be in passive mode ?
I prefer to not make active SCAN at a specific rate.
For battery life, it is better to listen for broadcasted Messages from BLE devices.
I thought that if Active was OFF, it means PASSIVE (listening to broadcast message from Meter).
This is why set both SCAN and CONNECT to OFF.
Thus the all gateway was OFF state.
Below the picture :
What mean ACTIVE Scan for OMG ?
Is the connection initiated by OMG and thus will drain more battery ?
it means the same as for other scanning implementation and as you have correctly stated further down, i.e. active scanning requests a broadcast from the devices.
That would be ideal, but with passive scanning it is only possible to receive the manufacturerdata of the SwitchBot devices, which, while it has some of the data like temperature and humidity encoded in it for the Meter, doesn’t have the important model ID contained, which is necessary to identify the particular SwitchBot Meter (Plus) device from other SwitchBot devices.
While other scanning implementations might be able to connect to the device initially, store its model ID along with its MAC address, then only keep scanning in passive mode and decode the information from the manufacturerdata which is then linked to the device MAC, this is out of the scope of Decoder, which only allows for receiving broadcast advertising data.
I hope this clarifies some of your concerns above.
I have a better resolution on the SwitchBot App, in case I absolutely need more precision.
If I take statistic for a longer period, the resolution in HA is 1 hour.
In other words, it seems not interesting to have less than 5 minutes period.
For OMG, the maximum sample period is 100 Sec.
Can I increase this period in step by 1 minute in place of Sec ?
I would like to have 5 minutes or more and see if the battery will drop a bit less.