Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter by product name or serial number #81

Open
temka1234 opened this issue Feb 3, 2020 · 14 comments
Open

Filter by product name or serial number #81

temka1234 opened this issue Feb 3, 2020 · 14 comments

Comments

@temka1234
Copy link

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?
@temka1234 temka1234 changed the title How to resolve different devices type with same VID/PID Feb 3, 2020
@neurobe
Copy link

neurobe commented Feb 3, 2020 via email

@reillyeon reillyeon changed the title How to resolve different device types with same VID/PID Feb 3, 2020
@reillyeon
Copy link
Collaborator

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
Copy link

neurobe commented Feb 4, 2020 via email

@reillyeon
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator

@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
Copy link

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

@flatsiedatsie
Copy link

flatsiedatsie commented May 20, 2020

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

@reillyeon
Copy link
Collaborator

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

@flatsiedatsie
Copy link

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
Copy link
Collaborator

@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
Copy link

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

Sharp!

@Gamadril
Copy link

Gamadril commented Sep 7, 2020

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
Copy link

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~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants