Hello.
I want to make a project using an arduino and SIM900 to send a sms,but doesn't work and I want your help to figure it out,because I do not understand some things.
I asked in arduino forum,but I also ask here.
Code:
What I have tried:
<pre>#include <SoftwareSerial.h>
SoftwareSerial mySerial(8, 7);
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);
Serial.println("Initializing...");
delay(1000);
mySerial.println("AT+CPIN = \"7394\""); updateSerial();
mySerial.println("AT");
updateSerial();
mySerial.println("AT+CMGF=1");
updateSerial();
mySerial.println("AT+CMGS=\"+30XXXXXXXXXX\""); updateSerial();
mySerial.print("Hello world"); updateSerial();
mySerial.write(26);
}
void loop()
{
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read()); }
while(mySerial.available())
{
Serial.write(mySerial.read()); }
}
Output:
Initializing...
AT+CPIN = "7394"
OK
AT
OK
AT+CMGF=1
OK
+CREG: 2
AT+CMGS="+30XXXXXXXXXX" // I don't show phone number right here
> Hello world
So,I don't receive any messages.
Also,I don't understand what is the meaning of +CREG: 2
I searched in google and I found:
2 not registered, but MT is currently searching a new operator to register to
but I don't understand what is the meaning of this.
I use Arduino Uno and here is
sim900[
^]