Is there a trick/way to wait for G-Code command completion in octoprint rest API?
I'm trying to command the printer (via /api/printer/command) to go to a certain position, then read the position using an external instrument (a DRO - Digital Readout). Trouble is the octoprint command returns before completion and the DRO read happens somewhere in the middle of the move. I could of course wait (a lot! esp for Z) but that would kind of defeat the purpose of the project: to quickly test for any positioning errors.
Here is a log with sequence of commanded position / actual position when that command returned
x:\node octotest 0
{Printer:0.0, DRO:-0.007}
x:\node octotest 0
{Printer:0.0, DRO:-0.007}
x:\node octotest 10
{Printer:10.0, DRO:3.079}
x:\node octotest 10
{Printer:10.0, DRO:9.990}
x:\node octotest 0
{Printer:0.0, DRO:4.834}
x:\node octotest 0
{Printer:0.0, DRO:-0.007}
x:\node octotest 10
{Printer:10.0, DRO:9.150}
x:\node octotest 20
{Printer:20.0, DRO:12.829}
x:\node octotest 20
{Printer:20.0, DRO:19.953}
x:\node octotest 0
{Printer:0.0, DRO:16.424}
x:\node octotest 0
{Printer:0.0, DRO:-0.007}