> I need to see what you are getting back from the end of homing.
When I started to collect data for a response, I found that the bug has to do with zero backoff. Here is a log, with some comments added:
{"xzb":0} // <======= Zero backoff to 0
{"r":{"xzb":0.000},"f":[1,0,10,2510]}
g28.2 x0
{"r":{},"f":[1,0,9,4402]}
{"sr":{"coor":0,"dist":1,"home":0,"cycs":3}}
{"qr":28}
{"qr":27}
{"sr":{"mpox":-2.895,"stat":9,"momo":1,"macs":5,"mots":1}}
{"sr":{"mpox":-8.465,"hold":3,"mots":2}}
{"sr":{"mpox":-9.385,"hold":4}}
{"qr":27}
{"sr":{"mpox":-6.638,"hold":0,"mots":1}}
{"sr":{"mpox":-0.929,"hold":3,"mots":2}}
{"sr":{"mpox":-0.109,"hold":4}}
{"sr":{"mpox":0.000,"stat":3,"coor":2,"momo":4,"dist":0,"home":1,"hold":0,"macs":3,"cycs":0,"mots":0}}
{"qr":28} // <=== Homing ended cleanly with "stat":3 and "all buffers free"
{"xzb":2} // <=== Setting zero backoff to != 0
{"r":{"xzb":2.000},"f":[1,0,10,5205]}
g28.2 x0
{"r":{},"f":[1,0,9,4402]}
{"sr":{"coor":0,"dist":1,"home":0,"cycs":3}}
{"qr":28}
{"qr":27}
{"sr":{"mpox":-2.747,"stat":9,"momo":1,"macs":5,"mots":1}}
{"sr":{"mpox":-8.415,"hold":3,"mots":2}}
{"sr":{"mpox":-9.235,"hold":4}}
{"qr":27}
{"sr":{"mpox":-6.340,"hold":0,"mots":1}}
{"sr":{"mpox":-0.779,"hold":3,"mots":2}}
{"sr":{"mpox":0.041,"hold":4}}
{"qr":27}
{"sr":{"mpox":1.778,"hold":0,"mots":1}}
{"sr":{"mpox":2.041,"stat":3,"macs":3,"mots":0}} <=== and the "stat":3 comes one message early. A bug?
{"qr":28}
{"sr":{"mpox":0.000,"coor":2,"momo":4,"dist":0,"home":1,"cycs":0}}
{"qr":28}
> I also want to see what behavior should occur if a non-drawable line is received.
Another log:
g0 x1
{"r":{},"f":[1,0,6,4399]}
{"sr":{"mpox":0.001,"stat":5,"macs":5,"cycs":1,"mots":1}}
{"qr":27}
{"sr":{"mpox":0.998}}
{"sr":{"mpox":1.000,"stat":3,"macs":3,"cycs":0,"mots":0}}
{"qr":28}
g0 x1
{"r":{},"f":[1,0,5,4398]}
Here, it would be cleaner if there would have been a response {"sr":{"mpox":1.000,"stat":3, ... even though the second g0 x1 is an empty command in real life.
Please note, that the bug (if it is a bug; I have misunderstood things earlier! :) ) or the missing status report are no problems at all. The logic above seems to work by today's experiments, my code works just fine. And now when the behaviour is on the forum, others will not lock their code for waiting for "stat":3 that will never come or have their machine one location message off after homing either. :)