Home › Forums › TinyG › TinyG Support › Footer Status Code 40
Tagged: status codes
- This topic has 3 replies, 3 voices, and was last updated 11 years, 5 months ago by
jpistorino.
-
AuthorPosts
-
September 30, 2014 at 12:20 am #6791
jpistorino
MemberI am writing a JSON interface to the TinyG in C++.
In the response after trying to send a homing command, I am getting a status code of 40 and the command does not execute. This is not one of the status code documented at: https://github.com/synthetos/TinyG/wiki/TinyG-Status-CodesHere is a little print out form my code (Sent and Received are mine).
Serial Port Opened.
Sent:{“sr”:null}Received:{“r”:{“sr”:{“line”:0,”posx”:0.000,”posy”:0.000,”posz”:0.000,”posa”:0.000,”feed”:0.00,”vel”:0.00,”unit”:1,”coor”:1,”dist”:0,”frmo”:0,”momo”:0,”stat”:1},”f”:[1,0,12,9195]}}
Sent:{“qv”:null}Received:{“r”:{“qv”:0,”f”:[1,0,12,7578]}}
Sent:{“G28.2″:”X0 Y0”}Received:{“r”:{“g28.2″:”x0y0″,”f”:[1,40,18,2000]}}
What is status code 40?
Thanks,
JamesOctober 1, 2014 at 7:17 am #6798chmr
MemberHi,
try {“gc”:”g28.2x0y0″}You seem to be using a rather old firmware version like 380.x, where tinyg.h contained:
#define STAT_UNRECOGNIZED_COMMAND 40 // parser didn't recognize the commandRecent versions respond with status 100, which is:
#define STAT_UNRECOGNIZED_NAME 100 // parser didn't recognize the nameI recommend using the newest version, especially for a developer.
October 1, 2014 at 8:26 am #6800alden
Memberchmr is correct, you should be developing on the edge branch at this point. But that won’t solve your issue. A number of points:
– {“G28.2″:”X0 Y0″} is – indeed – an unrecognized command. Here is the correct way to send a Gcode command in JSON:
https://github.com/synthetos/TinyG/wiki/JSON-Details#gcode-in-json-modeThe command should be {“gc”:”g28.2 x0 y0″} — or some variant. Spaces and cases don’t matter.
– You can also run the JSON in relaxed mode, in which case the command would be {gc:”g28.2 x0 y0″}.
See:
https://github.com/synthetos/TinyG/wiki/TinyG-Configuration-for-Firmware-Version-0.97#js—set-json-syntax– Many UI’s do not wrap the Gcode blocks, but just send them directly. This is OK, too. So this works as well:
g28.2 x0 y0October 1, 2014 at 11:50 am #6805jpistorino
MemberThanks. That got it working.
It is generous to call me a “developer.”
More like a guy that knows enough to be dangerous.I am using the version that came on my TinyG v8 but I will switch over to the edge version.
Thanks again.
-
AuthorPosts
- You must be logged in to reply to this topic.