Open franciscojosej opened 4 years ago
coode:
from bluetooth.ble import DiscoveryService
service = DiscoveryService("hci0") devices = service.discover(2)
for address, name in devices.items(): print("name: {}, address: {}".format(name, address))
Error: Traceback (most recent call last): File "/home/pi/Documents/python/HolaMundo.py", line 5, in devices = service.discover(2) RuntimeError: Set scan parameters failed (are you root?)
Solution: https://www.home-assistant.io/integrations/bluetooth_le_tracker
summarize solution : sudo apt-get install libcap2-bin sudo setcap 'cap_net_raw,cap_net_admin+eip' readlink -f \which python3` sudo setcap 'cap_net_raw+ep'readlink -f `which hcitool``
readlink -f \
sudo setcap 'cap_net_raw+ep'
Have Fun
coode:
bluetooth low energy scan
from bluetooth.ble import DiscoveryService
service = DiscoveryService("hci0") devices = service.discover(2)
for address, name in devices.items(): print("name: {}, address: {}".format(name, address))
Error: Traceback (most recent call last): File "/home/pi/Documents/python/HolaMundo.py", line 5, in
devices = service.discover(2)
RuntimeError: Set scan parameters failed (are you root?)
Solution: https://www.home-assistant.io/integrations/bluetooth_le_tracker
summarize solution : sudo apt-get install libcap2-bin sudo setcap 'cap_net_raw,cap_net_admin+eip'
readlink -f \
which python3`sudo setcap 'cap_net_raw+ep'
readlink -f `which hcitool``Have Fun