STMicroelectronics / BlueSTSDK_Python

Bluetooth Low Energy Sensors Technology Software Development Kit (Python version for Linux Gateways)
https://www.st.com/en/embedded-software/bluest-sdk.html
BSD 3-Clause "New" or "Revised" License
61 stars 19 forks source link

error while excuting example_ble_1 #33

Open balti09 opened 2 years ago

balti09 commented 2 years ago

hi , i'm trying to execute the example_ble_1.py in raspberry pi3 B+ and i get this errors : ps: my python version is 3.9.0 is there any solution ?

`##################

BlueST Example

##################

Scanning Bluetooth devices...

Discovery started. Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/blue_st_sdk/manager.py", line 313, in discover self._scanner.scan(timeout_s) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 312, in _mgmtCmd raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp) bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 20, error: Permission Denied)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/balti/BlueSTSDK_Python/blue_st_examples/example_ble_1.py", line 312, in main(sys.argv[1:]) File "/home/balti/BlueSTSDK_Python/blue_st_examples/example_ble_1.py", line 189, in main manager.discover(SCANNING_TIME_s) File "/usr/local/lib/python3.9/dist-packages/blue_st_sdk/manager.py", line 325, in discover raise BlueSTInvalidOperationException(msg) blue_st_sdk.utils.blue_st_exceptions.BlueSTInvalidOperationException: Bluetooth scanning requires root privilege, so please run the script with "sudo".`

davidroid commented 2 years ago

Hello, did you run the script with "sudo"?

Davide

Il mer 6 lug 2022, 12:40 balti09 @.***> ha scritto:

hi , i'm trying to execute the example_ble_1.py in raspberry pi3 B+ and i get this errors : ps: my python version is 3.9.0 is there any solution ?

`################## BlueST Example

##################

Scanning Bluetooth devices...

Discovery started. Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/blue_st_sdk/manager.py", line 313, in discover self._scanner.scan(timeout_s) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 312, in _mgmtCmd raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp) bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 20, error: Permission Denied)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/balti/BlueSTSDK_Python/blue_st_examples/example_ble_1.py", line 312, in main(sys.argv[1:]) File "/home/balti/BlueSTSDK_Python/blue_st_examples/example_ble_1.py", line 189, in main manager.discover(SCANNING_TIME_s) File "/usr/local/lib/python3.9/dist-packages/blue_st_sdk/manager.py", line 325, in discover raise BlueSTInvalidOperationException(msg) blue_st_sdk.utils.blue_st_exceptions.BlueSTInvalidOperationException: Bluetooth scanning requires root privilege, so please run the script with "sudo".`

— Reply to this email directly, view it on GitHub https://github.com/STMicroelectronics/BlueSTSDK_Python/issues/33, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZTU2NBOWIVBU3BPCKJJRLVSVPATANCNFSM52ZI5XZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

balti09 commented 2 years ago

Hello, did you run the script with "sudo"? Davide Il mer 6 lug 2022, 12:40 balti09 @.> ha scritto: hi , i'm trying to execute the example_ble_1.py in raspberry pi3 B+ and i get this errors : ps: my python version is 3.9.0 is there any solution ? ################## BlueST Example ################## Scanning Bluetooth devices... Discovery started. Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/blue_st_sdk/manager.py", line 313, in discover self._scanner.scan(timeout_s) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 312, in _mgmtCmd raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp) bluepy.btle.BTLEManagementError: Failed to execute management command 'le on' (code: 20, error: Permission Denied) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/balti/BlueSTSDK_Python/blue_st_examples/example_ble_1.py", line 312, in main(sys.argv[1:]) File "/home/balti/BlueSTSDK_Python/blue_st_examples/example_ble_1.py", line 189, in main manager.discover(SCANNING_TIME_s) File "/usr/local/lib/python3.9/dist-packages/blue_st_sdk/manager.py", line 325, in discover raise BlueSTInvalidOperationException(msg) blue_st_sdk.utils.blue_st_exceptions.BlueSTInvalidOperationException: Bluetooth scanning requires root privilege, so please run the script with "sudo". — Reply to this email directly, view it on GitHub <#33>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZTU2NBOWIVBU3BPCKJJRLVSVPATANCNFSM52ZI5XZQ . You are receiving this because you are subscribed to this thread.Message ID: @.> raspberry yes i did

balti09 commented 2 years ago

@davidroid is there any solution please ?

davidroid commented 2 years ago

Hello, What is the OS you are using on the RPI 3b+? I need to replicate and debug the issue on the same system.

Regards, Davide

Il giorno mar 12 lug 2022 alle ore 17:23 balti09 @.***> ha scritto:

@davidroid https://github.com/davidroid is there any solution please ?

— Reply to this email directly, view it on GitHub https://github.com/STMicroelectronics/BlueSTSDK_Python/issues/33#issuecomment-1181903157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZTU2PPMP6G3IJP5YH5KLLVTWEYTANCNFSM52ZI5XZQ . You are receiving this because you were mentioned.Message ID: @.***>

balti09 commented 2 years ago

Hello @davidroid , i'm using the Raspberry Pi OS (https://www.raspberrypi.org/software/) (originally known as Raspbian, a derivative of Debian), stm board : STEVAL-STWINKT1B running the example : FP-IND-PREDMNT1

hannescam commented 1 year ago

i have the same problem on archlinux with a pc and my board is a STM32WB55