Send gCode file to printer server
Hi,
I have a gCode as a file and I needed to upload it using the API and send to printer thus it will print, can I achieve this? can you guide me how to do this?
I have a gCode as a file and I needed to upload it using the API and send to printer thus it will print, can I achieve this? can you guide me how to do this?
Comments
https://www.repetier-server.com/using-simplify-3d-repetier-server/
it shows how to do this with curl, but same can work with any other solution.
https://www.repetier-server.com/manuals/programming/API/index.html
For your problem be aware that we have gcode storage and a print queue. Only files in print queue can get printed. If there are multiple files in the queue you need to tell which one to start. You can also store gcode first and tell server to copy from model storage to job queue. That way you have a backup if a print fails or needs to be printed again. As you see in the api you can query these queues and work on them.
HTTP/1.1 200 OK
is a success message at least regarding query and you also got a {} response.
If it is a success is easily visible in server - is the file there or not?
For these questions there is no proper API documentation and instructions, please advice
Command "listModels" returns you stored models so you see names and id.
Command "copyModel" can copy one of these models to print queue and start it automatically if queue was empty.
Command "listJobs" shows currentyl stored prints queued for printing.
Command "startJob" will start explicitly one job with given id from listJobs.
You see all commands are described in API. Also stop, send command, list status, ...
listPrinter
Parameter: None
Response
Lists all configured printer with their state.
If job is "none" printer is not printing. If a job is running you get extra informations per printer:
and regarding old uploaded gcode files, how long they exist? That means will they disappear after a job is printed or after they are sent to queue?
but length is not really a problem if you do not want to store 10000th of gcodes. Normally you need them many times then you but them in a proper group or you delete them when not required any more. There is no real need for most gcodes to be stored indefinitively.
what would be the URL format to be given? GET or POST?
If job does not autostart you must start it explicitly with the id - this allows also printing out of order. Order is just how they landed in queue in case a company wants a fifo order.
"printed" is irrelevant for job. It is in model the count how often it was printed.
"state" is one of : "uploading", "stored", "running", "finsihed" (will become finished with next update),"error"
url format is always retrievied the same way by applying the websocket object to the data parameter as json string and url encoded.
This variable is available in listJob and listModel, how can we interpret the state of the variable in each context?