I've used the same bluepy library on Raspberry Pi with good success, though I've been thinking of moving over to a newer library as I think bluepy has stopped being maintained.
The hcitool lescan command will only do an active scan, and I don't believe it will connect to a peripheral, which is what your Python code will attempt. If the chest belt is advertising and if you run the active scan, then it should show up if it's in range, as you saw.
If you want a connection to the chest belt peripheral, then there might be two things wrong with your Python code:
1. You need to use the random address type, like this, instead of the default public address:
2. The chest belt is not connectable. You can only read the advertising data. To check this, you can run 'btmon' in another terminal window when you run the scan and see if the chest belt responds as Connectable or not Connectable in btmon.
The difference between random and public address is described here:
https://academy.nordicsemi.com/courses/ ... h-address/
The hcitool lescan command will only do an active scan, and I don't believe it will connect to a peripheral, which is what your Python code will attempt. If the chest belt is advertising and if you run the active scan, then it should show up if it's in range, as you saw.
If you want a connection to the chest belt peripheral, then there might be two things wrong with your Python code:
1. You need to use the random address type, like this, instead of the default public address:
Code:
dev = btle.Peripheral(device_mac, addrType = 'random')
The difference between random and public address is described here:
https://academy.nordicsemi.com/courses/ ... h-address/
Statistics: Posted by austin944 — Thu Jan 02, 2025 3:56 am