I have a problem sending gcode program to biobot printer repetier server from cmd console using commands
from bash script file :
#!/bin/bash
API_KEY="b4b6dbb4-2f1c-4afb-82ba-e7a02f41afb9"
PRINTER_NAME="printer"
GCODE_COMMAND="G1 X10 Y10"
curl -X POST "http://localhost:3344/printer/send" \
-H "Content-Type: application/json" \
-H "apikey: $API_KEY" \
-d "{\"printer\":\"$PRINTER_NAME\", \"data\":\"$GCODE_COMMAND\"}"
I get a message :
"The requested feature requires a user session with adequate permissions."
I had a message on the older version of the repetier server before
"error printer offline or usage error"
Can I ask for help ?
Comments
URL is http://localhost:3344/printer/api/slug_name_of_printer
Websocket command is a=send
Command parameter are in data
See
https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/bridge
for bridged call to commands.
And for sending g-codes:
https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/websocket/control?id=send-a-g-code
You see in data object cmd contains the g-code command.
Note I removed <> from slug and "" from apikey and replaced {} and : with url encoded chars. This worked for me.
For server on same device you can also use unix sockets. Example is much easier to reproduce and needs no apikey.
https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/unixsockets