-
Hi Gordon,
that's the code I used - initially. I added some () for the prints to make them python3 compatible, the version I have on the pi is 3.5 (not the latest, also complicated, as string substitution with these fStrings - yeah - is not possible for example...).I'll give the python3 recommendations a try back in the office (wed), for now I tried to go with useing node.js - to start with I wanted to use my macbook with mojave. So the whole noble lib seems a mess - as the docs suggest I went with noble-mac now.
Interestingly, I was able to use my new pixl.js with the example - the code example found the device, connected, sent the command and disconnected. I did need to switch from : to - in the device address -somehow the devices addresses have - for me...
Now at home tried it with a puck, latest version.
pro:pixltests i511648$ node puckjs.js Noble: stateChange -> poweredOn Found device: 80-82-23-2d-de-d5 Found device: 80-82-23-2d-de-d5 Found device: ef-22-d8-d6-2e-71 BT> Connecting Found device: ef-22-d8-d6-2e-71 BT> Connecting BT> Connected BT> Connected
All I changed in my code, see below, is the device address. I connected via the web ide, NRF.getAddress() and replace the : with - so the device is found.
Really the same code (https://www.espruino.com/Interfacing#node-js) except the address line changed to:
var ADDRESS = "ef:22:d8:d6:2e:71".replace(/:/g, "-");
BTW find it super amazing that the browser with web bluetooth now seems to be the most stable BLE api you can find out there :-)
Just to be sure, you're using this code? https://www.espruino.com/Interfacing#python
As-is, or did you tweak
command
? It's possible that there's some edge case ifcommand
was exactly a multiple of 20 characters (or something like that)?