sudo hcitool lescan
LE Scan ...
C2:20:44:79:31:EE Puck.js 31ee
So 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-conn
I 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 successful
I 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...
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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:
This tells me it is.
Next I checked my version of bluetoothd:
That tells me I'm ok there.
Next I restarted my bluetooth service:
Next I started following this tutorial: https://www.jaredwolff.com/blog/get-started-with-bluetooth-low-energy/
So my laptop can see my Puck!
Next I tried connecting with gatttool:
So I tried using btmgmt:
I still saw the connection refused. but restarting the bluetooth service and attempting gatttool again, this time with the -t random option saw success:
I 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.