TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ALL
from: DENNIS LEE BIEBER
date: 2020-11-10 15:28:00
subject: Re: Python script run in

On Tue, 10 Nov 2020 20:08:09 +0000, RobH  declaimed the
following:

>I ssh'd into my pi zero, then I created the script with : sudo nano
>script.py then copied some other python script into the new script.py.
>I then ran sudo python3 script.py from within the directory the said
>script is in, which is the Downloads directory.
>Nothing happens, no errors, no leds lit.
>
 My first question is: WHY use "sudo". Isn't the regular user account a
member of a group that has access to GPIO?

pi@rpi3bplus-1:~$ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio
i2c spi

 My second would be: Show us the CODE AND the commands you are
performing... Don't just "say" what you did -- cut&paste directly from the
SSH console into a message.


>If I open a terminal window on the pi desktop and run the exact same
>sudo python3 script.py, it runs and the leds light up

 Again -- show us (cut&paste) the exact command sequence being
performed.

 However...

pi@rpi3bplus-1:~/Downloads$ groups
pi adm dialout cdrom sudo audio video plugdev games users input netdev gpio
i2c spi
pi@rpi3bplus-1:~/Downloads$ sudo groups
root
pi@rpi3bplus-1:~/Downloads$

... the root user (sudo) does NOT appear to have access to GPIO, SPI, I2C,
etc.

 Without seeing the script one can not tell if errors are being
swallowed or just being ignored.


--
 Wulfraed                 Dennis Lee Bieber         AF6VN
 wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.