I got the beacon result printed on linux (raspbian) terminal through command sudo python testblescan.py [source code: https://github.com/switchdoclabs/iBeacon-Scanner- ], but when I try to run the testblescan.py directly on the python shell (python 2.7.9 by default as python 2.x on raspberry pi 3 model B) then I got an indentation issue which I solved by providing right indentation to the code naming myTestBle.py as filename (see on my screenshot). Now, I encountered by the error regarding bluez.hci_send_cmd(4 params) from blescan.py file. Screenshot It seems to me that Bluetooth modules for python is not working on my new raspberry pi 3 . I followed this [Tutorial on comment] and many other documents; I installed blueZ 5.39, pybluez 0.22, python-bluez and all other necessary Bluetooth libraries and dependencies; I tried every possible way to deal with this, but, the result is nothing. Maybe I am missing something or I don't have the depth knowledge of this. I require guidelines and suggestions to solve this issue. I would be obliged for any help from anyone. Thanks in advance.

  • could you add the details in your comment to your question above?
    – Darth Vader
    May 4, 2016 at 14:59
  • the point is that I used a python program to retrieve the signal data out of the beacons only when I run it via command on raspbian terminal (e.g. sudo python testblescan.py), but, the same program throws error whenever I try to run it from the python IDLE (in my case python 2.7.9 shell)-----you can get both the pictures on the screenshot provided. Now, question is why this same program is working in one place and not working in another? May 4, 2016 at 15:15

1 Answer 1


I'm not sure if you're still working on this project or not. But I believe the solution to the above problem is simple. You should try running idle with elevated privileges. If it works with sudo in the shell but doesn't work in Idle, simply try opening Idle from shell via "sudo Idle" or "sudo Idle3" for python 3. That should give Idle the same privileges as the shell while using Idle.

Best of luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.