Puck.js puck.scan not working (?)

25 views
Skip to first unread message

jumjum123

unread,
Jan 22, 2020, 10:56:02 AM1/22/20
to DroidScript
Looks to me like puck.scan("Puck") is not working
Checked with example from Droidscript for magnetometer.
It's searching and searching and stops without result.
Also checked searching with full name, same problem. (Correct name is checked with NRF Connect.)

Replace scan with Connecting using adress (E5:D3:....) this works fine.

Is there anything wrong on my testing ?

Tested on Huawei Y5 2018, Android 8.1.0
Droidscript is from play.google, downloaded yesterday, same for puck plugin
Espruino Version is V2.04

BTW, should scan connect to first found device only, or all devices found ?

Steve Garman

unread,
Jan 22, 2020, 11:26:09 AM1/22/20
to DroidScript
There is no code in the example to enable Bluetooth.
Check if it enabled before running the code and enable it manually if necessary.

puck.Scan("Puck") should find all available pucks and offer you a list to select from.
If you remove the argument "Puck" and just use puck.Scan() it should find other devices as well

jumjum123

unread,
Jan 22, 2020, 5:30:58 PM1/22/20
to DroidScript
Bluetooth is enabled, otherwise the option with Connect instead of Scan would not work.

Good news:
After some time it worked.
Bad news:
I've no idea why.
- no interaction from my side.
- same source
- same hardware
- no restart, nothing
Reply all
Reply to author
Forward
0 new messages