Can't use WebSerial API

Asked by Simon Therrien

Serial ports are not shown when trying to use the webserial API. The same feature from the same web page works fine with Chrome.

Using a product called esphome dashboard which rely on using the webserial API to push the code to a microcontroller normally a popup screen show up and present a choice of available serial ports to perform the operation. The popup shows-up but the pop-up show there is no available serial device available.

In comparison, "Chrome" which is not a "Snap" application works perfectly fine.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu chromium-browser Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

You probably have to allow the chrome snap accessing the serial port, I guess you need something like
snap connect chromium:serial-port

see also https://snapcraft.io/docs/serial-port-interface and https://snapcraft.io/docs/interface-management

Revision history for this message
Simon Therrien (simont68) said :
#2

Manfred,

I just tryed your suggestion and i got the following result: 'error: snap "chromium" has no plug named "serial-port"'

I looked at the snapcraft.yaml file and the "serial-port" plug is not listed.

I dont know if/how i can modify this file as it is mounted read-only and if my changes would survice an update.

Forgive my ignorance, i am at my very first steps with SNAPs.

I appreciate your suggestions.

Thank-you

Revision history for this message
Best Manfred Hampl (m-hampl) said (last edit ):
#3

I do not know whether modifying the snapcraft.yaml will help (if possible at all).
If the snap version of chromium does not provide the function that you need (serial ports), then you can return to a non-snap version, e.g. Google Chrome from https://www.google.com/chrome/?platform=linux

You should also consider asking at https://forum.snapcraft.io/

Revision history for this message
Simon Therrien (simont68) said :
#4

I will switch to chrome for the moment, as I do not have all the time I wish to go further with this. I still believe this should be added in the snap distribution as the application does react correctly to the call but is not allowed to access the serial port.

Thank you for the assistance
Simon