Cannot get menu command to work on Raspberry Pi running repetier server 0.86.2
I've added a command to /var/lib/Repetier-Server/database/extcommands.xml, yet it doesn't work from the menu. The bash script I'm calling works fine from the command prompt.
<command>
<name>Switch Printer OFF</name>
<execute>sudo /bin/bash /home/pi/switch_off.sh</execute>
<confirm>Really switch off?</confirm>
</command>
</config>
The server.log file shows that the external command has loaded. The other menu options (reboot / shutdown) work fine.
What am I doing wrong?
Thanks.
The server.log file shows that the external command has loaded. The other menu options (reboot / shutdown) work fine.
What am I doing wrong?
Thanks.
Comments
repetierserver ALL=NOPASSWD: /sbin/shutdown
in /etc/sudoers.d
Did you add /bin/bash as well to that list?
@Repetier .. this inspired a "would be nice to have":
Setup: my Printer, RasPi/Repetierserver and my PC share a power-strip with a "main-switch".
If something's printing and I want to call it a day for me I usually shut down the PC, turn off the lights and leave the rest running.
... time passes ... print's done: to properly shut down the RasPi I've to either power up the PC (and wait...) just to fire up a browser to shutdown repetierserver and power down the PC again afterwards (or faff around with my smartphone which usually isn't at hand).
So, the question is: is there a way to "connect back" from the printer's firmware (got a display with click-wheel here) to repetierserver to issue a "my dear server, please execute /sbin/shutdown"-command back to the RasPi?
All the best for 2018!
PS: opening http://repetier.com/ defaults to the server's apache-default-page right now, I don't think this is what you want.
import energenie
M104 S0 ; turn off temperature
M400
M400
So, at the end of the print the bed homes and executes switch_off.sh script which powers off the printer, followed closely by switching off the Pi.
.. if print on deviceN has completed then
... lift the nozzle, move away the extruder from the print, (wait some time / M400...) and then send "cut the power for deviceN" to <another device>?
cool & THX
PS: being a native german speaker I don't even dare to think about the typo-potential of "energenie" :-D
While the script would be very short it still requires some programming skills, so I consider it non trivial task.
I wonder if it makes sense to add a general purpose answer like
// run_script:Scriptname
that forces server to execute a named script which can contain gcode or @execute commands for shutdown. So it would search for "Scriptname" and if found just inserts that script into gcode to send. Makes it easy to add some more complex things from frimware side without requirement to modify server.
I have same problem.
Script to turn on the printer
I added /bin/bash to sudoers.d
When I run external command nothing happens. Log says Starting external command /var/lib/Repetier-Server/database/turnOnPrinter.sh with 0 parameters. Tried
with same result.