Can't connect Espruino Web IDE to Puck using Web Bluetooth

Posted on
Page
of 2
Prev
/ 2
  • Great - thanks! Just added an entry on this for Mac.

  • Home now. Removed the device on the MacOs menu and pairs perfectly. Also updated device firmware via the nRF Connect android app. Both Pucks running perfectly now.

    Cheers

  • Great - thanks for the update!

  • @gomako @skinofstars I'd love to get more information on this issue as it could be helpful to make the Web Bluetooth API more reliable.

    1. Is puck.js still connected in macOS Bluetooth Menu when Chrome is killed?
    2. What do you mean by auto-connect?
    3. It could be possible that puck.js doesn't show up in Web Bluetooth chooser within 10s. Did you try click "re-scan" link?
    4. Can you reproduce this issue with Chrome Canary?

    For info, I've been trying to reproduce this issue on macOS and the only way I've found was to connect puck.js with another native macOS application. In that case, Web Bluetooth chooser doesn't show yet the connected device. Patch is in process to solve this issue but I'm not sure that's the issue you're both had.

  • @François Will try and help.

    1. Yes, Puck is still in the os x bluetooth menu when Chrome is closed.
    2. I mean that I disconnect (not remove) the Puck from the os x bluetooth menu, then
      a couple of seconds later it is back on the menu in bold (meaning
      that the Puck has connected again) this is whether chrome is open or
      closed.
    3. Yep, I tried the re-scan link and it didn't show up.
    4. I am at work and can't test on Canary, but will update this post when I am home.

    From what I understand. If the Puck is connected to something, it stops advertising, and so doesn't show up to anything else that you scan with, whether it's a phone, different computer etc. I may well be wrong, but that's how it looks.

    I think that the issue may have arisen when I tried to make my Puck into a Play/Pause button (HID). I uploaded the code, then disconnected from the Web IDE, then connected via the os x bluetooth menu, as I reasoned that the os would need to connect for it to be able to control the media player. After that point, even if I reset the code to default (battery out, hold button down etc.) then os x saw that it had connected to the device before and just grabbed it when it was being advertised, which is why I needed to make os x forget the device completely so I could pair again in Chrome. I think that if I was quick enough, I probably could have connected via Web Bluetooth before os x did, (after disconnecting the device).

    So yes, I think the way that you reproduced it was the same reason my Puck wasn't showing up.

  • From what I understand. If the Puck is connected to something, it stops advertising, and so doesn't show up to anything else that you scan with, whether it's a phone, different computer etc. I may well be wrong, but that's how it looks.

    Yup!

    I think that the issue may have arisen when I tried to make my Puck into a Play/Pause button (HID).

    You're right. I was able to reproduce this issue when changing my Puck.js device to a HID button. This means that when https://codereview.chromium.org/25133230­02/ is applied to Chrome, you won't have to remove Puck.js device anymore.

    I'm glad we got this sorted eventually. I'll update this thread when it happens.

  • I think that the issue may have arisen when I tried to make my Puck into a Play/Pause button (HID)

    Ahh - I don't think you told me that initially! Yes, that would have done it! :)

    Did it work as a HID button after all that? :)

  • @Gordon I had forgotten that I did it. Oops! It was working on my laptop messing about with lots of different stuff and working fine, the problem arose when I was using it on my iMac (which I had set up with the HID code and paired with). I haven't tried it as a HID button again yet.

    I will try it again and let you know. Am I right in thinking I have to disconnect from Web Bluetooth and pair with the system OS to get HID to work as expected?

  • Am I right in thinking I have to disconnect from Web Bluetooth and pair with the system OS to get HID to work as expected?

    Yes - the OS will need to connect to the device when it's advertising that it's a HID device. Hopefully @François's Chrome changes will make sure that you can program it even when it's connected - but it'll be a while before they land.

    In the mean time, if you need to do debugging you can connect via USB TTL converter and send Serial1.setConsole(true) to force the REPL to stay on USB even when you're connected via Bluetooth.

  • @Gordon ah ok thanks. I don't really know much about BT, but I am learning. And yes, I've just tried the HID play button and it works great. Just need to Remove when I want to reprogram it. Looking forward to debugging when it's connected. It's about time I bought a USB TTL cable!

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

Can't connect Espruino Web IDE to Puck using Web Bluetooth

Posted by Avatar for user70870 @user70870

Actions