Hello!
I just can´t get it work?
The modem works fine, I tested it with teraterm and it sends sms to my phone with command AT+CMGS=.......But with arduino it doesn´t do anything with this code below?
I connected only 3 pins from the modem to arduino, TX to 2, RX to 3, GND to GND, should I do something to rs232 wiring or what is the problem?
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.println("AT");
delay(2000);
mySerial.println("AT+CMGF=1\r");
delay(1000);
mySerial.println("AT+CMGS="+358xxxxxxxxx"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("TESTMESSAGE"\r");// The SMS text you want to send
delay(1000);
mySerial.println((char)26);// ASCII code of CTRL+Z
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}