Hi,
I want to build a call remote for a pre heating.
SMS isn't that good for the use because my friend who will use this doesn't have a SMS flatrate .
So - I'm using a SIM800L v2.0 module and got it working with the fona library.
I can call the remote, it switches on the pre heating and if the status led of the pre heating is on it will return a beep via DTMF. If not it will return three beeps via DTMF.
Now I wanted to filter the callers, so the remote have to pickup only when one number out of a list (inside sketch or sim card, sim card is better) is calling. If the number is invalid it should not pickup.
I tried to get the number with "fona.incomingCallNumber()" but it won't show.
Also there's no +CLIP output on serial monitor when I'm calling - but again, the SIM800L / Arduino recognizing a call and pick up the phone.
The FONA library needs the RING pin but my SIM800L Module doesn't have any. So I soldered a wire to a test pin on the board - see this pic:
After looking on a circuit diagram and follow the pinout with my multimeter it should be the same as the RING pin on the original FONA module - it's directly connected to PIN68 of the SIM800 chip.
I hope it's clear what I want to do and I also hope that someone can help me with this.
I've searched for 5 days and found nothing but SMS sketches.
With the FONA test sketch from github the serial monitor shows the AT+CLIP output and I don't know why my sketch won't.
Here's my working sketch WITHOUT number recognition:
#include "Adafruit_FONA.h"
#define FONA_RX 11
#define FONA_TX 10
#define FONA_RST 12
#define FONA_RI_INTERRUPT 0
// no RING pin on SIM800L V2.0 module but I soldered a cable to a test pin which is on the way to the RING LED.
#define BAUD 9600
int heizung = 7;
int heizung_status = 6;
int led = 13; // just a testing led on my breadboard
#include <SoftwareSerial.h>
SoftwareSerial fonaSS = SoftwareSerial(FONA_TX, FONA_RX);
SoftwareSerial *fonaSerial = &fonaSS;
Adafruit_FONA fona = Adafruit_FONA(FONA_RST);
int callstat;
void setup() {
Serial.begin(9600);
fonaSerial->begin(4800);
if (! fona.begin(*fonaSerial)) {
Serial.println(F("Couldn't find FONA"));
while (1);
}
pinMode(heizung, OUTPUT);
pinMode(heizung_status, INPUT_PULLUP);
pinMode(led, OUTPUT);
}
void loop() {
callstat = fona.getCallStatus();
switch (callstat) {
case 0: Serial.println(F("Bereit.")); break;
case 1: Serial.println(F("Status unbekannt")); break;
case 3: Serial.println(F("Es klingelt")); //Ringing - @forum: Output works!
delay(5000); // 5 seconds delay
fona.pickUp(); // pickup phone - @forum: works!
break; // Case-Ende
case 4: Serial.println(F("Anruf aktiv")); //Anruf angenommen...
delay(2000); // 2 seconds delay
digitalWrite(heizung, HIGH); // set heater switch to high
if (digitalRead(heizung_status)) { // if input 6 is high, beep three times an hangup - high means "not good" @ forum: NPN will pass GND to PIN6 if good.
Serial.println(F("Heizung ist NICHT an!")); // print that the heater is off
digitalWrite(led, HIGH); // just a stauts LED for testing
fona.println("AT+VTS=9"); // send DTMF beep for number 9
delay(800);
fona.println("AT+VTS=0"); // send DTMF beep for number 0
delay(800);
fona.println("AT+VTS=9"); // send DTMF beep for number 9
delay(2000);
digitalWrite(led, LOW); // set status LED to low, even it should be low.
delay(5000);
fona.hangUp(); // as it says, hangup.
}
if (digitalRead(!heizung_status)) { // if input 6 is low, beep just once and hangup.
digitalWrite(led, LOW); // set status led to low, just for testing.
Serial.println(F("Heizung ist AN!")); // print that the heater is on
fona.println("AT+VTS=2"); // send DTMF beep for number 2
delay(1000);
digitalWrite(heizung, LOW); // set heater switch to low
delay(2000);
fona.hangUp(); // as it says, hangup.
}
break;
default: Serial.println(F("Unbekannt"));
}
}