Home>

https://docs.keigan-motor.com/software_dev/python/pythonlib
I want to detect the MAC address of KeiganMotor's motor by executing the script of KM1Scan.py from the above URL to the source code (Github), but the following error occurred.

Error message
Traceback (most recent call last):
  File "KM1Scan.py", line 15, in<module>
    devices = scanner.scan (scan_sec)
  File "/usr/local/lib/python3.6/dist-packages/bluepy/btle.py", line 852, in scan
    self.start (passive = passive)
  File "/usr/local/lib/python3.6/dist-packages/bluepy/btle.py", line 790, in start
    self._mgmtCmd ("le on")
  File "/usr/local/lib/python3.6/dist-packages/bluepy/btle.py", line 309, in _mgmtCmd
    rsp = self._waitResp ('mgmt')
  File "/usr/local/lib/python3.6/dist-packages/bluepy/btle.py", line 366, in _waitResp
    raise BTLEManagementError ("Management not available (permissions problem?)", resp)
bluepy.btle.BTLEManagementError: Management not available (permissions problem?)
Applicable source code
#!/usr/bin/env python3
#-*-coding: utf-8-*-
"" "
Created on Sun Jan 14 10:46:12 2018
@author: [email protected]
"" "
from __future__ import print_function
from bluepy.btle import Scanner
import sys
if len (sys.argv)>= 2:
    scan_sec = float (sys.argv [1])
else:
    scan_sec = 5.0
scanner = Scanner ()
devices = scanner.scan (scan_sec)
KM1_list = []
for dev in devices:
    for (adtype, desc, value) in dev.getScanData ():
        if desc == "Complete Local Name" and "KM-1" in value:
            print (value, ":", dev.addr)

After pip install bluepy input, it was executed with python3 KM1Scan.py, but the above error came out,
After entering sudo pip install bluepy, I tried sudo python3 KM1Scan.py, but the result did not change. I would be pleased to tell you how to detect the MAC address of KeiganMotor's motor.

Supplemental information

I am using ubuntu18.04 in WSL environment

Trends