System.IO.IOException: Read-only file system

I have Torizon installed on my Toradex module and a.Net project configured in VSCode with the Torizon Visual Studio Code extension installed. I’m using “System.Device.Gpio” (installed from NuGet) to interface with GPIO. When I start debugging or running without debugging I get:

“Unhandled exception. System.IO.IOException: Read-only file system”. This occurs with the following line of code following line of code:
“controller.OpenPin(404, PinMode.Output);” (i’m trying to access GPIO3.IO20)

I also have the following setup in Custom Properties:in Torizon Configurations:
extrapackages - gpiod
buildcommands - RUN usermod -a -G gpio torizon
devpackages - libgpiod-dev:arm64 libgpiod2:arm64

in the devices field - /dev/gpiochip3 ( actually have all gpiochip banks configured)

Any ideas? How can i make the file system “writable” for what i need to do?

Thanks

Greetings @CEK,

I’m not too familiar personally with that .NET function, I assume it’s just accessing the gpio via /dev. Anyways I imagine what’s happening is that you need to give the user in the application container itself permissions to access GPIO.

In short via the Torizon extension configuration pane add the following to the buildcommands property: RUN usermod -a -G gpio torizon. Then rebuild/redeploy your containers after this change.

If you want a short explanation of what this command is and why it’s needed you can read the section of this article here: How to Use GPIO on TorizonCore | Toradex Developer Center

Let me know if this resolves the issue for you.

Best Regards,
Jeremias