dannable:
Ok, it's a bit difficult to work out from the photo so I'm assuming pin 19 (Rx1) to modem TXD, pin 18 (Tx1) to RXD?
The following works for me:
unsigned char buffer[64]; // buffer array for data receive over serial port
int count=0; // counter for buffer array
void setup()
{
// set up the digital pins to control
Serial.begin(19200);
Serial.println("Hello Computer");
String outMessage = "Hello world!";
String destinationNumber = "+447751123456"; // in te vullen....
// wake up the GSM shield
Serial1.begin(19200);
delay(30000); // give time to log on to network.
if (Serial1)
{
Serial.println("Serial 1 is open");
}
else
{
Serial.println("Serial 1 isn't open");
}
if (Serial1.available())
{
Serial.println("Serial 1 available");
}
else
{
Serial.println("Serial 1 NOT available");
}
while (Serial1)
{
buffer[count++]=Serial1.read();
if(count == 64)break;
}
Serial.write(buffer,count);
Serial1.print("AT+CMGF=1\r");
delay(100);
Serial1.println("AT + CMGS = "" + destinationNumber +""");
delay(100);
Serial1.println(outMessage);
delay(100);
Serial1.println((char)26);//ctrl+z
delay(100);
Serial.println("The End!");
}
void loop()
{
}
dannable:
Ok, it's a bit difficult to work out from the photo so I'm assuming pin 19 (Rx1) to modem TXD, pin 18 (Tx1) to RXD?
The following works for me:
unsigned char buffer[64]; // buffer array for data receive over serial port
int count=0; // counter for buffer array
void setup()
{
// set up the digital pins to control
Serial.begin(19200);
Serial.println("Hello Computer");
String outMessage = "Hello world!";
String destinationNumber = "+447751123456"; // in te vullen....
// wake up the GSM shield
Serial1.begin(19200);
delay(30000); // give time to log on to network.
if (Serial1)
{
Serial.println("Serial 1 is open");
}
else
{
Serial.println("Serial 1 isn't open");
}
if (Serial1.available())
{
Serial.println("Serial 1 available");
}
else
{
Serial.println("Serial 1 NOT available");
}
while (Serial1)
{
buffer[count++]=Serial1.read();
if(count == 64)break;
}
Serial.write(buffer,count);
Serial1.print("AT+CMGF=1\r");
delay(100);
Serial1.println("AT + CMGS = "" + destinationNumber +""");
delay(100);
Serial1.println(outMessage);
delay(100);
Serial1.println((char)26);//ctrl+z
delay(100);
Serial.println("The End!");
}
void loop()
{
}
Hi dannable,
How to solve if the serial1 is not available.