Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.raspberry-pi > #9184

Re: web server that displays temp, humitdy etc

From Gordon Henderson <gordon+usenet@drogon.net>
Newsgroups comp.sys.raspberry-pi
Subject Re: web server that displays temp, humitdy etc
Date 2015-07-23 17:11 +0000
Organization Drogon Towers
Message-ID <mor77b$s3r$1@dont-email.me> (permalink)
References <ec97baf6-2ca7-4ec3-9b76-8445f2d23d59@googlegroups.com> <DzSrx.4579$577.3084@fx46.am4> <5cfbda24-e587-4d0b-a3a9-fcf0ac7ed5ca@googlegroups.com> <K_Trx.7084$vh6.723@fx12.am4>

Show all headers | View raw


In article <K_Trx.7084$vh6.723@fx12.am4>, mm0fmf  <none@mailinator.com> wrote:
>On 22/07/2015 22:11, Glen_Ossman@ossman-cg.net wrote:
>> can't be done this is why
>>
>> http://www.element14.com/community/thread/19995/l/anyone-know-how-to-access-raspi-gpio-without-sudo?displayFullThread=true

I've not read that thread, but it's very possible to access the GPIO without sudo.

One way is to use a set-uid root program, but that may be considered
cheating and unless you know what you're doing then might fall foul,
however my wiringPi library can be used by set-uid programs then
subsequently relinquish root privs once the /dev/mem device has been
opened. I do this in my RTB BASIC interpreter so it can access the GPIO
and then open/close files as the calling user once it drops root privs.

Another way is to export the GPIO pins required using the sysfs
interface. The export operation needs to be done via a root program
(either via sudo or suid), then your user level program can access them
that way. The down-side is that it's slower. Not a problem for simple
LEDs and buttons though, and again wiringPi provides mechanisms to
let you do this.

The SPI and I2C interfaces can also be accessed directly from user-land,
all that needs to be done is to make sure the /dev/ device names have the
right permissions (and I think they now use the 'gpio' group for this and
the default 'pi' user is in the gpio group, so it should "just work"...

I think there was/is talk of creating a special /dev/gpio device that
only allows mapping of the gpio hardware area - and usable from user-land,
but I've not been keeping up with Pi developments as of late.

Gordon

Back to comp.sys.raspberry-pi | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: web server that displays temp, humitdy etc Glen_Ossman@ossman-cg.net - 2015-07-22 04:33 -0700
  Re: web server that displays temp, humitdy etc Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-22 18:15 +0000
  Re: web server that displays temp, humitdy etc mm0fmf <none@mailinator.com> - 2015-07-22 20:56 +0100
    Re: web server that displays temp, humitdy etc David James <david@tcs01.demon.co.uk> - 2015-07-22 21:01 +0000
    Re: web server that displays temp, humitdy etc Glen_Ossman@ossman-cg.net - 2015-07-22 14:11 -0700
      Re: web server that displays temp, humitdy etc mm0fmf <none@mailinator.com> - 2015-07-22 22:33 +0100
        Re: web server that displays temp, humitdy etc Glen_Ossman@ossman-cg.net - 2015-07-22 15:16 -0700
          Re: web server that displays temp, humitdy etc Martin Gregorie <martin@address-in-sig.invalid> - 2015-07-22 22:51 +0000
        Re: web server that displays temp, humitdy etc Gordon Henderson <gordon+usenet@drogon.net> - 2015-07-23 17:11 +0000

csiph-web