Skip to content
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

[3djuggler] use start as a keyword for mk4 #19

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions gcodefeeder/feeder.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ func (f *Feeder) read(ctx context.Context) {
continue
}
f.status = MMUBusy
} else if strings.Contains(bufStr, "start") || strings.Contains(bufStr, "facebook") {
} else if strings.Contains(bufStr, "start") {
// When serial connection is established:
// Prusa MK3 returns "start"
// Prusa MK4 (Firmware Buddy) returns "facebook"
// Prusa MK4 (Firmware Buddy) returns "start"
// We consider this event as "ready to print"
//
// If the first "start" is given - it says printer is ready
Expand All @@ -176,8 +176,7 @@ func (f *Feeder) read(ctx context.Context) {
seenStart = true
f.printerAck <- true
} else if seenStart && strings.HasSuffix(bufStr, "start") {
// This is most likely a reset button press
// TODO: figure out what happens with mk4
// This is most likely a reset button press on MK3
log.Warning("Feeder: Second 'start' sequence")
return
}
Expand Down Expand Up @@ -230,7 +229,7 @@ func (f *Feeder) Feed() error {
// Flush whatever junk is in write buffer
_, _ = f.writer.Write([]byte("\n"))
// Issue a "firmware buddy" specific command to differentiate between mk3 and mk4
_, _ = f.writer.Write([]byte("M118 facebook\n"))
_, _ = f.writer.Write([]byte("M118 start\n"))
_ = f.writer.Flush()
// Be sure we receive initial reset from printer
<-f.printerAck
Expand Down
Loading