Pairing after lost connection

Posted on
  • Review
    I received my Puck a few days ago, it's a great product. I'm really impressed by the quality of both the PCB and the plastic/silicone case. The assembly fits together really well.

    I got started really quickly as described in your Puck-Js unboxing video. I've run through the basics, your puck2.html example, Puck.mag() and Puck.light(). Everything was quick and easy as advertised.

    Problem
    I have hit one snag as a result of playing with Puck.light() (not directly related to that function though). While trying to block the light to the sensor I must have blocked the signal because I lost the connection. Once the signal was re-established I couldn't pair with the device again.

    I'm using a Chromebook to pair with it, so I disabled/enable the Bluetooth hoping it would reset the connection. I also tried restarting my Chromebook, both attempts were unsuccessful. I could still see the Puck in the device list but it just wouldn't pair.

    Eventually, I removed the battery from the Puck and all was well again. I repeated the problem several times with the exact same result.

    My novice guess would be that once the Puck has paired with a device it will persist with that connection and not timeout or enable another connection. Or is it a problem with my Chromebook?

  • Which Chromebook is it?

    Did you try closing the webpage as well and re-opening it? Sometimes it seems that Web Bluetooth (or perhaps just the Web IDE) gets confused about the state of the connection - it could be that the web page itself was still trying to keep the connection open, even though you were reconnecting.

    Also, as I mentioned in another post here - if you'd been trying with some app on your phone (for example the nRF connect app), it can stay running in the background and (I believe) can try and automatically reconnect, even when your phone isn't unlocked. It could be that Puck.js had actually reconnected to another device which is why you couldn't connect in the first place.

    I'm actually really surprised that you could block the signal using your finger - it does get easily blocked, but usually not that easily. I wonder whether it could be something else that actually caused Puck.js to crash (I'm not sure how though).

  • I was using the Chrome App and not the Web IDE or Web Bluetooth.

    It's a Samsung Chromebook 303C. I did try shutting down the Chromebook and rebooting so I would hope that would sever the connection completely on the laptop side.
    I hadn't been trying to connect any other device to the Puck, solely just the Chromebook.
    I did have a dongle for a wireless keyboard plugged in, but I unplugged that and the problem still persists.

    The signal wasn't easily blocked but it can be done if you really try.

    What should do the puck do if it loses the connection? Should it default back to discoverable?

  • What should do the puck do if it loses the connection? Should it default back to discoverable?

    Yes, absolutely. Usually you can just keep disconnecting and reconnecting and it's fine.

    What code were you running at the time? I guess something could have caused a crash?

  • I'll recreate it tonight and post with more detail.

  • I'm getting reconnection issues with Chrome 55 on a Macbook Pro 10.12

    The Mac's bluetooth system tray thing shows the puck as connected, but the web bluetooth device scanning dialog in Chrome says "No bluetooth device found".

    I do have other bluetooth devices attached, like a keyboard, and they also don't show up in the WebIDE Chrome dialog, so maybe the problem is there? I found the Google Chrome Github for web bluetooth to see if I could test that as a problem. The other devices are discoverable when I use their examples https://googlechrome.github.io/samples/web-bluetooth/device-information-characteristics.html from the list in https://googlechrome.github.io/samples/web-bluetooth/

  • Have you completely closed the Chrome window and reopened it?

    It seems odd that the Mac itself is showing the Puck as connected. Can you disconnect it from the Mac system menu?

    If the Mac is connected then the Puck won't be advertising, so won't show up in available devices - so that could be the issue. Did you try and connect using the Mac system menu first? I guess that could be causing you problems?

  • Hey, yeah, I completely closed Chrome, the computer, the lid, everything. Actually, it does work when you restart the computer, but it's then re-pairing following a sleep that was at issue (which is why I jumped on this issue - sorry JackJamesHoward)

    I did connect to the Mac before figuring out the web bluetooth. Removing from the Mac bluetooth (using alt+click on the system tray), and then pairing from the browser first seems to have resolved the re-connection issue. It does now still show up in the system tray, but it's no longer a problem.

    I did also need to do a Web IDE cache clear and reset the puck. Though I'm uncertain if that was related.

    So, steps to fix my reconnection issue:

    • Get OS to forget (remove using alt+click on the system tray)
    • Reset puck.
    • Clear Browser caches.
    • Start again from the Web IDE at https://www.espruino.com/ide/
  • Glad you got it sorted - I'm not sure if clearing the caches was part of the solution, but I imagine getting the OS to forget really helped.

    However I've just found out that Seeed installed the wrong firmware on all the Pucks. It's only one version out of date, but the new version (1v89) actually has some changes that make it much more reliable to connect to on different platforms - and this could be your problem.

    Flashing instructions here: https://www.espruino.com/Puck.js#firmware-updates

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Pairing after lost connection

Posted by Avatar for JackJamesHoward @JackJamesHoward

Actions