OctoPrint-GCodeSystemCommands
OctoPrint-GCodeSystemCommands copied to clipboard
Requirement to explicitly call sh to execute shell script : should be in config description
What were you doing?
Wanted to execute code
Iniital error was a 'returned 127' resolved by adding absolute path to the shell script /home/pi/OctoPrint/OCTO100.sh (execution properties set to all) Then got an error 2 resolved by adding sh in the gcode system commands to give sh /home/pi/OctoPrint/OCTO100.sh This then executed successfully.
Version of OctoPrint-GCodeSystemCommands
1.0.1
Operating System running OctoPrint
Raspbian 10 buster Octoprint 1.4.0 Octopi 0.17.0 Python 3.7.3
Printer moprodel & used firmware incl. version
Link to octoprint.log with octoprnt.plugins.gcodesystemcommands set to DEBUG
I'm unable to reproduce this. Need logs.
I'll create them in the morning after 'unfixing :)'
octoprint.log This is the log where I have the path defined, but not explicitly calling the script using sh.
This is what you get with the default creation of the command returned in the terminal. I will withdraw my request about the full path as you have that implicitly referred to in some of the screen shots.
I just added a shell script to run. I did three things:
- I placed the file in a location of my PATH envirronment variable, I used /usr/local/bin
- I made sure the firstline had a shebang line, I used #!/bin/sh
- I made the file executable: chmod +x commandfile
This worked OK, I did NOT have to give it a .sh extension (running octoprint ubuntu server, using dietpi) I did NOT have to add a path to the command I did not need to put /bin/sh in front of the command
Could it be one of these three things I did was forgotten by @edster99 ?
OCTO10 executed the script in /usr/local/bin/light (and switched of the light in my enclosre through homeassistant with nodeRed
So.... I cannot confirm a bug.