I'm trying to enable webusb feature in chrome to test it. I' tryng to run this demo (https://github.com/webusb/arduino) locally on my webserver but it does not work, instead the version published on github works.
My setup:
But when I access the demo page I got javascript error because navigator.usb is undefined.
What's wrong in my setup, why navigator.usb is not enabled in my local setup but is enabled when I surf the online demo from the same browser?
To get it up and running you have to enable Experimental Web Platform features, you can find these in the Chrome flags:
chrome://flags/#enable-experimental-web-platform-features
Now navigator.usb
will be available, however, if you're developing on localhost
you wont see any devices. To get devices showing up you should boot Chrome with --disable-webusb-security
which will produce a notification announcing that security will suffer and allow you to see al your attached devices. For more extensive explanation take a look at https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web