WICG / serial

Serial ports API for the platform.
https://wicg.github.io/serial/
Other
255 stars 48 forks source link

Filter by product name or serial number #81

Open temka1234 opened 4 years ago

temka1234 commented 4 years ago

We produce pager for measuring EKG and sending it via serial over usb (FTDI).
There are cash machines with same connection type in medical offices where our devices are used.
VID and PID are same so there is no way to detect which device in list is our pager.
Same problem with multiple pagers connected to one pc.

neurobe commented 4 years ago

I have same problem and also for medical device. In my case our products have a unique PID, but need the extra info to distinguish between our products. Web USB can do it. I think we are waiting for a few blocks on progress to clear before same can be implemented in Web Serial.

On Mon, Feb 3, 2020 at 9:25 AM Artem notifications@github.com wrote:

We produce pager for measuring EKG and sending it via serial over usb (FTDI). There are cash machines with same connection type in medical offices where our devices are used. VID and PID are same so there is no way to detect which device in list is our pager. Same problem with multiple pagers connected to one pc.

  • Is there any plans to format name of item in browser devices list based on its SerialInfo? Like product name or serial number
  • Can i filter devices list by this fields in future?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WICG/serial/issues/81?email_source=notifications&email_token=AB6MDPDPD5QLTFJYQ4HNXHTRBASNLA5CNFSM4KPGCUUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IKTOWAQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6MDPFVBFOEOZPWJ5UV5LLRBASNLANCNFSM4KPGCUUA .

reillyeon commented 4 years ago

The API can provide the USB product name and serial number strings (if present) and allow sites to filter based on these strings in a call to requestDevice().

neurobe commented 4 years ago

I think the question is as to when we can expect to see that in a release.

On Mon, Feb 3, 2020 at 2:08 PM Reilly Grant notifications@github.com wrote:

The API can provide the USB product name and serial number strings (if present) and allow sites to filter based on these strings in a call to requestDevice().

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/WICG/serial/issues/81?email_source=notifications&email_token=AB6MDPFLCDFHL42WXB2VNNDRBBTTTA5CNFSM4KPGCUUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKVALPY#issuecomment-581567935, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6MDPGCD33FP42XM2H74VTRBBTTTANCNFSM4KPGCUUA .

reillyeon commented 4 years ago

Specifying the behavior here should be straightforward but there are limitations in the current implementation in Chromium which I'm tracking in issue 1048731 which I just filed.

flatsiedatsie commented 4 years ago

Just for the record, I have a similar "issue".

I have one Arduino connected, but it shows up as two ports. This can be confusing to end users, so I'd like to filter it down to one device if possible. Perhaps with a "this substring must be in the port name" deal?

one_arduino_two_ports

reillyeon commented 4 years ago

@flatsiedatsie I've broken off the tty vs. cu issue on macOS as issue 1084285. Your site shouldn't have to deal with this platform-specific quirk.

flatsiedatsie commented 4 years ago

@reillyeon Thanks! And now I also learnt what the difference between CU and TTY is, so thank you twice :-)

flatsiedatsie commented 4 years ago

Another small unrelated comment: hovering over / clicking on the (?) doesn't do anything (Brave Browser, Mac)

reillyeon commented 4 years ago

Thanks for pointing that out. I filed issue 1085149 to remind myself to direct that link to a new help center page.

flatsiedatsie commented 4 years ago

Just another quick note that I saw the same thing on a Raspberry Pi (Raspbian). The single Arduino showed up as two devices. It was a bit different this time though. Where on Mac OS the names were very similar (only ama/tty difference), here the names were much more distinct. Although they still boiled down to the same ama/tty doubling.

reillyeon commented 4 years ago

@flatsiedatsie an issue with this on Raspbian will be completely independent from what you encounter on macOS because serial port enumeration works very differently between the two platforms. Doubling is not expected on Linux unless there are actually two devices present (or a USB device with multiple serial interfaces). From the documentation it appears that a Raspberry Pi has two UARTs which may be connected to the same GPIO pins (it's unclear to me) so this is an expected issue which the browser, without board-specific knowledge, can't avoid.

flatsiedatsie commented 4 years ago

Ah, that must be it! That explains the different names too.

Sharp!

Gamadril commented 4 years ago

I thought about creating a new issue, but I hope it's OK to post it here. I'm testing with Chrome 85 on a Mac. When requesting for ports I can see the list of ports with their names. When a port is selected and paired, I can work with it. But next time I visit the page, I just want to use the paired port without requesting permissions for it again from the user. navigator.serial.getPorts() returns a list of serial ports (each port twice as mentioned above), but without their names. For USB-Serial-devices their are vendorId and productId, which are quite useless, because for a normal user they say nothing. For other serial ports (non-usb) SerialPortInfo is just an empty object. It should at least contain the port name as it's shown in the requestPort dialog so the user can select the right one from the list of already paired ports.

XiFanYin commented 2 years ago

Specifying the behavior here should be straightforward but there are limitations in the current implementation in Chromium which I'm tracking in issue 1048731 which I just filed.

@reillyeon VID and PID are same so。How do I distinguish between different devices?thanks~