<div dir="ltr">A small update: When the modemmanager finishes probing (~16 secs after connection) data seems to stop flowing in from the WebUSB bulk endpoint also. It is, however, possible to reconnect and get data again - so I need to see if there should be anything in the mbed firmware causing that behavior or there is some sort of silent reset of interfaces/endpoints happening on the linux side when probing is done. </div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 10, 2017 at 12:11 AM, Lars Knudsen <span dir="ltr"><<a href="mailto:larsgk@gmail.com" target="_blank">larsgk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I finally managed to make a configuration that *seems* to work and I realize that I may have had something else blocking the WebUSB interface (2) while modemmanager was communicating with the CDC_ACM interface (1).<div><br></div><div>I made a clean arbitrary VID/PID and get what seems to be a functioning WebUSB (now) while modemmanager sends "AT...AT..." to the CDC interface - so while I thought the modemmanager grabbed my WebUSB interface part, it must have been because of a faulty combination on my side - my apologies. WebUSB actually *does* seem to give immediate "bulk" access to a device otherwise claimed by modemmanager - a very nice option to have and sorry for the confusion I had that modemmanager grabbed more interfaces than it should have.</div><div><br></div><div>Still, the original request still stands and please tell me if it's a viable path:</div><div><br></div><div>1. If a device has a WebUSB descriptor, it's most probably *not* a modem - and should in stead be considered a device that in this rare case needs to be whitelisted (as modem), while defaulting to not being it. This is to ease the usage from non-browsers to the same hardware, which can then happen immediately and not be required to fail and wait over the modemmanager probing period (30 sec?) - related to modemmanager</div><div>2. If a device has a WebUSB descriptor, at least the interface linked to WebUSB should be made accessible in user land by default so no average user has to figure out how to do udev rules - related to udev/systemd</div><div><br></div><div>my headers that seem to work now for the case above:</div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">Bus 002 Device 089: ID 1209:d010 InterBiometrics </font></div><span class=""><div><font face="monospace, monospace">Device Descriptor:</font></div><div><font face="monospace, monospace"> bLength 18</font></div><div><font face="monospace, monospace"> bDescriptorType 1</font></div><div><font face="monospace, monospace"> bcdUSB 2.10</font></div><div><font face="monospace, monospace"> bDeviceClass 0 (Defined at Interface level)</font></div><div><font face="monospace, monospace"> bDeviceSubClass 0 </font></div><div><font face="monospace, monospace"> bDeviceProtocol 0 </font></div><div><font face="monospace, monospace"> bMaxPacketSize0 64</font></div></span><div><font face="monospace, monospace"> idVendor 0x1209 InterBiometrics</font></div><div><font face="monospace, monospace"> idProduct 0xd010 </font></div><div><font face="monospace, monospace"> bcdDevice 0.01</font></div><div><font face="monospace, monospace"> iManufacturer 1 empriKit</font></div><div><font face="monospace, monospace"> iProduct 2 empriKit|MOTION</font></div><div><font face="monospace, monospace"> iSerial 3 00.01</font></div><span class=""><div><font face="monospace, monospace"> bNumConfigurations 1</font></div><div><font face="monospace, monospace"> Configuration Descriptor:</font></div><div><font face="monospace, monospace"> bLength 9</font></div><div><font face="monospace, monospace"> bDescriptorType 2</font></div></span><div><font face="monospace, monospace"> wTotalLength 90</font></div><span class=""><div><font face="monospace, monospace"> bNumInterfaces 3</font></div><div><font face="monospace, monospace"> bConfigurationValue 1</font></div><div><font face="monospace, monospace"> iConfiguration 0 </font></div></span><div><font face="monospace, monospace"> bmAttributes 0xc0</font></div><div><font face="monospace, monospace"> Self Powered</font></div><div><font face="monospace, monospace"> MaxPower 100mA</font></div><span class=""><div><font face="monospace, monospace"> Interface Descriptor:</font></div><div><font face="monospace, monospace"> bLength 9</font></div><div><font face="monospace, monospace"> bDescriptorType 4</font></div><div><font face="monospace, monospace"> bInterfaceNumber 0</font></div><div><font face="monospace, monospace"> bAlternateSetting 0</font></div><div><font face="monospace, monospace"> bNumEndpoints 1</font></div><div><font face="monospace, monospace"> bInterfaceClass 2 Communications</font></div><div><font face="monospace, monospace"> bInterfaceSubClass 2 Abstract (modem)</font></div></span><div><font face="monospace, monospace"> bInterfaceProtocol 1 AT-commands (v.25ter)</font></div><span class=""><div><font face="monospace, monospace"> iInterface 0 </font></div><div><font face="monospace, monospace"> CDC Header:</font></div><div><font face="monospace, monospace"> bcdCDC 1.10</font></div><div><font face="monospace, monospace"> CDC Call Management:</font></div></span><div><font face="monospace, monospace"> bmCapabilities 0x03</font></div><div><font face="monospace, monospace"> call management</font></div><div><font face="monospace, monospace"> use DataInterface</font></div><div><font face="monospace, monospace"> bDataInterface 1</font></div><div><font face="monospace, monospace"> CDC ACM:</font></div><div><font face="monospace, monospace"> bmCapabilities 0x02</font></div><span class=""><div><font face="monospace, monospace"> line coding and serial state</font></div><div><font face="monospace, monospace"> CDC Union:</font></div><div><font face="monospace, monospace"> bMasterInterface 0</font></div><div><font face="monospace, monospace"> bSlaveInterface 1 </font></div><div><font face="monospace, monospace"> Endpoint Descriptor:</font></div><div><font face="monospace, monospace"> bLength 7</font></div><div><font face="monospace, monospace"> bDescriptorType 5</font></div><div><font face="monospace, monospace"> bEndpointAddress 0x81 EP 1 IN</font></div><div><font face="monospace, monospace"> bmAttributes 3</font></div><div><font face="monospace, monospace"> Transfer Type Interrupt</font></div><div><font face="monospace, monospace"> Synch Type None</font></div><div><font face="monospace, monospace"> Usage Type Data</font></div><div><font face="monospace, monospace"> wMaxPacketSize 0x0010 1x 16 bytes</font></div></span><div><font face="monospace, monospace"> bInterval 16</font></div><span class=""><div><font face="monospace, monospace"> Interface Descriptor:</font></div><div><font face="monospace, monospace"> bLength 9</font></div><div><font face="monospace, monospace"> bDescriptorType 4</font></div><div><font face="monospace, monospace"> bInterfaceNumber 1</font></div><div><font face="monospace, monospace"> bAlternateSetting 0</font></div><div><font face="monospace, monospace"> bNumEndpoints 2</font></div><div><font face="monospace, monospace"> bInterfaceClass 10 CDC Data</font></div><div><font face="monospace, monospace"> bInterfaceSubClass 0 Unused</font></div><div><font face="monospace, monospace"> bInterfaceProtocol 0 </font></div><div><font face="monospace, monospace"> iInterface 0 </font></div><div><font face="monospace, monospace"> Endpoint Descriptor:</font></div><div><font face="monospace, monospace"> bLength 7</font></div><div><font face="monospace, monospace"> bDescriptorType 5</font></div></span><div><font face="monospace, monospace"> bEndpointAddress 0x82 EP 2 IN</font></div><span class=""><div><font face="monospace, monospace"> bmAttributes 2</font></div><div><font face="monospace, monospace"> Transfer Type Bulk</font></div><div><font face="monospace, monospace"> Synch Type None</font></div><div><font face="monospace, monospace"> Usage Type Data</font></div><div><font face="monospace, monospace"> wMaxPacketSize 0x0040 1x 64 bytes</font></div><div><font face="monospace, monospace"> bInterval 0</font></div></span><span class=""><div><font face="monospace, monospace"> Endpoint Descriptor:</font></div><div><font face="monospace, monospace"> bLength 7</font></div><div><font face="monospace, monospace"> bDescriptorType 5</font></div><div><font face="monospace, monospace"> bEndpointAddress 0x02 EP 2 OUT</font></div><div><font face="monospace, monospace"> bmAttributes 2</font></div><div><font face="monospace, monospace"> Transfer Type Bulk</font></div><div><font face="monospace, monospace"> Synch Type None</font></div><div><font face="monospace, monospace"> Usage Type Data</font></div><div><font face="monospace, monospace"> wMaxPacketSize 0x0040 1x 64 bytes</font></div><div><font face="monospace, monospace"> bInterval 0</font></div></span><span class=""><div><font face="monospace, monospace"> Interface Descriptor:</font></div><div><font face="monospace, monospace"> bLength 9</font></div><div><font face="monospace, monospace"> bDescriptorType 4</font></div><div><font face="monospace, monospace"> bInterfaceNumber 2</font></div><div><font face="monospace, monospace"> bAlternateSetting 0</font></div><div><font face="monospace, monospace"> bNumEndpoints 2</font></div><div><font face="monospace, monospace"> bInterfaceClass 255 Vendor Specific Class</font></div><div><font face="monospace, monospace"> bInterfaceSubClass 0 </font></div><div><font face="monospace, monospace"> bInterfaceProtocol 0 </font></div><div><font face="monospace, monospace"> iInterface 0 </font></div><div><font face="monospace, monospace"> Endpoint Descriptor:</font></div><div><font face="monospace, monospace"> bLength 7</font></div><div><font face="monospace, monospace"> bDescriptorType 5</font></div></span><div><font face="monospace, monospace"> bEndpointAddress 0x85 EP 5 IN</font></div><span class=""><div><font face="monospace, monospace"> bmAttributes 2</font></div><div><font face="monospace, monospace"> Transfer Type Bulk</font></div><div><font face="monospace, monospace"> Synch Type None</font></div><div><font face="monospace, monospace"> Usage Type Data</font></div><div><font face="monospace, monospace"> wMaxPacketSize 0x0040 1x 64 bytes</font></div><div><font face="monospace, monospace"> bInterval 0</font></div></span><span class=""><div><font face="monospace, monospace"> Endpoint Descriptor:</font></div><div><font face="monospace, monospace"> bLength 7</font></div><div><font face="monospace, monospace"> bDescriptorType 5</font></div></span><div><font face="monospace, monospace"> bEndpointAddress 0x05 EP 5 OUT</font></div><span class=""><div><font face="monospace, monospace"> bmAttributes 2</font></div><div><font face="monospace, monospace"> Transfer Type Bulk</font></div><div><font face="monospace, monospace"> Synch Type None</font></div><div><font face="monospace, monospace"> Usage Type Data</font></div><div><font face="monospace, monospace"> wMaxPacketSize 0x0040 1x 64 bytes</font></div><div><font face="monospace, monospace"> bInterval 0</font></div></span><span class=""><div><font face="monospace, monospace">Binary Object Store Descriptor:</font></div><div><font face="monospace, monospace"> bLength 5</font></div><div><font face="monospace, monospace"> bDescriptorType 15</font></div></span><div><font face="monospace, monospace"> wTotalLength 29</font></div><div><font face="monospace, monospace"> bNumDeviceCaps 1</font></div><div><font face="monospace, monospace"> ** UNRECOGNIZED: 18 10 05 00 38 b6 08 34 a9 09 a0 47 8b fd a0 76 88 15 b6 65 00 01 57 02</font></div><div><font face="monospace, monospace">Device Status: 0x0001</font></div><div><font face="monospace, monospace"> Self Powered</font></div></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 9, 2017 at 10:32 PM, Reilly Grant <span dir="ltr"><<a href="mailto:me@reilly.io" target="_blank">me@reilly.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On <a href="tel:2017-01-09" value="+4520170109" target="_blank">2017-01-09</a> 9:55 am, Greg KH wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Jan 09, 2017 at 06:13:04PM +0100, Bjørn Mork wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Greg KH <<a href="mailto:greg@kroah.com" target="_blank">greg@kroah.com</a>> writes:<br>
> On Mon, Jan 09, 2017 at 09:40:59AM +0000, Kenneth Rohde Christiansen wrote:<br>
>> Web USB can only grab devices which has special Web USB headers. It can not<br>
>> grab any USB device.<br>
>><br>
>> <a href="https://wicg.github.io/webusb/#webusb-descriptors" rel="noreferrer" target="_blank">https://wicg.github.io/webusb/<wbr>#webusb-descriptors</a><br>
><br>
> Ah, fun :(<br>
><br>
> So, we can add a quirk into the kernel cdc-acm driver to never bind to a<br>
> device that has the wusb platform capability descriptor,<br>
<br>
I fail to see why a quirk should be necessary. New device classes are<br>
expected to use new class/subclass codes distintly different from<br>
anything handled by existing class drivers.<br>
</blockquote>
<br>
One would hope, but it seems like they want to piggy-back on the cdc-acm<br>
spec. But I could be totally wrong here, does anyone have the actual<br>
descriptor dump of a device anywhere?<br>
</blockquote>
<br></span>
We don't want to piggy-back on the CDC-ACM spec. A WebUSB device should always have its interfaces marked vendor-specific. Below is an example of a device which implements both a CDC-ACM interface and a WebUSB interface. As far as I've noticed ModemManager has not interfered with the browser accessing this device but Lars has observed this behavior. What I have had to do, however, is add a udev rule which sets ownership on the devnode so that the browser can access it as an unprivileged user-space application. What would be nice to have from systemd-udevd is a way to write a rule that will detect the presence of WebUSB descriptors (which is a BOS capability descriptor) and set ownership accordingly.<br>
<br>
Bus 002 Device 040: ID 2341:8037 Arduino SA<br>
Device Descriptor:<br>
bLength 18<br>
bDescriptorType 1<br>
bcdUSB 2.10<br>
bDeviceClass 0 (Defined at Interface level)<br>
bDeviceSubClass 0<br>
bDeviceProtocol 0<br>
bMaxPacketSize0 64<br>
idVendor 0x2341 Arduino SA<br>
idProduct 0x8037<br>
bcdDevice 1.00<br>
iManufacturer 1 Arduino LLC<br>
iProduct 2 Arduino Micro<br>
iSerial 3 WUARTR<br>
bNumConfigurations 1<br>
Configuration Descriptor:<br>
bLength 9<br>
bDescriptorType 2<br>
wTotalLength 98<br>
bNumInterfaces 3<br>
bConfigurationValue 1<br>
iConfiguration 0<br>
bmAttributes 0xa0<br>
(Bus Powered)<br>
Remote Wakeup<br>
MaxPower 500mA<br>
Interface Association:<br>
bLength 8<br>
bDescriptorType 11<br>
bFirstInterface 0<br>
bInterfaceCount 2<br>
bFunctionClass 2 Communications<br>
bFunctionSubClass 2 Abstract (modem)<br>
bFunctionProtocol 1 AT-commands (v.25ter)<br>
iFunction 0<br>
Interface Descriptor:<br>
bLength 9<br>
bDescriptorType 4<br>
bInterfaceNumber 0<br>
bAlternateSetting 0<br>
bNumEndpoints 1<br>
bInterfaceClass 2 Communications<br>
bInterfaceSubClass 2 Abstract (modem)<br>
bInterfaceProtocol 0 None<br>
iInterface 0<br>
CDC Header:<br>
bcdCDC 1.10<br>
CDC Call Management:<br>
bmCapabilities 0x01<br>
call management<br>
bDataInterface 1<br>
CDC ACM:<br>
bmCapabilities 0x06<br>
sends break<br>
line coding and serial state<br>
CDC Union:<br>
bMasterInterface 0<br>
bSlaveInterface 1<br>
Endpoint Descriptor:<br>
bLength 7<br>
bDescriptorType 5<br>
bEndpointAddress 0x81 EP 1 IN<br>
bmAttributes 3<br>
Transfer Type Interrupt<br>
Synch Type None<br>
Usage Type Data<br>
wMaxPacketSize 0x0010 1x 16 bytes<br>
bInterval 64<br>
Interface Descriptor:<br>
bLength 9<br>
bDescriptorType 4<br>
bInterfaceNumber 1<br>
bAlternateSetting 0<br>
bNumEndpoints 2<br>
bInterfaceClass 10 CDC Data<br>
bInterfaceSubClass 0 Unused<br>
bInterfaceProtocol 0<br>
iInterface 0<br>
Endpoint Descriptor:<br>
bLength 7<br>
bDescriptorType 5<br>
bEndpointAddress 0x02 EP 2 OUT<br>
bmAttributes 2<br>
Transfer Type Bulk<br>
Synch Type None<br>
Usage Type Data<br>
wMaxPacketSize 0x0040 1x 64 bytes<br>
bInterval 0<br>
Endpoint Descriptor:<br>
bLength 7<br>
bDescriptorType 5<br>
bEndpointAddress 0x83 EP 3 IN<br>
bmAttributes 2<br>
Transfer Type Bulk<br>
Synch Type None<br>
Usage Type Data<br>
wMaxPacketSize 0x0040 1x 64 bytes<br>
bInterval 0<br>
Interface Descriptor:<br>
bLength 9<br>
bDescriptorType 4<br>
bInterfaceNumber 2<br>
bAlternateSetting 0<br>
bNumEndpoints 2<br>
bInterfaceClass 255 Vendor Specific Class<br>
bInterfaceSubClass 0<br>
bInterfaceProtocol 0<br>
iInterface 0<br>
Endpoint Descriptor:<br>
bLength 7<br>
bDescriptorType 5<br>
bEndpointAddress 0x04 EP 4 OUT<br>
bmAttributes 2<br>
Transfer Type Bulk<br>
Synch Type None<br>
Usage Type Data<br>
wMaxPacketSize 0x0040 1x 64 bytes<br>
bInterval 0<br>
Endpoint Descriptor:<br>
bLength 7<br>
bDescriptorType 5<br>
bEndpointAddress 0x85 EP 5 IN<br>
bmAttributes 2<br>
Transfer Type Bulk<br>
Synch Type None<br>
Usage Type Data<br>
wMaxPacketSize 0x0040 1x 64 bytes<br>
bInterval 0<br>
Binary Object Store Descriptor:<br>
bLength 5<br>
bDescriptorType 15<br>
wTotalLength 57<br>
bNumDeviceCaps 2<br>
FIXME: alloc bigger buffer for device capability descriptors<br>
Device Status: 0x0000<br>
(Bus Powered)<br>
<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>