• Hi

    I'm about to enter a hackathon this weekend where I'm hoping to build a web bluetooth website which will receive events from a puck.js button whenever the button is clicked.

    I've successfully created a dummy POC website which works locally, but it doesn't work when I deploy it to the cloud using Elastic Beanstalk.

    This is the site: http://timetravelhack-dotnetcoreapi-dev.­eu-west-1.elasticbeanstalk.com/
    The error I get if I click on the clock icon is this: "This web browser doesn't support web bluetooth."

    This isn't actually true, the browser is fine (Chrome v70 in Windows 10). Previously I was on Chrome v69, and when I first ran the site locally I got that error and upgraded to Chrome v70, which fixed the problem.

    I presume there is some problem with the fact that the site is now hosted in the cloud instead of locally. Maybe I need to use a different AMI in Elastic Beanstalk?

    I've tried googling but no joy. Can anyone help? I'd really like to host the site on a server somewhere because it's quite important that multiple users are able to access the site simultaneously.

    Cheers
    Clare.

  • Fri 2018.10.26

    Hello @user95170 Clare,

    'I'm about to enter a hackathon this weekend'

    Sounds exciting, where on this planet is this to take place?



    Have you and/or will you deploy the first and second simple example from:

    https://www.espruino.com/Puck.js+Web+Blu­etooth

    to help isolate where to start to take a peek.



    2nd pp:

    'To work, Web Bluetooth needs to be run from a website that's served over HTTPS (not HTTP). '

    Might this be an item to verify?

  • I think that might be a bit tricky, as I find AWS quite hard to navigate and I'm not actually sure how I would deploy that example to AWS. Also I'm quite short on time so I don't want to get distracted deploying some other thing. The example I have deployed was done via Visual Studio and AWS Toolkit. But the code in my example was taken originally from the following puckjs tutorial, and then edited: https://www.espruino.com/Puck.js+Web+Blu­etooth

    I have linked to my deployed site above. The identical site works fine when I deploy it on localhost.

    The hackathon is Hack Manchester (UK): https://www.hac100.com/event/hack-mcr-18­/

  • Hi

    I just saw your second comment re https. That's a good point! I shall investigate.

  • Are you able to use a GitHub acct instead, as that appears to be https?


    re: 'The hackathon is Hack Manchester (UK)'

    Rats, . . . . my Tardis is in the shop for maintenance [ something about a mis-wired Espruino device ;-) ] and my vehicle wont make the 3902mi trip on one tank of fuel.

    Milwaukee, Wisconsin USA 2hrs from Green Bay (Packers) - Go Pack Go!!

    Sounds like fun Clare. Good luck!!

  • Nice - good luck with the Hackathon!

    I'd be 99% sure the issue is to do with a lack of HTTPS as @Robin says. The other one to watch out for is that you can only connect to a device in response to a user input (not when a page starts) but it looks like you're doing that anyway.

    If you can't get HTTPS out of elastic beanstalk for whatever reason but still want to use that URL (maybe to access other AWS stuff?), you may be able to use a simple HTTPS page from GitHub inside an iframe, and then window.postMessage to communicate between the two pages - it's a bit of a hack, but it should work.

  • ...cool, did not know about that window.postMessage()... I used some other similar, more general purpose RYO pub/sub mechanism.

  • I actually use it in the EspruinoHub IDE page: https://github.com/espruino/EspruinoHub/­blob/master/www/ide.html

    Also to serve the IDE directly off of something like an Espruino WiFi: http://forum.espruino.com/conversations/­318472/

  • Thanks for all the advice!
    We gave up on getting it working in the cloud during the hackathon - we decided to focus on other more pressing matters. But the advice is all useful and I will probably return to it at some point. :)

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

Getting a web bluetooth website working in Elastic Beanstalk in AWS

Posted by Avatar for user95170 @user95170

Actions