Close

Trying WebUSB

A project log for USBShare.exe

Replacing unknown exe with opensource

stephengeorgeweststephengeorgewest 09/14/2021 at 16:530 Comments

Trying to find a quick way to test writing out a single usb message, I didn't find any test programs.
Nirsoft USBDeview, and microsoft usbview.exe helped see the devices, but that was it.
HIDPyToy didn't help, because I needed to send a non-hid message.

Now I'm looking at webusb, https://wicg.github.io/webusb/#enumdef-usbrequesttype

It won't be useful, but it might be an easy test, and easy to port...? Should look something like:

device = await navigator.usb.requestDevice({ 
    filters: [{
        vendorId: device.vendorId,
        productId: device.productId
    }]
});
await device.open();
await device.controlTransferOut({
    requestType: 'standard',
    recipient: 'device',
    request: 0x09,
    value: 0x01,
    index: 0x00
})

Device.open ->  DOMException: Access denied. Looks like a windows problem.

Ok, trying linux. ... no chrome installed. installing chromium. navigator.usb doesn't exist on chromium 92. Should be in since chrome 61. Maybe it is just stripped out of chromium. Downloading to be a local file worked, oh HTTPS only. DOMException: Access denied. Added udev rule. not fixed. maybe udev didn't work

Maybe I should have checked usb-internals first. It looks like the "Testing Tool Panel" is what I wanted. I'm guessing the error is the same permissions error.

yep, Udev didn't work. Fixed, I wrote "=" instead of "==", and now the testing panel doesn't report any errors, but also doesn't trigger the device switch, and the webcode errors with: "An attempt to claim a USB device interface has been blocked because it implements a protected class." Oh, it looks like it gets setup as an hid device, so webUSB blocks it... I guess I'll try another way.

Discussions