Query printer status via webpage URL ???

Hello all,
i want to query the printer status (e.g. idle, printing, status 50%, etc.) via webpage URL to integrate control and status to my home automation system.

With Octoprint i was using the following URL to fetch the required information:

Unfortunately i could not find similar easy solution with Repetier Server to do this.
I also do not really understand from documentation how to format the URL to include API, command, group, ... etc.

Which webpage URL could be used to get basic printer status from Repetier Server assuming following parameters:
IP = 192.168.6.99
slug = Prusa_MK3S
apikey = 1234567-1234-1234-1234-123456789012

Which webpage URL could be used to fetch basic information?
Many thanks for your help.

Christian

Comments


  • http://192.168.6.99:3344/printer/api?apikey=1234567-1234-1234-1234-123456789012&a=listPrinter&data={}

    would give you basic informations. Normally after /api you have /slugname but for listPrinter that is not necessary. See
    https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/websocket/basicCommands?id=list-printer

    for more details and also other possible commands to query. stateList is also interesting if you need more informations. But never forget to url escape the data parameter if it contains data or it will fail.
  • @Repetier ;  Thanks, that helped a lot! Printstatus can be fetched now.

    I have one more function which i would like to add. I would like to start print job via web URL by given GCode name (without group name). Is this possible by similar method as above and how?

    Parameter would be the following:
    IP = 192.168.6.99
    slug = Prusa_MK3S
    apikey = 1234567-1234-1234-1234-123456789012
    gcode = testfile.gcode


  • Possible, but not that way. Every file has an id and you need that. So first fetch gcodes with this:
    https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/websocket/jobs?id=list-g-code-models
    Then copy the file to job list with autostart flag set, so if queue is empty and no print is running it will start print.
    https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/websocket/jobs?id=copy-g-code-model-to-print-list

    Same replacement for a and data apply to all commands in websocket docs.
  • What does autostart flag mean?
    Would it be possible to setup print queue via repetier server webinterface in a way that print of selected file will be automatically started to be printed after next boot-up?

    Then it we be enough to control the power switch in home automation system without the need to additionally trigger the printing of a gcode.
  • To print files must be copied to job queue and then started. So autostart means not just copy the file but also start printing it.
    There is the @autostart_next_job command that starts next file in job queue, but that makes only sense if your printer automatically clears the bed or you get a printer damage due to old printed content still on bed.
  • Maybe it's good to better describe what i would like to do in order to find best solution for repetier server.

    In the evening i want to upload gcode for printing next day in the morning and prepare everything (load filament, clean bed). Next day in the morning the printer will be powered on from home automation system and then i want the print to be automatically started.

    With octoprint i was sending print start command with gcode information via web URL to start printing after power on.
    What could be the best procedure to do the same with repetier server?
  • Assuming the printer is not connected when it has no power (some get powered by usb so it won't work) you could add
    @autostart_next_job 
    to on connection start. Then as soon as printer connects the first job in queue gets started. To be safe you should only add new files when bed is clear.
  • Repetier said:
    Assuming the printer is not connected when it has no power (some get powered by usb so it won't work) you could add
    @autostart_next_job 
    to on connection start. Then as soon as printer connects the first job in queue gets started. To be safe you should only add new files when bed is clear.

    This sounds really interesting.
    But how to add "autostart_next_job"?
    I was searching for this but could not find any informaton how to activate the featue.
    Can you help?

    If it's not user configurable then i would like to raise the feature request to add option allowing to manually activate the feature until next time the first print from queue has been started.
  • Its not a feature like timelapse, which has to be activated or deactivated over the GUI, its a command for interacting with the server over the Console on the webinterface or in a gcode file.
    You can add this command to the "connection start" script (Go to printer settings -> G-Codes -> Event Dependent -> Run on connect)
    There you can simply add "@autostart_next_job"
  • Actually it was the wrong command. The correct command is
    @startNextPrintInQueue

    to just start the next print in queue. You might want to start at the moment until 1.2.1 where the run on connect only gets called once. 1.2.0 also executes it for reset detection so might trigger several times. Maybe no problem as it won't start jobs twice, but in case there are problems that might be the reason.
Sign In or Register to comment.