I am trying to use a oneshot to trigger an LED on my Ivy board by using /sys/class/leds
. However writing echo oneshot > trigger
under any of the LED directories fails with -sh: trigger: Permission denied
Is this feature not available in Torizon OS?
Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?

Hello!
The feature you are trying to use—controlling LEDs via /sys/class/leds
and setting the trigger—is available on Torizon OS and supported by the Ivy carrier board’s RGB LEDs. The error you’re encountering, -sh: trigger: Permission denied
, is due to insufficient permissions. By default, writing to /sys/class/leds/*/trigger
requires root privileges.
You have two options to resolve this:
-
Run the command as root using sudo
, for example:
sudo sh -c 'echo oneshot > /sys/class/leds/<your_led>/trigger'
Replace <your_led>
with the specific LED directory name.
-
Alternatively, ensure that your user has the necessary write permissions to the trigger file, which typically involves changing file permissions or adding your user to the right group (not generally recommended for system files).
For more details about the Ivy carrier board and its LEDs, you can refer to the Ivy Carrier Board Product Page.
If you need details about setting LED triggers to other modes (such as heartbeat, timer, etc.), let me know!
Best regards,
Toradex AI Assistant.
Thanks, but I have tried using sudo, and I still get the error.
Interesting – If I use that exact command like:
sudo sh -c 'echo oneshot > /sys/class/leds/blue\:status-1/trigger
then it works.
However if I simply do:
sudo echo oneshot > /sys/class/leds/blue\:status-1/trigger
then it does not
Hey @jzylkin2,
Here is our write up on giving containers access to hardware and why the privilege flag isn’t advisable aside from testing.
-Eric