Issue with Adafruit GPIO python library

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

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

Regards,

Yes, I access as root user.

Regards

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

Regards,

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)

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

Of course, by default the debian user can 'sudo' without a password,
I'd forgotten that. I've turned it off on my BBB.