From f66eafd000536dd05e34ebb9779df928f8614dd9 Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Tue, 24 Jan 2012 19:24:10 +0100 Subject: [PATCH 1/4] fix M114 answer for original reprap host software The host software obviously expects ok and the coordinates to be in the same line and the coordinates separated with spaces. --- Sprinter/Sprinter.pde | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index e3126b8..812c642 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -938,15 +938,15 @@ inline void process_commands() Serial.println(uuid); break; case 114: // M114 - Serial.print("X:"); + Serial.print("ok C: X:"); Serial.print(current_position[0]); - Serial.print("Y:"); + Serial.print(" Y:"); Serial.print(current_position[1]); - Serial.print("Z:"); + Serial.print(" Z:"); Serial.print(current_position[2]); - Serial.print("E:"); + Serial.print(" E:"); Serial.println(current_position[3]); - break; + return; case 119: // M119 #if (X_MIN_PIN > -1) Serial.print("x_min:"); From 32750dc528133300a2fbe0527fae99e5caaae1be Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Fri, 3 Feb 2012 18:53:47 +0100 Subject: [PATCH 2/4] make temperature reporting a comment to work with standard host software --- Sprinter/Sprinter.pde | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 812c642..4f4be42 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -850,7 +850,7 @@ inline void process_commands() #endif if( (millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up/cooling down { - Serial.print("T:"); + Serial.print("// T:"); Serial.println( analog2temp(current_raw) ); codenum = millis(); } From de1ed20b8f4ff5ec32381f9c2f9756c6963edd49 Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Fri, 20 Jan 2012 15:52:05 +0100 Subject: [PATCH 3/4] the 'unknown command' message is a comment According to http://reprap.org/wiki/G-code#Replies_from_the_RepRap_machine_to_the_host_computer replies have to start with one of 'ok', 'rs', '!!', '//'. Actually the current RepRap standard software fails communicating with Sprinter, because it sends 'T0' in the beginning to select a Extruder. --- Sprinter/Sprinter.pde | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index 4f4be42..f12f6ae 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -991,7 +991,8 @@ inline void process_commands() } else{ - Serial.println("Unknown command:"); + Serial.println("// Unknown command:"); + Serial.print("// "); Serial.println(cmdbuffer[bufindr]); } From 2647eedad024e8269f2ea97312818162d76f30d0 Mon Sep 17 00:00:00 2001 From: Joachim Schleicher Date: Fri, 17 Feb 2012 15:56:17 +0100 Subject: [PATCH 4/4] fix indentation use spaces as indentation consistently --- Sprinter/Sprinter.pde | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sprinter/Sprinter.pde b/Sprinter/Sprinter.pde index f12f6ae..3b8352e 100644 --- a/Sprinter/Sprinter.pde +++ b/Sprinter/Sprinter.pde @@ -938,13 +938,13 @@ inline void process_commands() Serial.println(uuid); break; case 114: // M114 - Serial.print("ok C: X:"); + Serial.print("ok C: X:"); Serial.print(current_position[0]); - Serial.print(" Y:"); + Serial.print(" Y:"); Serial.print(current_position[1]); - Serial.print(" Z:"); + Serial.print(" Z:"); Serial.print(current_position[2]); - Serial.print(" E:"); + Serial.print(" E:"); Serial.println(current_position[3]); return; case 119: // M119