Going MAD with Repetier Server

Help save my sanity please,
Have spent days trawling the web and nothing seems to work.
I am a user that tinkers with Linux.
I have the server running nicely (10 times better than on a PI3) using Linux Mint on an Up Board.
i want to do an external call to turn off the printer, and send an email.
I have a Python script that toggles a gpio pin then calls a .sh script for email, runs like a charm if i run it as my own login name. 
when i run it from server nothing??
both my user and repetierserver are set as no password for sudo commands.
 when i run them from a terminal if i use 
 "sudo -u repetierserver python /home/martin/pythonfiles/TurnOff.py"
i get 

Traceback (most recent call last):
  File "/home/martin/pythonfiles/TurnOff.py", line 9, in <module>
    GPIO.setup(24, GPIO.OUT)
RuntimeError: Unable to export GPIO.  Try running as root!

if i run 
"sudo -u martin python /home/martin/pythonfiles/TurnOff.py" 
it works.

so after all my ranting,
is repetierserver the correct login name for the server?
Have i got it all wrong and should be doing it a different way?
Should i just forget it and go insane?

Regards
Martin

Comments

  • forgot to say repetier server pro 0.86.2 
  • Sounds more like a problem with script/python then server :-)
    Scripts are started as same user repetier server is running, which is normally repetierserver.
    From the error I guess it is a permission error to change the gpio pin state as it says to run as root. If that works you could start script with sudo, but to nor forget to use absolute path to executables.
  • yes i spelt repetierserver wrong in my visudo file, too many e's

    thanks for the response.
Sign In or Register to comment.