In our snap pycom-firmware-updater we face a problem. In application itself we use a pyserial library. At some point it scans available devices that are connected to your PC, that’s needed cause we are working with IOT devices. During the scanning this lib try to scan some devices(ttySx) that are not allowed by serial-port interface(found that info in this topic Snapd Interfaces: /dev/tty[0-9]+ Read Write).
Is there a posibility to fix this problem even with some super-privileged interfaces?
During futher debugging we found that the exect problem is not with ttySx devices, but with ttyACM0 device.
The pyserial library try to get info from file which path is /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.5. And couldn’t load any info from it. But when you run the exect same app build but without snap wrapping everything is working fine.
Can someone pls help with this problem.
can you show the exact errors from the snappy-debug tool when running your application or at least he exact output from dmesg or journalctl ?
also, does the user that runs your tool have full access to the device (note that snap interfaces do not change any system permissions, if you need root/sudo to access a device, you also need root when using a snapped app with it)
A installation for the app with sudo will throw the below error
Which maybe we have to check, but I want to say that if we run the app directly without snap (binaries) [that are downloaded during snap installation] the app work fine and the block is happening from snap side.
Do you think sudo is the solution, or we have to add permissions for that?
we don’t want to ask users for sudo priveleges if it’s not the last chance to start the app.
THat’s why we want to deeper understand how to solve different permisions problems we face with our app with snap wrapping
i understand that, i just wanted to know the output, but @ahmad already helped …
first of all try adding the raw-usb plug (and do not forget to connect it), that should allow /sys/devices/pci**/usb[0-9]** r, so it should allow you to read bNumInterfaces if it is user readable (normally the hot-plug connection is enough, but your app seems to additionally poke deep into sysfs to get some extra info)