Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GPIO access from user space

Featured Replies

Hi

 

Can any one tell me how to access the GPIO from user space, I have tried this:

 

 

sudo echo 203 > /sys/class/gpio/export

 

But get this result :(

 

-bash: /sys/class/gpio/export: Permission denied

 

It's of course some thing really simple, but I haven't been able to find any thing which can lead in the right direction.

 

I have tried adding user account to the /etc/sudoers

 

By inserting this:

 

 

# See sudoers(5) for more information on "#include" directives:

 

#includedir /etc/sudoers.d

 

mabzy ALL=(ALL) NOPASSWD: ALL

 

 

 

 

 

Please compare with http://forum.armbian.com/index.php/topic/1851-rfc-make-armbian-more-iot-friendly/

 

Might be worth a try adding a group gpio, adding your user to this group and putting

chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio

into /etc/rc.local prior to "exit 0". Adding group gpio and a user to it should be possible this way:

sudo su -
addgroup gpio
usermod -aG gpio ${SUDO_USER}

(log out and in afterwards)

  • Author

Thanks it works :) , but is there away to grant user space access so that I can access the gpio's like this from user space:

 

echo 203 > /sys/class/gpio/export

 

 

  • Author

Thanks tkasier  :)

 

Your answer was crossing with my reply to martinayotte 

 

But also thanks to martinayotte 

 

Last one - where can I find UART -> ttyXX mappings ? 

  • Author

Thanks - I was referring to what device the uart0 was assigned to.

On 8/22/2016 at 1:20 PM, tkaiser said:

Please compare with http://forum.armbian.com/index.php/topic/1851-rfc-make-armbian-more-iot-friendly/

 

Might be worth a try adding a group gpio, adding your user to this group and putting


chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio

into /etc/rc.local prior to "exit 0". Adding group gpio and a user to it should be possible this way:


sudo su -
addgroup gpio
usermod -aG gpio ${SUDO_USER}

(log out and in afterwards)

I also had to run:

 

chown -R root:gpio /sys/devices/platform/sunxi-pinctrl/gpio
chmod -R 770 /sys/devices/platform/sunxi-pinctrl/gpio

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.