API send GCode issue
Hi,
I'm trying to send GCode using the API, everything seems correct to me as im not getting any errors but it just doesn't work.
I'm trying using the demo printer and my real printer:
http://demo.repetier-server.com:4004/printer/api/Cartesian?apikey=7075e377-7472-447a-b77e-86d481995e7b&a=send&data={"M355 S1"}
Is the data properly encoded?
This is what its encoded from:
encodeURIComponent('{"M355 S1"}');
Thanks,
Jungle
I'm trying to send GCode using the API, everything seems correct to me as im not getting any errors but it just doesn't work.
I'm trying using the demo printer and my real printer:
http://demo.repetier-server.com:4004/printer/api/Cartesian?apikey=7075e377-7472-447a-b77e-86d481995e7b&a=send&data={"M355 S1"}
Is the data properly encoded?
This is what its encoded from:
encodeURIComponent('{"M355 S1"}');
Thanks,
Jungle
Comments
send
Parameter: cmd (string) = g-code to execute
Response
Sends a g-code directly to the printer.
Using the direct call to websocket conversion:
Your solution is nearly correct, except data. The json object unencoded would be
{"cmd":"M355 S1"}
encoded
In Parameter description you see the names of the object as well - here "cmd" which you omitted.
Thanks for the quick response.