Hi everybody,
I am using a SIM900A with an Arduino Uno. I would like to send the temperature and humidy values measured by a DHT22 sensor. I am using code found on the Internet at various places.
The card works for some functions and I am for example able to send a warning message if the temperature exceeds a given value.
However when I try to send a String dataMessage with the Temp and Humidity the SMS is not sent.
The string is correct as I can see with a Serial.print(dataMessage) in code..
Hereafter the code (of course in my sketch, +336xxxx is replaced by a valid phone number.
In my code, the function Send_Data() function is supposed to sent the data at a given interval..
void Send_Data()
{
SIM900.println("AT+CMGF=1"); //text mode
SIM900.print("AT+CMGF=1\r");
SIM900.println("AT + CMGS = "+336xxxx"");
delay(100);
// Send the SMS text message
SIM900.print(dataMessage);
delay(100);
// End AT command with a ^Z, ASCII code 26
SIM900.println((char)26);
delay(100);
SIM900.println();
// Give module time to send SMS
delay(5000);
Serial.println("Data Sent");
}
When I execute the code, it seems to be processed with no error. I get the Data Sent message on my terminal.
But the expected SMS is not received..
Could you provide any advice on how to improve the code ?
Thanks for any suggestion..