Retryed now like this:
$ sudo snap set system experimental.hotplug=true
$ sudo systemctl restart snapd
$ snap interface serial-port
name: serial-port
summary: allows accessing a specific serial port
plugs:
- test
slots:
- pi:bt-serial
- snapd:pl2303serialport (allows accessing a specific serial port) <- it appears
I also have a udev rule:
$ cat /etc/udev/rules.d/icse012a.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", ACTION=="add", RUN+="/home/user/icse012a-init"
The devices appeared as snapd:pl2303serialport and it responded ( i heard the relay work ).
Created snap for armfh on lxc: test.snap on RPi3 B+ as explained here: https://ograblog.wordpress.com/2020/07/10/building-snap-packages-on-ubuntu-core/
Then:
snap install --dangerous ./test.snap
Now the eletron app in the snap test is displayed with the browser console enabled, and with the error:
Error: Command failed: echo '50' | xxd -r p >>/dev/ttyUSB0
/bin/sh: 1: cannot create /dev/ttyUSB0: permission denied.
Then:
$ snap connections test
Interface Plug Slot Notes
browser-support test:browser-support :browser-support -
hardware-observe test:hardware-observe - -
home test:home - -
network test:network :network -
network-bind test:network-bind :network-bind -
opengl test:opengl :opengl -
pulseaudio test:pulseaudio - -
raw-usb test:raw-usb - -
serial-port test:serial-port - -
wayland test:wayland mir-kiosk:wayland -
$ snap connect test:serial-port snapd:pl2303serialport
$ snap connections test
Interface Plug Slot Notes
browser-support test:browser-support :browser-support -
hardware-observe test:hardware-observe - -
home test:home - -
network test:network :network -
network-bind test:network-bind :network-bind -
opengl test:opengl :opengl -
pulseaudio test:pulseaudio - -
raw-usb test:raw-usb - -
serial-port test:serial-port :pl2303serialport manual
wayland test:wayland mir-kiosk:wayland -
$ snap restart test
Restarted.
The electron app opens with the same error as before: permission denied.
Any thoughts?
EDIT:
In this version i removed the slot for serial-port interface from snapcraft.yaml !!!