I am trying to interface 4g LTE SIM A7670C development board to Arduino Uno to send and SMS and initiate a call. I could not find right interfacing diagram as well as Arduino code to do this. Can someone please guide me through this or provide a right link to achieve this.
Whatever I am finding is for SIM 7600 only and not this module. Thanks for your help.
I am having below code to send SMS through 4g LTE SIM A7670C which is connected to Arduino Uno.
#include <SoftwareSerial.h>
SoftwareSerial SIM7670Serial(2, 3); // RX, TX
void setup() {
Serial.begin(9600);
SIM7670Serial.begin(115200);
sendATCommand("AT", "OK", 1000); // check communication
sendATCommand("AT+CMGF=1", "OK", 1000); // set SMS format to text
}
void loop() {
sendSMS("+91XXXXXXXXX", "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);
}
SIM is of JIO. I am not able to recieve SMS on desired number. Also I can only see some Junk Square characters on the Serial monitor. Can anyone provide solution to this.?
it means your arduino "speaks" to your 4g LTE SIM A7670C module at 115200 bauds. This is the default baud rate for your module but SoftwareSerial does not behave very well at that speed.
I think the module offers support for automatic recognition baud rate (check the doc, may be some configuration is needed), so might be worth setting that at 9600 bauds
Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting can result in a suspension from the forum.
In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.
add a call to reserve just after you instantiate the local String. that will help mitigate some of the challenge with using the String class with a growing container