Can't get active LE scanning to work in linux

84 views
Skip to first unread message

Paul Urbanus

unread,
Aug 10, 2022, 4:14:44 PM8/10/22
to python-bleson
I'm a BT newbie, so I may be missing something. My system is an RPi 4 with the latest Bullseye distro loaded and bluez installed.

I have some low cost ($12) Govee H5074 BLE temp/humidity sensors that I'm trying to get data from. I found the following code for accessing Govee sensors.BLE


This code assumes that the temp/humidity data is contained in the advertising manufacturing data. But when running the above script, there is no mfg data reported for the H5074. I dumped the raw data using hcidump and confirmed it matches what the above script captures.

The BLE Scanner app on my iphone shows the mfg data, and the temp and humidity data are sensible when decoded.

It is now my assumption that BLE Scanner app is issuing a scan request to get the additional advertising data. It is my understanding that active scanning mode should retrieve this data. Looking at the bleson sources, active scanning mode is the default. As a python newbie, I'm not able to see how to set the active scanning mode using set_scan_parameters method of the adapter object. But, if I'm reading the source code correctly active scanning mode should be the default.

Any help or pointers given will be much appreciated.

wayne....@gmail.com

unread,
Aug 11, 2022, 5:34:38 AM8/11/22
to python-bleson
Hi,

I wouldn't bother using Bleson, but have a look at this library instead:  https://github.com/ukBaz/python-bluezero

All the best
Wayne

Reply all
Reply to author
Forward
0 new messages