Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing Serial Ports with an Application Runs in Flatpak

I recently updated my IDE to Monodevelop 6 using Flatpak, on Ubuntu 16.04 LTS, from an older version 5.

I have an application that interacts with serial ports which is basically a USB/RS232 adapter connecting a device to my computer.

I have no issue accessing USB port (/dev/ttyUSB0) when I debug the application in Monodevelop5. However, the device directory (/dev/) that I have access to, using Monodevelop6 is completely different than the one I have access to in Linux, and there is no ttyUSB0 in that folder.

I believe this is because Flatpak runs the application in sandbox. So, if that is the reason, how can I access to a serial port then?

Thanks.

like image 277
Afshin Avatar asked Dec 20 '16 22:12

Afshin


Video Answer


1 Answers

Most likely that's because Flatpak is blocking access to the serial device.

Unfortunately at the moment I don't think there is a way to give access specifically to the serial devices, so you'd need to give access to all:

$ flatpak run --device=all com.xamarin.MonoDevelop

What this does is essentially mount the host's /dev inside the sandbox, so the app has full access to it.

It's a pretty big hole in the sandbox, but sometimes it's needed until all the permission handling stuff gets implemented.

like image 149
Mathieu Bridon Avatar answered Sep 22 '22 03:09

Mathieu Bridon