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.

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])
    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)
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?)
About KeiganMotor

KeiganMotor is a motor that can be controlled by BLE. For KeiganMotor, I referred to the following site.

Work environment

WSL Ubuntu 18.04
Python 3.6.8

Connection status

Bluetooth connection

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 hope you can tell me how I can improve the error.

  • Answer # 1

    I found the cause of the error on the above page

  • Answer # 2

    It may be easier to reply if you understand the following.

    What is KeiganMotor?

    What is your working environment? Linux? Windows?

    What is the connection? Bluetooth? Usb?

    Learn more about what you tried. (Which page did you see?)