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

Posted on
Page
of 2
/ 2
Next
  • Running the Espruino Web IDE in chrome on an android phone.
    Web bluetooth is enabled.
    When selecting the Connect button I get a dialogue box saying "Select a port" with Web Bluetooth being the only option. Selecting Web Bluetooth results in a "Connection failed" message.

    The Web IDE console in settings shows:

    Set Slow Write = true
    BT> ERROR: NotFoundError: Bluetooth adapter not available
    ERROR: [notify error] Connection failed
    >>> Connection Failed
    

    Going into Bluetooth settings and scanning shows that the Puck is visible.

    Phone: Samsung Note 3
    Chrome: Version 54.0.2840.85 (Web Bluetooth enabled and browser restarted)
    Android: Version 5.0

    Has anyone seen anything like this?

    David

  • Android 5 doesn't have Web Bluetooth enabled by default because Google were worried about permissions (Android 6 lets an app ask as and when it needs access to some device, and in 5 you had to ask at install time).

    You can do it though, but you have to manually install Chrome - have a look at the page linked from the Getting Started guide: http://stackoverflow.com/questions/34810194/can-i-try-web-bluetooth-on-chrome-for-android-lollipop

    It's a bit involved, but that page is the one linked directly from The Web Bluetooth page

  • If you just want to see if you can communicate, there are other apps though - nRF connect will connect and you can send simple commands, as will the Adafruit app, and I believe DroidScript will work too.

  • Do you know if an iOs device can connect to the Puck by default?

  • Yes, it should be able to. Try the Nordic nRF UART app, and also the Adafruit Bluefruit app.

    We're actually trying to make a Web Bluetooth browser for iOS, with a certain amount of success. Hopefully there will be something to announce soon :)

  • Hi Gordon,

    Manually installed Chrome and it now gets a bit further....

    I now get a Pairing dialogue with a name that matches my Puck. Selecting that and clicking Pair I get another Connection Failed message with a different reason:

    Set Slow Write = true
    >>> Connecting to Puck.js af7e
    BT>  Device Name:       Puck.js af7e
    BT>  Device ID:         xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    BT> ERROR: TypeError: Cannot read property 'join' of undefined
    ERROR: [notify error] Connection Failed
    >>> Connection Failed.
    

    Any ideas what this might be?

    Thanks, David

    P.S. nRF Connect can connect to the Puck ok.

  • That's really strange - looks like the version of Web Bluetooth you've got there is missing a field that's in all the other implementations :( Odd, as I have had it working on Android 5 (it must have been an update in Chrome)

    Luckily it's only for a debug message. I'll make an update in the next hour or so - it should get you past that problem at least.

  • Ok, try now. Assuming you're running from http://espruino.com/ide you should be able to just hit refresh.

  • Hi Gordon,

    That worked after I cleared the browser caches.

    Thanks,
    David

  • Great, thanks for letting me know. I'll update the puck.js helper as well, so the other Web Bluetooth tutorials should work

  • So I'm have two pucks as off lunchtime today. Both initially paired ok via Chrome on my MacBook Pro but now one will not appear. I've tried resetting it by taking out the battery and holding down the button gor3 secs till all 3 leds come on but it just will not appear on the scan.
    I've tried rebooting the browser and the laptop but no use.

  • Can you try installing the new firmware? https://www.espruino.com/Puck.js#firmware-updates

    The new one contains some changes that should make connection a bit more reliable - unfortunately I just found out that Seeed flashed an older firmware onto all the devices than they should have.

  • Hi, I'm having a similar issue. The web ide connected ok when I first got the puck, but it won't find the device now. I have installed firmware version 1v89 and am on chrome Version 54.0.2840.98 (64-bit)

    My mac is telling me that I'm connected to the puck (it auto-connects) in the bluetooth menu. So I thought maybe that was blocking the connection to the web ide, but when I disconnect from the bluetooth menu it still doesn't find it. Also, the 'main' bluetooth window doesn't show the puck (see screenshot).

    The puck can be found in nRF Connect, and there doesn't seem to be anything of any help in the ide console.


    1 Attachment

    • Screen Shot 2016-12-07 at 10.50.35.png
  • Yes I see it on the Mac's bluetooth menu like you. I've not managed to upgrade my firmware as the iPhone version of the app seems to be different from the version described in the HowTo. It just lists in/out properties you can set or read, no upload option available.

    I think v89 is the latest so perhaps I'll hold off until this is resolved. I'm not sure what my current version is. However, I received 2 buttons together and I'd expect them to act similarly but one is just fine.

  • I should add that when it DOES connect (onc ein a blue moon) it works absolutely perfectly. I wondered if it was some sort of cross talk between the two devices so I removed the other one and powered it down but no joy.

  • It's expected that you won't see the Puck in the system menu because it doesn't offer anything (like a keyboard/mouse) that the system is interested in. The auto-connect thing is very strange though - I can't think of any reason it would do that.

    Can you:

    • Close the Chrome Window with the Web IDE (and check that there aren't any more windows open that might be trying to use Web Bluetooth)
    • Check that you don't have any other applications running that might be trying to connect (if there's some Hudl 2 software, it's possible it got confused and tried to connect to the Puck?)
    • Disconnect from the Puck via the Bluetooth window
    • Take the battery out of the puck for 5 seconds and re-insert it
    • Open the https://www.espruino.com/ide/ in Chrome and try connecting again (but using the Web IDE)
  • @MrWheeliebin do you see the Puck you can't connect to listed as 'Connected' in your Mac's Bluetooth Menu as well?

    It is possible that there is some other software that is auto-connecting to it...

  • That makes sense about the BT system menu.

    I followed the steps above but no joy.

    HOWEVER! What did work for me was holding the option key down whilst clicking on the bluetooth icon in the menu bar. This opens up some more options in the bluetooth menu (see screenshot), one of them being 'remove'. I clicked this and was able to connect in chrome immediately. Have tried it a couple of times and it seems to work consistently.


    1 Attachment

    • Screen Shot 2016-12-07 at 11.42.55.png
  • Wow, interesting - thanks for letting me know! So normally you see Disconnect, but it keeps coming back.

    But if you click while holding the option key, you also see Remove, which works?

    @MrWheeliebin can you check and see if this works for you too?

    I have to say I'm pretty stumped by how it got added in the first place - since as you say the Mac Bluetooth Devices menu doesn't even show it!

  • Oh interesting. I'm away from my Mac at the moment, but if I recall correctly @Gordon, If you see the image above from @gomako, if I click on the little right pointing triangluar arrow I think there is a "disconnect" option.
    When I get home I'll try the "remove" as above and see if that works.
    Thanks to you both.

  • Yep, if I click Disconnect as normal it pops back into the menu after a couple of seconds, but the Remove option, it doesn't auto-reconnect and allows me to connect via Chrome.

    Once it's paired again in Chrome, the puck reappears in the os x bluetooth menu, but I am able to disconnect and re-connect via the web ide. Maybe when you pair it in Chrome, it also pairs it somehow in os x? Perhaps I tried to disconnect from the os x bluetooth menu and that sort of locks it out of Chrome or something? No idea what I'm talking about really!

  • This was exactly the same for me. Needed to be remove http://forum.espruino.com/conversations/296905/#comment13356481

  • @skinofstars Derp! That'll teach me to not read the forum properly! However, I didn't need to go through any other steps like rebooting, just Remove was enough in my case.

  • @skinofstars sorry - I totally missed that part of the step :(

    Where did you guys look in the documentation for help first, so I can make sure add it in the right place. http://www.espruino.com/Puck.js#troubleshooting ?

  • @Gordon I looked at the troubleshooting page via the Puck quick start page: https://www.espruino.com/Puck.js+Quick+Start. Then I headed to the forum after that.

  • 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