Footer Status Code 40

Home Forums TinyG TinyG Support Footer Status Code 40

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6791
    jpistorino
    Member

    I 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-Codes

    Here 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,
    James

    #6798
    chmr
    Member

    Hi,
    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 command

    Recent versions respond with status 100, which is:
    #define STAT_UNRECOGNIZED_NAME 100 // parser didn't recognize the name

    I recommend using the newest version, especially for a developer.

    #6800
    alden
    Member

    chmr 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-mode

    The 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 y0

    #6805
    jpistorino
    Member

    Thanks. 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.