-
• #2
OK, well I was able to connect.
For the benefit of others, this is what I did:
First, I checked the bluetooth adapter in my laptop was capable of BLE:
hciconfig -a
...
HCI Version: 4.1 (0x7) REvision: 0x0This tells me it is.
Next I checked my version of bluetoothd:
bluetoothd --version
5.47That tells me I'm ok there.
Next I restarted my bluetooth service:
sudo /etc/init.d/bluetooth restart
[ ok ] Restarting bluetooth (via systemctl): bluetooth.service.Next I started following this tutorial: https://www.jaredwolff.com/blog/get-started-with-bluetooth-low-energy/
hcitool dev
Devices:hci0 64:6E:69:BA:A2:58
sudo hcitool lescan
LE Scan ...
C2:20:44:79:31:EE Puck.js 31eeSo my laptop can see my Puck!
Next I tried connecting with gatttool:
sudo gatttool --device=C2:20:44:79:31:EE -I
[C2:20:44:79:31:EE][LE]> connect
Attempting to connect to C2:20:44:79:31:EE
Error: connect error: Connection refused (111)So I tried using btmgmt:
sudo btmgmt le on
hci0 Set Low Energy complete, settings: powered connectable discoverable bondable ssp br/edr le secure-connI still saw the connection refused. but restarting the bluetooth service and attempting gatttool again, this time with the -t random option saw success:
sudo gatttool --device=C2:20:44:79:31:EE -I -t random
[C2:20:44:79:31:EE][LE]> connect
Attempting to connect to C2:20:44:79:31:EE
Connection successfulI could then follow the tutorial above, access primary services and characteristics successfully.
Then I tried the web IDE again and lo and behold the Puck shows up. A few more attempts and I was able to connect to it...
Hope that helps someone.
-
• #3
Thanks for the update - glad you got it going in the end.
Web Bluetooth on Linux can be kind of picky. Once you have a newish Bluez (5.47 is fine) I've found the following sorts me out all the time:
- Restart Bluetooth
sudo /etc/init.d/bluetooth restart
(which you did) - this helps if you can connect but don't receive any data back from the device. - If a device can't be found, manually start scanning for Bluetooth devices using the system Bluetooth menu
- Restart Bluetooth
Hi,
I just got my first Puck and am really struggling to get started.
I'm running Linux (Lubuntu 17.10) and can't get the Web IDE in Chrome to see the Puck.
The Espruino website says I have web-bluetooth enabled. From the Web-IDE in chrome, I click the yellow button and then select the web-bluetooth port. The pairing pop-up starts scanning, but never sees any device.
I've upgraded bluez to 5.4.7.
I can see my iphone when it's discoverable in bluetoothctl or the bluetooth manager UI.
On my iphone I can see the Puck in nRF Connect. I've successfully updated the Puck's firmware to 1v96 using nRF Toolbox on the iphone.
What am I doing wrong?
Thanks