Skip to content

Commit

Permalink
Merge pull request #19 from leoleovich/mk4_1
Browse files Browse the repository at this point in the history
[3djuggler] use start as a keyword for mk4
  • Loading branch information
abulimov authored Oct 7, 2024
2 parents 99613b0 + a124a96 commit 45b3b2e
Showing 1 changed file with 4 additions and 5 deletions.
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

0 comments on commit 45b3b2e

Please sign in to comment.