cant sending message arduino connected to the gsm t35

int timetosend=1;
int count=0;
char phone[]="01299949546";
void setup()
{
  Serial.begin(9600);
  delay(2000);
  Serial.println("AT+CMGF=1");
  delay(200);
}
void loop()
{
  while(count<timetosend){
    delay(1500);
    Serial.print("AT+CMGS=\"");
    Serial.print(phone);
    Serial.println("\"");
      while(Serial.read()!='>');
      {
        Serial.print("Test message");
        delay(500);
        Serial.write(0x1A);
        Serial.write(0x0D);
        Serial.write(0x0A);
        
        delay(5000);
      }
      count++;
  }
}

anyone know where line problem this coding.... :fearful:

i can make calling. but cant sending message

LED Tx on arduino on when data at+cmgf and at+cmgs send. but no reply from gsm for ">" to type text message. because LED Rx on arduino OFF

Hi, I need to ask: are you sure the modem is connected to Serial (i.e. TX / RX)?

As far as I can see, though there is room for improvement, your code should be able to send a message. Possible causes why it doesn't:

  1. baud rate: 9600 should be good, but check what is specified as the default for the gms module you are using.
  2. garbage: after Serial.begin() and a delay() you send the AT+CMGF command. Try sending an empty line (println("")) before the command, just to be sure that the modem discards any extra characters pending in its receive buffer and starts from a clean one.
  3. failure of AT+CMGF command. Since you don't check for a response, we cannot exclude that this command fails. A quick and dirty method to check for the response is to loop until you read() a 'K' or a 'R', as you do later when waiting for the '>' character. Then you may switch on an LED to get some visual feedback.
  4. bad phone number. You may try and specify the number using the international format (+<country_code>).

You may also try to send everything in a single line (plus ctrl-z):

Serial.print("AT+CMGS=\"+00phone\"\rMessage Text");
Serial.print(0x1a);

Another possibility is that, because of the different voltage, the gsm TX HIGH is not read as such by the Arduino RX line. This shouldn't happen if the gsm gets its normal voltage, but you may want to check the power source.

i think i connect already correct..

im using gsm modem model TC35. which is GND -GND(arduino), R0 - Rx(arduino), T0-Tx(arduino)

and my adapter is 12V, i plug in to the supply at the GSM board. that need another external supply?

MrRidsect:
im using gsm modem model TC35. which is GND -GND(arduino), R0 - Rx(arduino), T0-Tx(arduino)

Don't you need to cross over the Rx and Tx?

PeterH:

MrRidsect:
im using gsm modem model TC35. which is GND -GND(arduino), R0 - Rx(arduino), T0-Tx(arduino)

Don't you need to cross over the Rx and Tx?

what do u mean??

MrRidsect:

PeterH:

MrRidsect:
im using gsm modem model TC35. which is GND -GND(arduino), R0 - Rx(arduino), T0-Tx(arduino)

Don't you need to cross over the Rx and Tx?

what do u mean??

Transmit of gsm (T0) should go to receive (RX) of arduino; receive of gsm (R0) should go to transmit (TX) of arduino.

When you said that you could make a call, did you mean that you can do it by sending and ATDT command from the Arduino, or what?

Apart from the adapter, which seems to be ok, did you make any of the suggested checks (baud rate, send empty line, checking the modem response, send number in international format)?

spatula:

MrRidsect:

PeterH:

MrRidsect:
im using gsm modem model TC35. which is GND -GND(arduino), R0 - Rx(arduino), T0-Tx(arduino)

Don't you need to cross over the Rx and Tx?

what do u mean??

Transmit of gsm (T0) should go to receive (RX) of arduino; receive of gsm (R0) should go to transmit (TX) of arduino.

When you said that you could make a call, did you mean that you can do it by sending and ATDT command from the Arduino, or what?

Apart from the adapter, which seems to be ok, did you make any of the suggested checks (baud rate, send empty line, checking the modem response, send number in international format)?

i aready try to cross over. but the same result. nothing happen..

yes..i make a call, from arduino command. and its function.

i think the problem is GSM not send back command '>', because the LED Rx on arduino board not blink. like as LED Tx