Issue with Adafruit GPIO python library

69 views
Skip to first unread message

Jesus Rincon

unread,
Oct 7, 2014, 5:10:38 PM10/7/14
to beagl...@googlegroups.com
When I use this library by SSH works perfectly. Then I write a program and try to run it from Debian desktop and nothing happens. What can be wrong? Is the same program that runs via ssh, and now, it doesn't work on debian desktop terminal

Any help will be appreciated in advance

Regards

Robert Nelson

unread,
Oct 7, 2014, 7:14:46 PM10/7/14
to Beagle Board
On Tue, Oct 7, 2014 at 4:10 PM, Jesus Rincon <jesu...@gmail.com> wrote:
> When I use this library by SSH works perfectly. Then I write a program and
> try to run it from Debian desktop and nothing happens. What can be wrong? Is
> the same program that runs via ssh, and now, it doesn't work on debian
> desktop terminal

When you run it via ssh, are you a "root" user?

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

Jesus Rincon

unread,
Oct 7, 2014, 7:20:58 PM10/7/14
to beagl...@googlegroups.com
Yes, I access as root user. 

Regards


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/48fVl45Wxuw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Nelson

unread,
Oct 7, 2014, 7:21:47 PM10/7/14
to Beagle Board
On Tue, Oct 7, 2014 at 6:20 PM, Jesus Rincon <jesu...@gmail.com> wrote:
> Yes, I access as root user.

Well as "desktop" user you are "debian"...

Jesus Rincon

unread,
Oct 7, 2014, 7:25:07 PM10/7/14
to beagl...@googlegroups.com
oh.. I see. I'm not very good in using linux. Is there anyway to access as root in desktop

c...@isbd.net

unread,
Oct 8, 2014, 4:48:58 AM10/8/14
to beagl...@googlegroups.com
Jesus Rincon <jesu...@gmail.com> wrote:
> 2014-10-07 18:21 GMT-05:00 Robert Nelson <robert...@gmail.com>:
> > On Tue, Oct 7, 2014 at 6:20 PM, Jesus Rincon <jesu...@gmail.com>
> wrote:
> > > Yes, I access as root user.
> >
> > Well as "desktop" user you are "debian"...
> >
>
> oh.. I see. I'm not very good in using linux. Is there anyway to access as
> root in desktop
>
It's not particularly easy, I've been moaning about this for a while,
it should be possible to to basic stuff like this as a non-root user.

I've have a (rather kludgy) workaround.

1 - Edit the sudoers file so that the user you want to be able to run
the Python script that uses the Adafruit IO libraries can 'sudo
/usr/bin/python' without entering a password.

2 - Change the shebang on your Python script to '#!/usr/bin/sudo
/usr/bin/python'.

The user will then switch to root privilege to run the Python
interpreter which runs the script.

It's a nasty kludge and introduces security holes galore but it does
make it possible to pretend that everythng can be done in ordinary
user mode.

(If you need more detail on how to do this I'm happy to provide it but
the sudo/sudoers man page should get you on your way)

--
Chris Green
·

Jesus Rincon

unread,
Oct 8, 2014, 9:13:45 AM10/8/14
to beagl...@googlegroups.com
Well it worked perfectly fine by just writing sudo python program.py

Thanks for all your help. I didn't realise of this before and this was a big problem for my project.

Regards

·

c...@isbd.net

unread,
Oct 8, 2014, 11:18:39 AM10/8/14
to beagl...@googlegroups.com
Jesus Rincon <jesu...@gmail.com> wrote:
> [-- text/plain, encoding quoted-printable, charset: UTF-8, 69 lines --]
>
> Well it worked perfectly fine by just writing sudo python program.py
>
Of course, by default the debian user can 'sudo' without a password,
I'd forgotten that. I've turned it off on my BBB.

--
Chris Green
·

Reply all
Reply to author
Forward
0 new messages