Hi, whilst your snap is marked as private it is uploaded to the global snap store and so needs to be treated as a publicly accessible snap (since you could easily mark it as public in the future).
So then looking at your snap - I notice your snap declares a large number of serial-port slots - however application snaps are not allowed to declare this since they don’t actually provide the serial-port at all - instead only gadget snaps can declare a slot of this type.
Instead I suspect you want your snap to be able to interact with whatever serial-ports are connected - in that case you likely want to use serial-port via hotplug - please see Hotplug support in that case.
Otherwise, please provide more details on what your snap is trying to accomplish by slotting serial-port currently and we can try to help you achieve this in a more correct manner.
@radomirpolach what device does this USB-Serial converter show up as on your host system? Also can you confirm that sudo snap get system experimental.hotplug outputs true? When testing this locally with a different USB-Serial converter:
$ lsusb | grep Keyspan
Bus 005 Device 009: ID 06cd:0121 Keyspan USA-19hs serial adapter
It works for me:
$ sudo snap get system experimental.hotplug
true
$ sudo dmesg | grep ttyUSB
[43658.826363] usb 5-2.2: Keyspan 1 port adapter converter now attached to ttyUSB0
$ snap interface serial-port
name: serial-port
summary: allows accessing a specific serial port
slots:
- snapd:keyspanusa-19h (allows accessing a specific serial port)
- :keyspanusa-19h -
what do you see in dmesg when plugging in the USB/serial adapter … it should look similar to the stuff below:
$ sudo dmesg -w
[...]
[268760.901758] audit: type=1420 audit(1654174808.483:1290): subj_apparmor=unconfined
[268868.859996] usb 1-1: new full-speed USB device number 4 using xhci_hcd
[268869.013021] usb 1-1: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 3.00
[268869.013028] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[268869.013030] usb 1-1: Product: USB-Serial Controller
[268869.013033] usb 1-1: Manufacturer: Prolific Technology Inc.
[268869.126420] usbcore: registered new interface driver usbserial_generic
[268869.126461] usbserial: USB Serial support registered for generic
[268869.128788] usbcore: registered new interface driver pl2303
[268869.128827] usbserial: USB Serial support registered for pl2303
[268869.128866] pl2303 1-1:1.0: pl2303 converter detected
[268869.129541] usb 1-1: pl2303 converter now attached to ttyUSB0
[...]
you should then see a slot:
$ snap interface serial-port
name: serial-port
summary: allows accessing a specific serial port
plugs:
- arduino
- esptool
- pcsc-daemon
slots:
- snapd:pl2303serialportmobi (allows accessing a specific serial port)
does the kernel actually detect the device and assign a ttyUSB* port for it in the first step above ?
$ sudo snap get system experimental.hotplug
true
$ sudo dmesg | grep ttyUSB
[ 425.300597] usb 1-4: ch341-uart converter now attached to ttyUSB0
[ 426.010761] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
$ snap interface serial-port
name: serial-port
summary: allows accessing a specific serial port
plugs:
- internethandel-electron-cme
$ snap connections system | grep serial
@radomirpolach ping can you confirm if removing the brltty package is sufficient to get serial-port with hotplug working? If so, we can then look at granting the required snap declaration to allow this to occur automatically when your snap is installed. Thanks.
Along with only supporting USB serial port adapters, hotplug is restricted to devices that provide a specific set of udev attributes; name, vendor identifier and/or serial number.