"!!!" in a string make the Upload to a Mega256 hang(Solved)

Hey every on, I’m just checking if any one else has this problem.

It’s a very simple 2 serial port sketch:

void setup() {
   Serial.begin(9600);
   Serial2.begin(9600);
  
}

void loop() {
  
  boolean currentLineIsBlank=true;
    //while(Serial){
    
    
      if (Serial.available()){
     
         char c=Serial.read();
        Serial2.print(c);
         if((c=='\r')&&currentLineIsBlank) {
          Serial.println("HTTP/1.1 200 OK \r\n\r");
          Serial.println("<html><head><Content-Type: text/html> \r\n\r");
         Serial.println("<meta Connection: close>");  // the connection will be closed after completion of the response
	  Serial.println("<meta Refresh: 5> \r\n\r");  // refresh the page automatically every 5 sec
          Serial.println("<!DOCTYPE HTML></head>");
          Serial.println("<body><center><h1>Allo le monde Je suis le serveur WIFI!!!</h1></center>");
          Serial.println("</body></html> \r");
          Serial.write (0x2B);
         }

  
         if(c=='\n')  {currentLineIsBlank=true;}
         else if(c!='\r'){currentLineIsBlank=false;}
       }
//}
}

The line:

Serial.println("<body><center><h1>Allo le monde Je suis le serveur WIFI!!!</h1></center>");

will make the upload of the sketch hang. But if I remove 1 “!” it’s all ok.

Is it normal? Do I have to be a little less émotif when I write sketch ;), or what???

Any one know?

Also, this does not happen on my UNO, Mini, or Nano.

Apparently it's a known issue. Probably won't be fixed as there is no good reason to ever use !!! as punctuation.

Ok, well since it was just a experimant and it's gonna feed from a SD card the text it will need to send, I don't really care.

But Just to let people know. Well it's ok do not trow your Méga by the windows in rage. It's just normal. :p

If you have a suitable programmer then you can update the bootloader. See here for versions

Thank you Riva :)

At first, I got scared that it was hangging cause it was sending “HTML” coding and since the goal was to hook it to a TLG10UA03, I was all like " what a useless piece of crap" .

But no it’s just the 3x “!” thant make the mega unhappy. I’m so relieved. :slight_smile:

Jimmy60: Apparently it's a known issue. Probably won't be fixed as there is no good reason to ever use !!! as punctuation.

Well it was fixed, in form of a new mega bootloader that was causing the problem.

retrolefty:

Jimmy60: Apparently it's a known issue. Probably won't be fixed as there is no good reason to ever use !!! as punctuation.

Well it was fixed, in form of a new mega bootloader that was causing the problem.

It seems I need to keep up on current events.

Let me go with EZ:

          Serial.print("<body><center><h1>Allo le monde Je suis le serveur WIFI!!");
          Serial.println("!</h1></center>");

For now, and i’ll check for the update, when time will be right

:wink:

Well maybe time is right.

Tel me, is there a step by step procedure documentation on the Arduino web side on how to upload the bootloader? I like to document my self before passing to the action part. And honestly this will be my first time.

Any one has a "How to" url?

I got another question I got this as programer, will it do the work? the picture is below

usbasp.jpg

Frédéric_Plante: I got another question I got this as programer, will it do the work? the picture is below

I think so. I've used a usbasp programmer to bootload mega1280 boards, but I don't own a 2560 mega so best wait for others to comment. If you have UNO board hanging around it can be used as a ISP programmer for the 2560 board.

have a look http://electronics.stackexchange.com/questions/7769/how-to-burn-arduino-mega-2560-bootloader

Yeah, it’s true, i forgot about that sketch.

Ok time to try this. Thank retrolefty

Yeah, ok i'll read that to before doing any thing.

Thank you also nightcrawler218