Find out what coordinate system you're in
-
Hi I was using the work offset Gcodes G54 and G55, I was wondering is there some sort of JSON response that you can query the machine to find out what coordinate system you're in. Like if it is in G55 it'll tell me as opposed to being in the G54 coordinate system.
-
Firmware V2 or V3?
-
Both, I'm transitioning into V3 right now.
-
Got it. Request is slightly different.
V2:
http://192.168.7.100/rr_status?type=1
{"status":"I","coords":{"axesHomed":[0,0,0],"wpl":2,"xyz":[0.000,0.000,616.577],"machine":[0.000,0.000,616.577],"extr":[107768.0]},"speeds":{"requested":0.0,"top":0.0},"currentTool":0,"params":{"atxPower":0,"fanPercent":[0,100,0,0,0,0,0,0,0],"speedFactor":130.0,"extrFactors":[100.0],"babystep":0.000},"seq":492,"sensors":{"probeValue":0,"fanRPM":0},"temps":{"bed":{"current":21.7,"active":0.0,"standby":0.0,"state":2,"heater":0},"current":[21.7,18.9,2000.0,2000.0,2000.0,2000.0,2000.0,2000.0],"state":[2,2,0,0,0,0,0,0],"tools":{"active":[[0.0]],"standby":[[0.0]]},"extra":[{"name":"*MCU","temp":34.3}]},"time":64681.0}
Where 1 = G54, 2 = G55, etc.
V3:
I cannot find anything at the moment. The query URL is:
http://192.168.7.101/machine/status
And that contains some likely suspects, but switching the machine to G54, 55, etc, seems to change nothing in the json response.
-
In V3 firmware:
31/03/2020, 19:02:36 M409 k"move.workspaceNumber" {"key":"move.workspaceNumber","flags":"","result":1}
You can get the same JSON response from this HTTP GET request: rr_model?key=move.workspaceNumber
-
@dc42 I understand that the documentation is still in progress. Is there a place where I can view all of the current keys for things such as workspaceNumber. It currently isn't in the documentation, hoping it may be somewhere else so I can view all possible options I have with M409 or rr_model
-
Until the documentation is complete, here are two suggestions.
Suggestion 1: use M409 to enumerate all kayes.
- Send M409 F"v". That will return a list of the root keys in "result".
- For each root key, send M409 K"xxx" F"v" where xx is the key. That will return the whole subtree in "result". Paste it into https://codebeautify.org/jsonviewer to make it easier to navigate.
Ask about any keys that you find in the response that you need further information about.
Note, some keys are only present when the printer is in a certain state, for example printing from SD card.
Suggestion 2: get the information fro the DSF documentation.
- Go to https://github.com/chrishamm/DuetSoftwareFramework and clone it to your machine
- Navigate to and open docs/index.html in that tree
- Follow the link to DuetAPI, then expand DuetAPI.Machine, then click on MachineModel. You will find all the keys listed under Properties. A few of them (e.g. HttpEndpoints and UserSessions) exist in DSF only, not in RRF.