I am pretty sure when the astrobox connects to the printer the first time the printer will reset.
As I recall this happens when I connect from my computer using Repeiter Host too.
Using Repetier firmware this has always been the case for me…it is how I know the system is ready…
Since I seldom use the printer’s on board controls it I had not considered why or how this happens.
(I do sometimes preheat my bed from the printer directly but then a quick reset doesn’t allow the bed to cool much, before I am ready to go and by the time the extruder is hot the bed it back to temp)
My suggestion is to enable an watch the serial log…I use “tail -f” command.
Tricky part is that due to buffering you have to figure out what commands are returning what information
as they do it out of sync.
This buffering I think also accounts for the delay in canceling…I have found that usually it cancels on the first click but it takes awhile…clicking more…not sure it helps but it takes up some time as the buffer depletes.
Maybe watch the buffer count on your printer if you can and see if it starts to go down after the first click…remember some buffered commands can take seconds to complete on the printer.
Upon re-reading I guess you are cancelling the not from astrobox but from the printer hardware interface…I don’t know how to do that on my machine but maybe the same onboard buffer needs to empty or the current code needs to complete before it reports back to the control box that the printer is no longer printing?