-
• #2
First, I'd update your firmware to 1v94 - that could help you a lot :)
Does it work if you don't have the bonding part in there?
Also, just wondering if right after connecting you see all 3 LEDs light up at once - that'd signal an internal error that it rebooted to try and recover from.
-
• #3
first attempt: upgrade to 1v94 then reload same code. Result: same
second attempt: remove the bonding part in code:
var gatt; NRF.requestDevice({ filters: [{ name: 'My BT actuator name' }] }).then(function(device) { console.log("found device"); return device.gatt.connect(); }).then(function(g) { gatt = g; gatt.disconnect(); }).catch(function(e) { console.log("ERROR",e); });
And log:
_____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |_____|___| _|_| |___|_|_|_|___| |_| http://espruino.com 1v94 Copyright 2017 G.Williams Espruino is Open Source. Our work is supported only by sales of official boards and donations: http://espruino.com/Donate > =undefined found device ERROR Connection Timeout >
-
• #4
Another try with bonding code removed caused the puck.js to disconnect from the IDE again.
-
• #5
BTW, can I expect from the Puck.js to stay connected to the IDE even when connected to a peripheral device? In other terms, can the Puck.js be at the same time a peripheral AND a central device?
-
• #6
OK I tried with another peripheral device and it works. I restarted my BTLE actuator and it works . looks like I made a wrong operation on it...
-
• #7
can I expect from the Puck.js to stay connected to the IDE even when connected to a peripheral device?
Yes, you should - it's only if something goes very wrong in the Nordic libs that it restarts. If we can get steps I can reproduce here then I might be able to do something with it though.
Hi there,
I am trying to use the Puck.js as a central device, connecting to a peripheral device (BTLE actuator).
I suppose that the procedure is as following:
name
orid
of the peripheral device already known and used as filter.startBonding
Whenever my Puck.js executes the
gatt.connect()
, I have 2 problems appearing: First one is that the Puck.js disconnects from the IDE, and second one is that connection fails with error "ERROR Connection Timeout".I tried to execute the code found here http://www.espruino.com/Reference#l_BluetoothRemoteGATTServer_startBonding
First step of requesting the device seems to be OK as I can read
found device
in the console when the puck.js doesn't disconnect from the IDE.Any idea on what goes wrong?