Hello I have build a microwave burglar alarm with a Nano and the 7600G gsm module. Is there a way i can check the proper function off the 7600 as it is not responding. The detection part works fine.
I can see on my oscillosscope that data is going from the nanoTX to the 7600 RX pin when a call is made. That's all. On the RX side i see no signal.
Here is my code. PS The many delays are for checking the serial messages
#include <SoftwareSerial.h>
//Create software serial object to communicate with gsm module
SoftwareSerial mySerial(/*rx =*/2, /*tx =*/3); // Define virtual serial port, Rx: 2, Tx: 3
#define trigPin 9
#define sirenePin 7
int input_state = LOW;
void setup() {
pinMode(sirenePin, OUTPUT);
pinMode(trigPin, INPUT);
digitalWrite(sirenePin, LOW);
mySerial.begin(9600); // Initialize virtual serial port
Serial.begin(9600); // Initialize Arduino default serial port
mySerial.println("AT");
Serial.println("serial initialize");
delay(2000);
mySerial.println("AT+IPREX=9600"); // set the sim7600G to 9600 baud also
Serial.println("set 9600 baud");
delay(2000);
}
void loop() {
input_state = digitalRead(trigPin);
if (input_state == 1) {
Serial.println("Alarm");
Make_call();
delay(1000);
} else {
Serial.println("Camionette ok");
}
}
//update Serial function
void updateSerial() {
while (Serial.available()) {
mySerial.write(Serial.read()); //Forward what Serial received to Software Serial Port
}
while (mySerial.available()) {
Serial.write(mySerial.read()); //Forward what Software Serial received to Serial Port
}
}
//on input alert
void Make_call() {
mySerial.println("ATD++32***********"); //
updateSerial();
digitalWrite(sirenePin, HIGH); // sirene AAN
Serial.println("make call");
delay(20000); // wait for 20 seconds...
mySerial.println("ATH"); //hang up
Serial.println("hang up");
updateSerial();
delay(20000); // wait for 20 seconds...
digitalWrite(sirenePin, LOW);
Serial.println("sirene uit");
delay(500);
}