Why does this GPIO command fail?

Viewed 2

Why do these GPIO commands not work as expected?

I am trying to export a GPIO using the following command:

sudo echo 4 > /sys/class/gpio/chip0/export

but I get:

-bash: /sys/class/gpio/chip0/export: cannot overwrite existing file

I also tried:

echo 17 | sudo tee export

The command displays:

17

But when I run:

ls

I see:

export  gpio.sh
0 Answers