Custom Control Editor and GCODE System Commands - Script

Hello, I am sorry for the delay. I had to deal with something at work.
I worked on all sugestions you gave me. Nothing worked so I deleted every file and restarted again and now it works.

jneilliii -
I corrected the commands:

- command: OCTO801
    confirm: null
    name: OCTO801
    type: command
  - command: OCTO802
    confirm: null
    name: OCTO802
    type: command

and for the python script:
I added #!/usr/bin/env python3
And i keep having problems with pathing and env:
image
That is why chose .sh because I could somehow bypass it and I am not familiar with python and linux. Just want to execute the line that already works from putty. I think I must be doing the basics of python wrong most probably.
So I went back to .sh file and it works.

JCT5978 -

I ran the command you told me:

sudo chmod 777 ./scripts/ledON.sh
sudo chmod 777 ./scripts/ledOFF.sh
sudo chmod 777 ./scripts/ledON.py
sudo chmod 777 ./scripts/ledOFF.py

The error was still happening. After I deleted the file and restarted it worked without those commands. I suppose it is like jneilliii mentioned the user pi stuff.

So for it to work I corrected the custom gcode commands on OctoPrint, deleted the files in the raspberry and copied again to the path I wanted /home/pi/scripts, then I made it executable with sudo chmod +x /home/pi/scripts/ledON.sh and sudo chmod +x /home/pi/scripts/ledOFF.sh.
I went back to Octoprint, doublechecked the path set in the gcode system commands plugin, clicked on the buttons and it worked.
The error Return(GCodeSystemCommands): error did not happen anymore.
Now I have Return(GCodeSystemCommands): ok.

I am not sure why it starting working though. I suspect I had a file ledON.sh and ledON.sh in another folder and it might have gotten conflicted. That is the only change I made. Probably the cause of problem.
Here is the yaml file with everything working:
config.yaml (3.5 KB)

Thanks everyone for the help!

no such file or directory probably just means we have the shabang wrong. might be because pyhon3 is default on the system level already possibly. if the command python works to run, you could adjust the shabang accordingly and to find the right path for it you could use which python.

That \r looks like a carriage return to me!
Damn windows users........

good point. if the file was created on windows machine and copied over it could be encoded wrong. I typically make sure to use Notepad++ with linux line endings in this situation.