rgerganov / ggtag

programmable e-paper tag with RFID
https://ggtag.io/
GNU General Public License v3.0
297 stars 26 forks source link

USB Programming in Brave & Unchromium: Failed to execute 'open' on device #28

Closed franalbani closed 4 months ago

franalbani commented 4 months ago

Both correctly detect and display the device in the selection window.

I see no errors in the console.

Then this appears:

Unchromium

NetworkError: Failed to execute 'open' on 'SerialPort': Failed to open serial port.

image

Brave

Error: Error setting up device: SecurityError: Failed to execute 'open' on 'USBDevice': Access denied.

image

rgerganov commented 4 months ago

Make sure the browser have permissions to access the device (usually /dev/ttyUSB0). On Ubuntu this can be done with:

sudo adduser $USER dialout
franalbani commented 4 months ago

Thanks for the help!

In Arch Linux, I understand the group is called uucp [1].

I added my user to it (with usermod -aG uucp my_user), opened a new session (with su), checked the new group (with groups) and then launched both browsers from it. The same problem happened :(.

I checked dmesg just in case:

[262958.954825] usb 2-3: new full-speed USB device number 10 using xhci_hcd
[262959.120494] usb 2-3: New USB device found, idVendor=2e8a, idProduct=000a, bcdDevice= 1.00
[262959.120503] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[262959.120506] usb 2-3: Product: ggtag
[262959.120509] usb 2-3: Manufacturer: Eurolan Ltd.
[262959.120512] usb 2-3: SerialNumber: 4150323038323711
[262959.155683] cdc_acm 2-3:1.0: ttyACM0: USB ACM device

[1] https://wiki.archlinux.org/title/Users_and_groups#User_groups

rgerganov commented 4 months ago

Do ls -la /dev/ttyACM0 in the console and check the file permissions. Then try to cat the file. Also make sure that your browser has permissions to access this file

franalbani commented 4 months ago
$ ls -la /dev/ttyACM0
crw-rw---- 1 root uucp 166, 0 Jul  8 09:45 /dev/ttyACM0

cat does not fail but it does not output anything.

I assume the browser can access the file when its launched from a terminal that has the groups updated. Can you suggest a way to check it?

rgerganov commented 4 months ago

Check the user used by the browser by running ps aux and grep for the browser PID

franalbani commented 4 months ago

Both are using the correct user.

franalbani commented 4 months ago

Do you have an updated list of supported browsers?

rgerganov commented 4 months ago

It works with Chrome on Linux, Windows and MacOS. It also works with Edge on Windows.

franalbani commented 4 months ago

After rebooting it worked on Unchromium but not in Brave.

Thanks for the help!