Marlin Host Action Commands

In the newer Marlin versions they have some host action commands that can send a command to the host to start the next print job in queue (and a few others). They seem to be working in octoprint, any thoughts on if these would/could work with repetier-server? I tested them but it seems the functionality is not yet there for repetier-server.

Comments

  • Where are they documented? In
    https://reprap.org/wiki/G-code#Action_commands
    I see no mention of them. 

    Would be easy to add since we alraedy have server commands doing that. In fact you can add it to reposnse parser to do so already, but if they have them build in i'd like to make them generally work.
  • They do have them built in but it is a bit hard to find info about them. It looks like they just send the message:

    //action:<command>

    back to the server. There are a list of commands here:







  • Most of them are implemented. cancel to stop running job already is implemented. What was missing is "start" action to start next job in queue which is fairly new. Not sur eif it makes too much sense to blindly start a job you can not see which it is, but will be added in 1.4.3.

  • Awesome, it will make sense to me to use it since I have another bit of code I wrote to handle my queues and I am not running repetier-server monitor in the printer room. Thanks!
  • I have been testing these and they are working well. Marlin has the M118 command that will send back custom commands to the host. Is it possible to add your own action behavior to repetier? I was looking for a 'restart' action that would restart the last print in case the print failed or had some other problem.
  • You can add listener to firmware output and trigger any g-code with or withsout server commands that you like. So anything we don't know can still be captured that way. On the otehr side if you send M118 to trigger thsi you could execute function also directly, so not sure why tell server with M118 to send something it then detects, except it is part of gcode being sliced to mark points for some actions.
  • Sorry but I am not sure I understand. The idea would be to use the menu on Marlin to send 'M118 A1 action:restart' to the repetier-server to restart the most recent print. Is this possible?
  • Ok using marlin menu as source makes more sense:-)

    Yes, you can use that solution to trigger actions just add a expression that detects it in printer config and run the action.

    Only most recent print is currently not possible. Guess I should add a server command for this, now that we have recent prints. What you can do is start first g-code in print queue. Especially if you stopped it, it will normally still be there for printing.
  • I see, well then I will be looking forward to it :)
  • edited September 13
    I am trying to add the same thing here now in klipper as I did for marlin. Does the start action work with klipper? It looks like it doesn't do anything. here is my menu item, the console shows that it is getting action:start but it does nothing.

    [menu __main __startnextjob]
    type: command
    enable: {not printer.idle_timeout.state == "Printing"}
    name: Start Printing
    gcode:
        {action_respond_info('action:start')}


    I also tried running a macro that just runs the @autostart_next_job command but it also does not star the printer and just gives an error: // Unknown command:"AUTOSTART_NEXT_JOB"

  • klipper.xml firmware description does not include the action:start action. Have added it for next release, until then manully add
    <response type="startNextPrint">//\s*action:start\b</response>
    and restart server. File is in installDir/firmware on linux this is /usr/local/Repetier-Server/firmware
  • Thanks I have updated the file and I see the action in my console show up as "// action:start" but it still does not start. Is there a particular place in the file I should be putting the line?


  • You must fulfill all conditions this also starts a print:
    1. No printjob running
    2. There must be one more file in print queue.

    Did you restart server to make the line effective? Any position among the response entries would work.
  • Yes all of those conditions are satisfied. Here is a snippet from my /usr/local/Repetier-Server/firmware/Klipper.xml file:

        <response type="continuePause">//\s*RequestContinue:</response>
        <response type="stopPrint">//\s*RequestStop:</response>
        <response type="startNextPrint">//\s*action:start\b</response>
        <response type="requestPause" string="true">//\s*action:pause\b(.*)</response>
        <response type="continuePause">//\s*action:resume\b</response>

    And here is how my button is defined:
    [menu __main __startnextjob]
    type: command
    enable: {not printer.idle_timeout.state == "Printing"}
    name: Start Next Job
    gcode:
        {action_respond_info('action:start')}

    The rpi has been reset since the changes were made and I do see the "// action:start" appear in the console but nothing happens when it appears even though I do have a print job in the queue. Anything I did wrong here or am missing?



  • Hi @Repetier I just wanted to check in again on this to see if I missed anything.
    Thanks
  • I have the question open for testing but my debug version is currently in development and I need to finish some programming first to test it.
  • I noticed some of the action commands had string="true" in the xml response so I added it like below and now it works.

    <response type="startNextPrint" string="true">//\s*action:start\b</response>
  • Thanks for the info. Should work also without since we do not use the returned value. So maybe it triggers an exception when converting result also there is no group at all to contain a value. Will investigate and report.
Sign In or Register to comment.