Anomaly w/ my @execute commands

I have two commands in  extcommands.xml  (one to power on (printeron) and one to power off (idleoff) printer).  Both show up and work in repetier host under printer dropdown.  Somehow i lost my end code script for my printer so I need to redo it but the @execute idleoff or @execute printeron are not working.  I am first trying to test in the g-code area of manual control in host.  Am I doing something wrong here?  it's been a while since I set this up but I know I can run the scrips as user repetierserver via cli on the Pi and they work fine.  Obviously since they work in the dropdown under Printer I know they work for that user but wanted to double check.  

Shouldn't I just be able to type @execute and the command name (defined in the extcommands.xml) in the manual g-code area?  I am able to run other gcode here fine so I have communication.

Here is the contents of extcommands.xml just because I know someone will ask.
                <name>Power on Printer</name>
                <execute>gpio write 8 0</execute>
                <name>Power off Printer</name>
                <execute>gpio write 8 1</execute>
                <confirm>Shut down printer?</confirm>

        <execute name="printeron" allowParams="true">/db/</execute>
        <execute name="idleoff" allowParams="true">/db/</execute>



  • Dropdown and execute are different solutions and I see you are running different command here.

    As it looks you are just setting gpio pin. Meanwhile server has gpio support so if you go to global settings -> GPIO you can add an output pin as Menu entry which also has a command for gcode integration. Advantage is that the button becomes a switch showing state.

    Otherwise use the working gpio command also in execute would be the easiest solution. O maybe you just have not set x flag for your scripts if they are visible for repetierserver.
  • edited August 9
    The script worked fine up until the last version of repetier server, this much I know for sure.  Certainly not faulting anyone/anything just want to figure it out.  

    Ok as a test I used the BCM pin # (2) rather than the GPIO pin (8) and that seemed to work using this new method in in global settings.  With that said, is using an end code in printer settings on Host the best way to do this or is there a way in server?   I do see some event dependent stuff in there but I'm not sure how this are applied.  I tried to set the gcode to run my new working power on command (;@gpio Power on) and connected repetier host but the printer did not come on so i'm sure that isn't how that works.  I also saw a :shutdown printer" command in there which I put in ;@gpio Power off but i'm unsure what must occur for these to even be triggered.  I also put the corresponding commands in the power off/on button commands as replacements for the gcode but unsure if that is even something I should be going.  Reading the manual but not finding out much info on these details.

    Maybe I just need to put these commands in run before/after job?


  • Ok as a test I used the BCM pin # (2) rather than the GPIO pin (8) and that seemed to work.  Over my head but i'll take it.
  • The shutdown script is run when you enable it during print. You see in printe rmenu a button "Shuftdown after print". It can also be run if the idle power off time is reached when activated.

    Power on/off button is not best since it does not allow switching. Better is to set in gpio to make it appear in printer context menu. Then it is a on/off switch automatically also working when the printe ris completely disconnected due to power off (incase usb is not powering cpu).
  • Thanks.  I actually used the event dependent printer settings G-code area in Server to turn on and off the printer which is working great.  Is there a way yet to easily export/import Server/Host settings

  •  Repetier-Server Monitor has a backup/restore feature where you can say what to backup/restore even for free server versions. Only limit we are working on for next server release is restoring zips > 4GB is currently not working. Library can't handle that size but I'm currently replacing it by a new one which can. 
  • I'll have to google what repetier-server monitor is.  Odd think i'm noticing.  First print turned printer on /off using the event depending run before job (;@gpio Power on) and run after job (;@gpio Power off) but now after i go to print it goes right to print job finished.  Looked at G code and it' sgood.  Log jsut shows <span>:smile:</span>

    21:08:27.158 : pos absolute false
    21:08:27.159 : pos relative false
    21:08:27.159 : pos absolute false
    21:08:27.277 : pos absolute true
    21:08:27.277 : pos absolute false
    21:08:27.499 : pos relative true
    21:08:27.499 : pos relative false
    21:08:27.499 : pos absolute true
    21:08:27.499 : pos absolute false
    21:08:27.764 : Successfully send push message.

    Looking in server queue i see it says the correct ETE and computing, then to the right it says printing time 1 second and the job goes away.  If i remove the Run before job line it prints fine and does run the run after job g-code to shut off the printer.
  • edited August 12
    A little update, today w/ both the run before and run after g-codes it just turns the printer on and then right off, not executing any of the print G code.  I feel I am just doing something wrong here but not sure what.  To me, logic dictates the Run before job code should run, the print should run and then the run after job code should run but that clearly isn't happening.  As of right now, I removed the run before gcode and left the run after, it does execute the run after gcode after the job finishes this way at least.  I'm half way there :)

    Perhaps run on connect to run my gcode ";@gpio Power on" would be a better place for it than run before job?  I feel that to be counterintuitive though.  

  • So your board gets powered by pc and you can always communicate?
    One problem might be that printer needs some time until power is available.
    You should add a sleep after power on before going on.
     Did you check console for messages that could cause a print abort? Maybe printer resets on power on? That would stop a print immediately.
  • The printer is powered by a relay board from a GPIO pin on my Pi.  So the pin can always communicate w/ that relay to turn printer on/off.  I will try to add a wait command but last night oddly the run after command didn't even work so I had to manually shut down the printer.  It's been very temperamental.  The GUI buttons always work as does running them via gcode.   I am in the right area to be adding these commands right?  (Run before job and run after job) in repetier server | printer settings | gcode?

    I just went ahead and added the wait command and it worked the first three times after saving .  I will print a few more and report back if i have any other issues.  I wonder if that wait time gives the printer a second to initialize before receiving the gcode.  You'd think it' get some error if gcode wasn't able to be received rather than just a "job finished"

    Thank you again for your support. I have sent you a donation for your time.


  • When board is not powered by pi for communication you could not even start a job, so I think what you switch is main power for motors/heaters. If firmware detects the missing power early (decouple e.g. needs some time) it might have stopped it.
Sign In or Register to comment.