• To simplify my app development workflow I decided to host Bangle.js Loader on a local server (a Synology NAS) rather than GitHub.io.
    Currently I have selected Apache HTTP Server 2.4 as the back-end server, and PHP 7.3 with its default profile for PHP. I also tried with Nginx and a more advanced configuration for PHP.
    The Bangle.js Loader web page displays fine when connecting to my local server (10.0.1.4) with Google Chrome under Windows 10.
    But when I click on Connect I get this error message:

    10.0.1.4 says
    This Web Browser doesn't support Web Bluetooth.
    Please click Ok to see instructions for enabling it.

    Do you know the reason for such a bug? Is it to find on my server side or does it have to do with something wrong with the AppLoader code?


    1 Attachment

    • Image.png
  • IIRC web bluetooth requires https, that might be the problem. (admittedly, localhost does work for me without https)
    Check the console for errors. Or manually try to connect with BLE, if you see no errors. Probably just a general try-catch showing the same message on all errors.

  • Ohhhh OK Thanks.
    Indeed I remember having read something about this now.
    I will try using https as I wasn't able to interpret the errors in the console.

  • @AkosLukacs how does localhost work without https? WebBLE is meant to work on https only... then again... I don't have Chrome... I am using Chromium... maybe that's the difference... Google bends the rules when it comes to it's brand I guess :D

  • I have just enabled https on my local server and WebBluetooth works just fine now. Thanks~~

  • Glad it works.
    +PiOfThings well, dunno, seems to work in chrome. An exception for localhost seems to be sensible. But not sure whether that's standard, or just google's "opinion"...

  • @PiOfThings
    Your answer is here

    Because this experimental API is a powerful new feature added to the Web, Google Chrome aims to make it available only to secure contexts. This means you'll need to build with TLS in mind.

    During development you'll be able to interact with Web Bluetooth through http://localhost by using tools like the Chrome Dev Editor or the handy python -m SimpleHTTPServer, but to deploy it on a site you'll need to have HTTPS set up on your server.

  • During development you'll be able to interact with Web Bluetooth through http://localhost

    I guess if you use the exact same server but use http://my_pc_name instead it will probably break - could that have been your issue?

  • Probably yes. As I remember I used it in my experiments with localhost: to access my JavaScript app for BLE API.

    A self signed certificate may help

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

[Solved] WebBluetooth issue while hosting Bangle.js Loader on a local server rather than GitHub.io

Posted by Avatar for sebi @sebi

Actions