grblHAL / core

grblHAL core code and master Wiki
Other
305 stars 74 forks source link

CMD_STOP doesn't produce any response #448

Closed nickshl closed 2 months ago

nickshl commented 4 months ago

Description for CMD_STOP says:

0x19 (stop) is similar to the legacy 0x18 (reset) but does not perform a warm reset of the controller leaving more internal states intact.

Which sounds useful. However, controller doesn't react in response other that state change from "Run" to "Idle". Any other kind of stop produces alarm(_physical button makes Alarm 10 in my configuration, CMDRESET produces Alarm 3). Also when we feed gcode to the grblHAL, it accept some number of commands responding "ok" each time until it can't accept commands anymore, after which grblHAL will hold "ok" response until it ready. If command CMD_STOP is sent, grblHAL will never respond "ok" to any queued commands(which make sense since those commands is purged). As result there more guess work for sender: if CMD_STOP was send and state changed from "Run" to "Idle", sender should assume that CMD_STOP command is executed and any queued commands was purged. Is it possible to make some explicit response to CMD_STOP command?

terjeio commented 4 months ago

I will send the message [MSG:Stop] if the controller does not end up in some alarm states. This should not break any senders. The alarm state check:

if(!((state_get() == STATE_ALARM) && (sys.alarm == Alarm_LimitsEngaged || sys.alarm == Alarm_HomingRequired))) {
    state_set(hal.control.get_state().safety_door_ajar ? STATE_SAFETY_DOOR : STATE_IDLE);
    grbl.report.feedback_message(Message_Stop);
}
nickshl commented 4 months ago

This should not break any senders

Actually senders already broken. Just tried it with ioSender and looks like it have same issue as my MPG when I streaming g-code from it. When ioSender streaming gcode and I send CMD_STOP from MPG, state in ioSender changes to IDLE, but Cycle start button is grayed out, Feed Hold and Stop buttons is active and it looks like it still "running" program. I suspect ioSender wait "ok" response but will never get it since program is stopped and command queue is purged:

image

nickshl commented 4 months ago

@terjeio , by the way... I want to send you something. But I need your address. I found one at your website(in oldstuff section), but I don't think it is complete. GitHub doesn't allow private messages and sharing address publicly is not an option. How can I contact you?

terjeio commented 4 months ago

Actually senders already broken.

By broken I mean crashing or misbehaving in unpredictable ways. I will add handling of the stop message to ioSender - but give me a bit of time...

How can I contact you?

Look at the old stuff again.

nickshl commented 4 months ago

Look at the old stuff again.

Sounds about right. I found this address before somewhere associated with Io Engineering. This is your package: IMG_20240223_104859904~3 You can track it on USPS website and probably on Norway post website too at some point.

If I understand correctly, you shouldn't pay any taxes or fees because we both private individuals and value is less than 1000 NOK(I declared $60 which probably is about right for components cost).

Have fun! 🙂 You can find my phone number on the package - text me in case of any questions.

terjeio commented 4 months ago

The due for VAT limit in Norway has been changed to 0... But sometimes they let it through without charges.

Anyway, I just uploaded new edge versions of ioSender that should handle the Stop message.

nickshl commented 4 months ago

The due for VAT limit in Norway has been changed to 0... But sometimes they let it through without charges.

On this Posten page there a link to Norwegian customs "More about gifts sent from abroad" and it says:

You may receive a gift shipment free from duties and taxes provided the value is NOK 1 000 or less and provided the shipment is sent from a private individual residing abroad to you as a private individual in Norway.

Hopefully they will charge nothing to you 🙂

nickshl commented 4 months ago

@terjeio why do you have such small mailbox? 😄

nickshl commented 4 months ago

Hi @terjeio , according tracking your package is waiting for pick up. By the way, I found "bug" on Posten website: it uses browser local time(not a Norwegian time) for busy graph.

terjeio commented 4 months ago

Ok, I'll pick it up tomorrow when I go shopping.

terjeio commented 4 months ago

Thanks, a nice pendant you have made. I'll try it out with my mill.