i received my pucks yesterday. First inpressions: woooho :)
So i decided to do some coding. I'm familiar with Java and coding in abap at work.
First: i tried the web IDE from my Android phone (hoooray its a red blinking dot!!! :)). I also connected via "nrf connect".
And thats the point where i got stuck: my Puck disappeared from BT le scan. I could not find it via web IDE and nrf connect. So i pulled out the battery and i could reconnect.
Today its the same: i have now two pucks powered on, but i can only find one via scan. There is one thing i noticed: if i connect to a Puck via nrf connect or web IDE, it nots scannable anymore. I have to disconnect (web IDE or nrf APP) and the my Puck reappears.
Is that a "security feature"? For me it seems like i have to pull out the battery if i disconnect without "real" disconnect (for example: reboot my phone during established connection. Then i cant reconnect, because Puck is not visible).
Now my second Puck disappeared :(
What i have to done: i tried to connect via nrf UART 2.0 Android APP. I needed 3 tries to connect. Then my connection got lost and now i cant find it via scan anymore... :(
I attached some Screenshots.
Only one attachement possible? Hm. Here is the second Screenshot :)
Once something has connected to the Puck whether the IDE or app, it stops advertising. It sounds like if you cannot see it after reset/battery out that something is automatically connecting again. Double check and disconnect and you should see it start advertising again.
As @Ollie says, it's almost certainly another app.
The Puck can only accept one connection at a time so there's no point it advertising - arguably it might be more confusing if you could see it but couldn't connect :)
I'd force-quit any apps on your phone that you'd tried to connect to the Pucks with. Some apps will auto-connect to the Puck once set up, so will cause you all kinds of problems.
Also, have you tried to connect with a desktop/laptop? It could be that is auto-connecting as well - in troubleshooting there are instructions to stop it happening on Mac.
Why one BLE connection at a Time?
Bluetooth protocol? chip constraints? Nrf firmware, puck firmware?
Would an autodisconnect option be useful to release "claiming" devices, or would they just reconnect after being disconnected by force?
@Gordon and @Ollie: thanks for clarification.
I have only my Android phone that could connect to my pucks. My PC does not have Bluetooth (yet).
I tried to discover what device is connected, but i could not :( i powered down my Android phone and used my girlfriend Android phone (never connected to any Puck). But both pucks stay "invisible" :( seems like they think they are connected, but this cant be. The only Chance to get them back advertising is to pull off battery.
How can i log / find out what device is connected? As @Bas suggests: maybe you could add an auto disconnect?
For me it seems my pucks think they are still connected and therefore advertising is off.
@Bas I believe it's BLE protocol - at least on the nRF51822 it's not possible, you can google it pretty easily.
I'm not sure I understand how auto-disconnect supposed to work? How would it know the difference between a legitimate connection and one that it's supposed to disconnect from?
Discovering what is connected is hard too - I'm not sure you can get that info from Puck.js yet - even if you could communicate with it (you could add serial wires and communicate with Puck.js that way).
@Foster so what exactly happens if you pull out the battery and put it back in? The Pucks advertise, stay advertising and are fine - until you connect with either phone, and then even after you disconnect they stop advertising and can never be connected to again?
@Gordon: yes. If i pull the battery its advertising again. And i can connect via phone. When i disconnect (via nrf connect) the Puck starts advertising again. So thats fine.
But after some connects/reconnects my Puck does not advertise anymore. I will try to find out how to reproduce (Android phone, web IDE, maybe after x connects?!) and give a feedback.
I have a question regarding a connected device: how does my Puck knows if there is an alive connection? For example: i connect with my Android phone and suddenly pull out the battery (phone). Will my Puck begin to advertise after some time? For me it seems like my BT connection is weak and if my phone disconnects without a command "disconnect" then my Puck does not advertise anymore.
As I understand it, Bluetooth Low Energy connections have to have packets sent from one device to the other at regular intervals. For Puck.js it's a minimum of 50 times a second.
If a few of those don't get through for whatever reason, the connection is considered to have disconnected and both devices disconnect.
To figure it out you can just hook onto the connect and disconnect events.
Once you have a connection, upload the following:
Now the red LED will light when the Puck is connected and will go out when it's disconnected.
I guess the other possibility is you're managing to upload some code that completely locks the Puck up? Perhaps if you find code that always makes it disconnect then you could paste it up and I'll try and see what's wrong.
Also, I'd make sure you're on the latest firmware (1v89 at the moment). I know that 1v88 that it shipped with did have an issue where if you called updateServices with the wrong arguments it's cause an assertion which would reboot the device.
Thanks @Gordon for the explanation.
But i have bad news: they are dead, Jim!!!
My two pucks stopped advertising a few days ago (7 to be exact). Thats why i opened this thread. Today i had some free time and tried to get them advertising again and pulled out the battery. I was a little surprised, because there was no red led on while putting the battery in. I did it for both pucks and they are not advertising. I opened a new puck (only 2 of 5 are in use) and used that battery. Working! So i checked both batterys: empty!!! How could this be? I did not upload any code nor was a device connected (Windows PC off and Android phone Bluetooth off).
I'm shocked :(
Are you sure you didn't upload any code? What did you do with them after turning them on?
If you tried examples on the http://www.espruino.com/Puck.js+Web+Bluetooth page, the last example there comes with a warning that after trying it, unless you reset your Puck it'll run the battery down pretty fast.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem