Webserial - Auto connect to previously connected vendor/product ID device

140 Views Asked by At

I'm attempting to use WebSerial (to control an esp32 light array) on a kiosk device running Chrome, and I'd like to be able to reconnect automatically to a previously used web serial device without user interaction. Calling serial.getPorts() between page loads will reconnect without issue, but doesn't survive browser restarts. Is there any way to have the port survive a browser/device restart? I'm okay if it is browser specific for Chrome as this is a kiosk device. Any hints or help?

1

There are 1 best solutions below

0
On

We found not all devices support persistent connections, we didn't directly find a pattern, it was just trial and error with many devices. We settled on Raspberry Picos as they are available to purchase in larger quantities for under $5 a board. We found they all have the serial number/UID/unicorn magic that allows Chrome to auto-reconnect to them after the initial connection.