General Arduino

Using the SIM7600G-H 4G(LTE) Arduino Shield

userHead ALEX.DRYSDALE 2024-12-09 04:43:46 1617 Views1 Replies

As a new user, it would be helpful to have some easy-to-find simple first-step guides to start using this shield with the Arduino UNO.

The Wiki has all the detailed technical answers which is great. But it seems to ignore that the shield is attached to an UNO and the normal way to talk to an UNO is via the Arduino Sketch interface. Or have I missed something obvious?

2024-12-25 00:41:15

Hi, This is all I could find, hope it helps

 

#include <SoftwareSerial.h>

SoftwareSerial SIM7670Serial(17,16); // RX, TX of your arduino/ESP8266/ESP32

void setup() {
 Serial.begin(115200);
 SIM7670Serial.begin(115200);

 sendATCommand("AT", "OK", 1000); // check communication
 sendATCommand("AT+CMGF=1", "OK", 1000); // set SMS format to text
}

void loop() {
 sendSMS("07919316468", "Hello from Arduino!");
 delay(30000);
}

void sendSMS(String number, String message) {
 String cmd = "AT+CMGS=\"" + number + "\"\r\n";
 SIM7670Serial.print(cmd);
 delay(100);
 SIM7670Serial.println(message);
 delay(100);
 SIM7670Serial.write(0x1A); // send ctrl-z
 delay(100);
}

void sendATCommand(String cmd, String expectedResponse, int timeout) {
 SIM7670Serial.println(cmd);
 String response = "";
 long timeStart = millis();
 while (millis() - timeStart < timeout) {
   while (SIM7670Serial.available() > 0) {
     char c = SIM7670Serial.read();
     response += c;
   }
   if (response.indexOf(expectedResponse) != -1) {
     break;
   }
 }
 Serial.println(response);
}
 

userHeadPic Harry.Powney