Skip to content

Improvement: Set system status to started when print timer started (M75) #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nivekmai
Copy link
Contributor

Add an event to be sent to systemservice when a job is marked as started with M75.

Motivation: Currently, when a print is started from octoprint (or anything not the HMI), the SystemService.cur_status_ is not updated. This then causes us to not handle filament runout, since there's a conditional check that the status must be SYSTAT_WORK: https://github.com/Snapmaker/Snapmaker2-Controller/blob/main/Marlin/src/feature/runout.h#L100

Additionally, M75 and M77 are currently "unsupported". I'm assuming that this is just that they are not actually upgraded to work with Snapmaker's cusotmiztions.

We can use M75 and M77 to update the system service status so that runout detection is activated when a print job is "started".

This diff will add the necessary SystemService calls to make sure that SystemService status is set to SYSTAT_WORK when a job is in progress (after M75) and back to SYSTAT_IDLE when the job finishes.

By itself, this will have no influence on the operation of the machine, since luban and the HMI do not ever use M75 or M77. However, in combination with some configuration in octoprint, this diff enables the ability for runout detection to be triggered when printing via octoprint.

Add an event to be sent to `systemservice` when a job is marked as started with M75.

Motivation: Currently, when a print is started from octoprint (or anything not the HMI), the `SystemService.cur_status_` is not updated. This then causes us to not handle filament runout, since there's a conditional check that the status must be `SYSTAT_WORK`: https://github.com/Snapmaker/Snapmaker2-Controller/blob/main/Marlin/src/feature/runout.h#L100

Additionally, M75 and M77 are currently "unsupported". I'm assuming that this is just that they are not actually upgraded to work with Snapmaker's cusotmiztions.

We can use M75 and M77 to update the system service status so that runout detection is activated when a print job is "started".

This diff will add the necessary `SystemService` calls to make sure that `SystemService` status is set to `SYSTAT_WORK` when a job is in progress (after M75) and back to `SYSTAT_IDLE` when the job finishes.

By itself, this will have no influence on the operation of the machine, since luban and the HMI do not ever use M75 or M77. However, in combination with some configuration in octoprint, this diff enables the ability for runout detection to be triggered when printing via octoprint.
@huang-w-y
Copy link
Contributor

Thank you for your contribution. We will carefully review and consider them for inclusion in the next iteration.

@nivekmai nivekmai mentioned this pull request Jan 19, 2025
@johnwc
Copy link

johnwc commented Jan 19, 2025

@huang-w-y what is the time frame for reviewing this PR? This is a needed item for some that are not using luban.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants