Hi everyone,
I'm trying to implement a little demo for WebUSB. I'm trying to get a connection to a LEGO Mindstorms EV3. But I'm not sure if this is possible at all.
ev3_info.addEventListener('click', function() {
console.log("test");
navigator.usb.requestDevice({ filters: [{ vendorId: 1684 }] })
.then(device => {
console.log(device.productName);
console.log(device.manufacturerName);
})
.catch(error => { console.log(error); });
});
The vendorId is correct as I can see within the device log of my chrome instance:
USBUser[22:09:04] USB device added: vendor=1684 "LEGO Group", product=5 "Fabian", serial="001653402f46", guid=0ff0a065-f42e-4763-955e-702ebc9d262c
I even tried 0x1684 and various combinations with the productId and without it.
The window where I can select a device is shown but empty all the time. I can't select a device.
Because I'm not sure if I understand the specification correctly: Is it possible to connect to any devices? Do they need to implement something special in the firmware or something (would be a show stopper for me because I can of course not modify it)?
I tried it with a local HTML document I just double click to show it with chrome and with an HTML project in WebStorm.
All flags are set. At least I think all are set because I can interact with the USB Interface of the navigator.
Maybe someone can help and point me in the right direction. Current chrome version is Version 53.0.2785.116 m (64-bit).
Thanks!
Fabian