On 10/11/2020 06:05, Vincent Coen wrote:
Hello RobH!
Tuesday November 10 2020 17:40, you wrote to All:
> I have a python script to run some leds, and I'm having a
problem with
> it! When I ssh into my pi zero, then sudo python3 python
script.py, it
> doesn't run, no leds are lit.
> But if I open a terminal in the pi desktop and run the same
command
> line, it works and the leds light up.
> Anyone know why this happens.
Who owns the script.py and where is it ?
Remember sudo takes root priv. and the directory so try :
sudo python3 /home/pi/script.py or whater the user name is along
with the correct python run command is.
Vincent
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.
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
Hello RobH!
Tuesday November 10 2020 20:08, you wrote to me:
Do a ssh into your Pi.
Then do
pwd
ls -la
Now do
sudo -s
pwd
ls -la
and report what you get
Vince
> On 10/11/2020 06:05, Vincent Coen wrote:
>> Hello RobH!
>>
>> Tuesday November 10 2020 17:40, you wrote to All:
>>
>> > I have a python script to run some leds, and I'm having a
>> problem with
>> > it! When I ssh into my pi zero, then sudo python3 python
>> script.py, it
>> > doesn't run, no leds are lit.
>> > But if I open a terminal in the pi desktop and run the same
>> command
>> > line, it works and the leds light up.
>>
>> > Anyone know why this happens.
>>
>> Who owns the script.py and where is it ?
>>
>>
>> Remember sudo takes root priv. and the directory so try :
>>
>> sudo python3 /home/pi/script.py or whater the user name is along
>> with the correct python run command is.
>>
>>
>> Vincent
>>
> 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.
> 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
Vincent
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 238:00:00 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,878 |