2

I have tried a lot of this lines programs but the terminal it keep's complaint.

Error message: Import Error:No module named bluetooth._bluetooth

I have install some lib but again the problem it shows. The code is not mine, I have take from here: https://github.com/bowdentheo/BLE-Beacon-Scanner/blob/master/BeaconScanner.py

--Part code:

import ScanUtility
import bluetooth._bluetooth as bluez

#Set bluetooth device. Default 0. dev_id = 0 try: sock = bluez.hci_open_dev(dev_id) print ("\n *** Looking for BLE Beacons *\n") print ("\n * CTRL-C to Cancel ***\n") except: print ("Error accessing bluetooth")

ScanUtility.hci_enable_le_scan(sock) #Scans for iBeacons try: while True: returnedList = ScanUtility.parse_events(sock, 10) for item in returnedList: print(item) print("") except KeyboardInterrupt: pass

MatsK
  • 2,882
  • 3
  • 17
  • 22
Lilfio
  • 21
  • 3

0 Answers0