From 2fdd8a420d6e313d6261642c0505126869d017d2 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 21 Jul 2021 12:48:23 -0400 Subject: motion_report: Add support for dumping steps/trapq via API server Signed-off-by: Kevin O'Connor --- docs/API_Server.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'docs/API_Server.md') diff --git a/docs/API_Server.md b/docs/API_Server.md index b8419a8d..77470137 100644 --- a/docs/API_Server.md +++ b/docs/API_Server.md @@ -278,6 +278,49 @@ window" interface. Parsing content from the G-Code terminal output is discouraged. Use the "objects/subscribe" endpoint to obtain updates on Klipper's state. +### motion_report/dump_stepper + +This endpoint is used to subscribe to Klipper's internal stepper +queue_step command stream for a stepper. Obtaining these low-level +motion updates may be useful for diagnostic and debugging +purposes. Using this endpoint may increase Klipper's system load. + +A request may look like: +`{"id": 123, "method":"motion_report/dump_stepper", +"params": {"name": "stepper_x", "response_template": {}}}` +and might return: +`{"id": 123, "result": {"header": ["interval", "count", "add"]}}` +and might later produce asynchronous messages such as: +`{"params": {"first_clock": 179601081, "first_time": 8.98, +"first_position": 0, "last_clock": 219686097, "last_time": 10.984, +"data": [[179601081, 1, 0], [29573, 2, -8685], [16230, 4, -1525], +[10559, 6, -160], [10000, 976, 0], [10000, 1000, 0], [10000, 1000, 0], +[10000, 1000, 0], [9855, 5, 187], [11632, 4, 1534], [20756, 2, 9442]]}}` + +The "header" field in the initial query response is used to describe +the fields found in later "data" responses. + +### motion_report/dump_trapq + +This endpoint is used to subscribe to Klipper's internal "trapezoid +motion queue". Obtaining these low-level motion updates may be useful +for diagnostic and debugging purposes. Using this endpoint may +increase Klipper's system load. + +A request may look like: +`{"id": 123, "method": "motion_report/dump_trapq", "params": +{"name": "toolhead", "response_template":{}}}` +and might return: +`{"id": 1, "result": {"header": ["time", "duration", +"start_velocity", "acceleration", "start_position", "direction"]}}` +and might later produce asynchronous messages such as: +`{"params": {"data": [[4.05, 1.0, 0.0, 0.0, [300.0, 0.0, 0.0], +[0.0, 0.0, 0.0]], [5.054, 0.001, 0.0, 3000.0, [300.0, 0.0, 0.0], +[-1.0, 0.0, 0.0]]]}}` + +The "header" field in the initial query response is used to describe +the fields found in later "data" responses. + ### pause_resume/cancel This endpoint is similar to running the "PRINT_CANCEL" G-Code command. -- cgit v1.2.3-70-g09d2