Confused about BLE Scanning

Hi,

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?

Thanks

Hi,

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.

That’s great, thanks for the information

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.
image

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.

Thank for clarification.
Eric

Hello,

What do you mean by the gateway is also OFF ?

SwitchBot requires active scan to work, so you can’t get their data with Active Scan to OFF

Dear Florian,

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 :
image

What mean ACTIVE Scan for OMG ?
Is the connection initiated by OMG and thus will drain more battery ?

From : DEVWAVES

Active Scanning:

  • Active Scanning uses more battery on switchbot devices. It requests a read response from the switchbot devices
  • Active Scanning provides more data like battery info
  • Active Scanning is required by Bots and Curtains

Passive Scanning:

  • Passive Scanning uses less battery on switchbot devices. It does not request a read response from the switchbot devices
  • Passive Scanning does not provide battery info in most cases, but provides state (ON/OFF, temp, contact, motion, humidity … etc)
  • Passive Scanning is good enough for Motion, Contact, Meter and Plugs

Ideally , Passive scanning will be enough and a active scanning one per day to read battery level if such infos are not available for passives scans

Thanks for the clarification
Eric

Hi @esa66

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.

1 Like

Dear DigiH,

I have 8 Meter Plus which are running since november 9.

From November9 until the January 26 (78 days), battery lost +/- 4% : 0.05% per day.

On 25 January, I setup the gateway.

From January 26 until February 14 (19 days), battery lost +/- 3% : 0.16% per day.
About 3 times more.

image

Also, I check the HA graphic result : I have a resolution of 5 minutes.
I think far enough for a temperature.

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.

image

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.

Thanks
Best Regards