GSM module SIM 900 Problem to send SMS (FIXED VERSION)

Hello again.

I tried to modify the caud by changing the baud rate (without the first 0 of my phone number for each), but it still didn't work.

Here's the results I got:

ATComand Baud Rate = 14400

image

ATComand Baud Rate = 19200

image

ATComand Baud Rate = 28800

image

ATComand Baud Rate = 38400

image

ATComand Baud Rate = 57600

image

ATComand Baud Rate = 115200

image

I'm so unlucky :pensive:
I made sure the Netlight LED was blinking each 3 seconds to detect the network, but it's like I receive random results.

Is this new code okay if I remove the first 0 of my phone number by the way ?

Also, I don't understand what these code snippets do to the program:

void SendSMSMessage(const char *number, const char *message)
{
  Serial.println("Sending SMS text");

  if (!SendShortCommand("AT + CMGF = 1")) // Set the SMS output to text mode
  {
    Serial.println("Error in CMGF = 1 (setting to text mode)");
    return;
  }

  if (!SendShortCommand("AT + CMGS = ? ")) // Test for CMGS command support:
  {
    Serial.println("Error in CMGS = ? (testing for CMGS support)");
    return;
  }

  Serial.print("Sending : ");
  Serial.print("AT + CMGS = \"");
  Serial.print(number);
  Serial.println("\"(CR)");
  Serial.print(message); // The SMS text you want to send
  Serial.println("(EM)");

  ATCommandStream.print("AT+CMGS=\"");  // Send SMS
  ATCommandStream.print(number);
  ATCommandStream.print("\"\r"); // NOTE: Command ends with CR, not CRLF
  ATCommandStream.print(message); // The SMS text you want to send
  ATCommandStream.write(26); // ASCII EndMessage (EM) CTRL+Z character

  if (!WaitForResponse())
    Serial.println("ERROR or timeout waiting for response to CMGS command");
}

Why replacing "DestinationNumber" by "number" and "SMSMessage" by "message" ?