A6 A7 gateway (GSM GPRS) (#195)

* init 2G gateway with SMS sending and receiving

* A6lib add

* add 2Ggateway call from setup and loop

* add schematic and image
This commit is contained in:
Florian authored and GitHub committed 2018-04-21 19:22:36 +02:00
1 parent 0412461d66
commit 513d71c544
18 files changed
+1382

No files matched your search

+44
View File
@@ -0,0 +1,44 @@
#include <A6lib.h>
#ifndef ESP8266
#define D0 0
#define D5 8
#define D6 7
#endif
// Instantiate the library with TxPin, RxPin.
A6lib A6l(D6, D5);
void setup() {
Serial.begin(115200);
delay(1000);
// Power-cycle the module to reset it.
A6l.powerCycle(D0);
A6l.blockUntilReady(9600);
}
void loop() {
Serial.println("Checking call status...");
callInfo cinfo = A6l.checkCallStatus();
Serial.println("Call status checked.");
int sigStrength = A6l.getSignalStrength();
Serial.print("Signal strength percentage: ");
Serial.println(sigStrength);
delay(5000);
if (cinfo.number != NULL) {
if (cinfo.direction == DIR_INCOMING && cinfo.number == "919999999999") {
A6l.answer();
} else {
A6l.hangUp();
}
delay(1000);
} else {
Serial.println("No number yet.");
delay(1000);
}
}