kawasaki / pyscrlink

Scratch-link for Linux written in python
BSD 3-Clause "New" or "Revised" License
120 stars 24 forks source link

Can not scan BLE devices. Check BLE controller - Ubuntu 22.04 #42

Open suoko opened 5 months ago

suoko commented 5 months ago

I'm trying connecting wedo 2.0 but have this error:

2024-04-14 14:22:35,923 Started scratch-link
2024-04-14 14:23:20,919 Start session for web socket path: /scratch/ble
2024-04-14 14:23:21,039 Can not scan BLE devices. Check BLE controller.

I started bluepy_helper_cap, I tried "hciconfig hci0 down" and "hciconfig hci0 up", I tried connecting the device with the OS BT pairing first (it does connect), I tried the dev version, but nothing

Can anybody suggest a solution ?

I got this when running with -d Failed to execute management command 'le on' (code: 20, error: Permission Denied)

but can't run scratch_link with sudo. How do I give correct permissions ?

suoko commented 5 months ago

Also tried: sudo setcap 'cap_net_raw,cap_net_admin+eip' /home/user/.local/bin/bluepy_helper_cap scratch_link -r 2 -s 3

suoko commented 5 months ago

I found this node project which works https://github.com/zdila/scratch-link-ble-linux

markakis-sch commented 5 months ago

What do you mean "works"? Last year I tried the zdila/scratch-link-ble-linux project with a WeDo 2.0 and all I managed to do was to connect and change the color of the led light. It was impossible to get the motor to work or a sensor to work. What did you manage to do? Pyscrlink works fine for me on Ubuntu 22.04