0

I'm hoping to use the newly released WebUSB API to communicate with a device i developed. This devices uses a FT230X USB to serial chip. The drivers of this chip are installed on most devices and communicating with it using minicom works smoothly. Now i want to try communicate with it through the browser. I started by downloading this example for arduino: webusb arduino. I set the filter to { 'vendorId': 0x0403, 'productId': 0x6015 } which shows the device. I'm able to find the device but when i try to connect i get the error: NotFoundError: Device unavailable.

Is there a way to find more specific errors? Should i set up a different interface or do i need to change some other configurations? I'm new to USB drivers so any help getting me on my way would be nice. I did read the (short) getting started documentation here. I use Ubuntu 16.04

Maarten Arits
  • 170
  • 1
  • 9

1 Answers1

2

The FT230X USB to serial chip does not provide an USB interface that Chrome can take control of. This is because, as you mention, the drivers for this chip are available with your operating system. With the serial driver attached Chrome cannot make the device available to your page through the WebUSB API.

The Arduino example programs the Atmel 32u4 chip on many Arduino and Arduino-compatible boards to add an additional USB interface which is not claimed by any system driver and is therefore available to Chrome.

Some developers have also had success either changing the vendor and product ID of their device so that the OS drivers do not claim it or by manually unbinding the driver.

Reilly Grant
  • 5,590
  • 1
  • 13
  • 23
  • That makes sense, the interface does however provide a com port or tty in the operating system. Would it be possible to connect to this, maybe with another API? I just found this github issue about the topic, https://github.com/WICG/webusb/issues/56, a good read for anybody interested. Is there a solution in the pipeline? I have the feeling that it would be a big benefit to a lot of people. Thanks for the response! – Maarten Arits Sep 10 '17 at 21:26
  • some relevant info about changing the vendor or product ID: http://www.ftdichip.com/Support/Documents/AppNotes/AN_124_User_Guide_For_FT_PROG.pdf https://macrofab.com/blog/ft-prog-programming-ft230x/ – Maarten Arits Sep 10 '17 at 21:32
  • There's a similar issue with USB HID devices. The best solution for devices that cannot be modified is a separate API, WebSerial has been proposed but no browser vendor has implemented it. An alternative is for implementations of WebUSB to unpack serial and HID requests and send them to the OS serial or HID driver so that it works no matter what layer the request is made at. As I commented on another issue, I think this is a messy hack: https://github.com/WICG/webusb/issues/29#issuecomment-273364614 – Reilly Grant Sep 10 '17 at 22:45