Skip to content

Commit

Permalink
Added newlines to serial writes in heating service
Browse files Browse the repository at this point in the history
  • Loading branch information
alufers committed May 30, 2019
1 parent 82671ae commit 732d51a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/heating_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ func (hs *HeatingService) communicateWithPrinter() {
hs.app.PrinterService.WaitForSerialReady()
if hs.autoreportingAttempts < 5 {
time.Sleep(4 * time.Second)
hs.app.PrinterService.consoleWriteSem <- "M155 S1"
hs.app.PrinterService.consoleWriteSem <- "M155 S1\r\n"
hs.autoreportingAttempts++

} else {
log.Printf("Failed to recieve temeprature report using auto-reporting %d times. Reverting to polling", hs.autoreportingAttempts)
for {
hs.app.PrinterService.consoleWriteSem <- "M105"
hs.app.PrinterService.consoleWriteSem <- "M105\r\n"
time.Sleep(time.Second)
}
}
Expand Down

0 comments on commit 732d51a

Please sign in to comment.