[fpc-pascal] Access GPIO pins on RPi2 without root?

Marc Santhoff M.Santhoff at web.de
Fri Oct 9 10:51:06 CEST 2015

On Fr, 2015-10-09 at 09:50 +0200, Bo Berglund wrote:
> On Thu, 08 Oct 2015 22:01:49 +0000, Mark Morgan Lloyd
> <markMLl.fpc-pascal at telemetry.co.uk> wrote:

> >> I will try to locate an updated pigpio.pas file by asking in the
> >> Lazarus forum instead.
> >
> >I would strongly suggest going through /sys/class/gpio first, since you 
> >can exercise it using  echo  and there are fewer things to get wrong.
> I have seen you mention "echo" a number of times and I have gone back
> (in the Gmane gmane.comp.compilers.free-pascal.general news archive in
> my newsreader) to locate the exact method for this but I failed.
> And I am a total noob in this low level handling of Linux...
> I will continue searching for your echo examples after I return home
> again.

A starting point for understanding and finding additional information
about udev is there:


Another issue of interest would be basic user management. I suggest
going to the documentation pages of the distro you use and reading some
basic administration docs.

Short pre-info:

Each user on your RPi can be member of multiple groups. This is managed
in the file /etc/group.

Group membership is for giving rights regarding software and hardware
access to users. E.g. by making a user a member of the group
"dialer" (or similar) this user is allowed to use modems attached to the
computer. Each file and directory has an owner and a set of flags for
managing access allowance. Try "man chown" and "man chmod" on the pi's
console window. And since hardware devices are made usable via device
nodes, which are files in the /dev hierarchie, anything is a file in
Linux/Unix and this rights management work for anything.

To map hardware access rights to groups, udev is used. Udev is
instructed to do this by rules. I assume RPi has those udev rules built
in, because the special gpio hardware has to be managed somehow.

Marc Santhoff <M.Santhoff at web.de>

More information about the fpc-pascal mailing list