This is my code and i don't know what's wrong but it does not do anything. It just prints the ("printlns")
I am trying to send a message from the sim7000 arduino expansion shield to my phone.
#include <DFRobot_SIM7000.h>
#define PIN_TX 7
#define PIN_RX 8
SoftwareSerial mySerial(PIN_RX,PIN_TX);
DFRobot_SIM7000 sim7000;
String destinationNumber = "+xxxxxxx";
void setup() {
Serial.begin(115200);
while(!Serial);
sim7000.begin(mySerial);
Serial.println("Turn ON SIM7000......");
if(sim7000.turnON()){ //Turn ON SIM7000
Serial.println("Turn ON !");
}
Serial.println("Set baud rate......");
while(1){
if(sim7000.setBaudRate(19200)){ //Set SIM7000 baud rate from 115200 to 19200 reduce the baud rate to avoid distortion
Serial.println("Set baud rate:19200");
break;
}else{
Serial.println("Failed to set baud rate");
delay(1000);
}
}
mySerial.begin(19200);
Serial.println("AT+CMGF=1\r");
delay(10000);
Serial.println("AT + CMGS = "" + destinationNumber +""");
delay(10000);
Serial.println("Your message to send" );
Serial.print("\r");
delay(10000);
Serial.print(0x1A);
}
void loop() {
}