{"action":"opened","issue":{"url":"https://api.github.com/repos/arduino/Arduino/issues/3184","labels_url":"https://api.github.com/repos/arduino/Arduino/issues/3184/labels{/name}","comments_url":"https://api.github.com/repos/arduino/Arduino/issues/3184/comments","events_url":"https://api.github.com/repos/arduino/Arduino/issues/3184/events","html_url":"https://github.com/arduino/Arduino/issues/3184","id":77839451,"number":3184,"title":"Serial.println behaviour change between IDE 1.0.5 and 1.6.4","user":{"login":"MJP007","id":12503791,"avatar_url":"https://avatars.githubusercontent.com/u/12503791?v=3","gravatar_id":"","url":"https://api.github.com/users/MJP007","html_url":"https://github.com/MJP007","followers_url":"https://api.github.com/users/MJP007/followers","following_url":"https://api.github.com/users/MJP007/following{/other_user}","gists_url":"https://api.github.com/users/MJP007/gists{/gist_id}","starred_url":"https://api.github.com/users/MJP007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MJP007/subscriptions","organizations_url":"https://api.github.com/users/MJP007/orgs","repos_url":"https://api.github.com/users/MJP007/repos","events_url":"https://api.github.com/users/MJP007/events{/privacy}","received_events_url":"https://api.github.com/users/MJP007/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-18T23:02:17Z","updated_at":"2015-05-18T23:02:17Z","closed_at":null,"body":"I have a sketch used to test serial comms between XBee modules.  In IDE 1.0.5 it works fine, in 1.6.4 it appears to be writing out extra characters.\r\n\r\nThe 1.0.5 behaviour (correct) is\r\nSend using TeraTerm\r\n^1234$\r\nReply\r\n^X---$\r\nThe 1.6.4 behaviour (wrong) is\r\nSend using TeraTerm\r\n^1234$\r\nReply\r\n^X---$ Bad Length \r\n\r\nThe text \"Bad Length\" is part of an error message that appears in the code but has not been sent as part of the reply. \r\n\r\nThe sketch is below.  Please advise.  Thanks\r\n\r\n/*\r\n Test TX RX buffering with sleep.\r\n Does sleep stop the RX buffer working\r\n */\r\nint led_pin = 13;\r\nint RXBuffSize = 5;\r\nchar IncomingBytes[7];\r\nchar IncomingByte;\r\nchar OutgoingBytes[6]= {\r\n  '^','X','-','-','-','$'};\r\n\r\n\r\n#define VERSION \"1.00a0\"\r\n\r\nvoid setup() {\r\n\r\n  Serial.begin(9600);\r\n}\r\nvoid loop() {\r\n  byte CharsRead;\r\n  if (Serial.available() > 0 ) {\r\n    //read buffer untill cr is hit\r\n    delay(10); //Give the trailing bytes time to arrive\r\n    memset(IncomingBytes,0,sizeof(IncomingBytes)); //Fill memory with zeroes\r\n    CharsRead = Serial.readBytesUntil('\\n', IncomingBytes, sizeof(IncomingBytes));\r\n    if (CharsRead != sizeof(IncomingBytes)) {\r\n      Serial.print (CharsRead,DEC);\r\n      Serial.println (\" Bad Length\");\r\n    }\r\n    else if (IncomingBytes[6] != 13) { // same as \\n\r\n      Serial.print (IncomingBytes[6],DEC);\r\n      Serial.println (\" Missing CR\");\r\n    }\r\n    else if (IncomingBytes[0] != '^') {\r\n      Serial.print (IncomingBytes[0]);\r\n      Serial.println (\" Bad First Char\");\r\n    }\r\n    else if (IncomingBytes[5] != '$') { // same as \\n\r\n      Serial.print (IncomingBytes[6],DEC);\r\n      Serial.println (\" Bad Last Char\");\r\n    }\r\n    else  {\r\n      Serial.println (OutgoingBytes);\r\n    }\r\n  }\r\n\r\n  while (Serial.available() > 0 )\r\n  {\r\n    IncomingByte = Serial.read();\r\n    Serial.print(\"#\");\r\n  }\r\n  Serial.println(\"ControlText\");\r\n  delay(10000); // prevents overwhelming the serial port\r\n\r\n}  \r\n"}}