problema sim 800

ciao a tutti ho fatto questo programma ,
ma ho un problema, quando la variabile presenza va a 1 , fa la chiamata , ma come vedete la chiamata dura oltre il tempo stabilito
come mai

//SIM800L
// tx pin 2
// rx pin 3



// Include the GSM library
#include <GSM.h>
GSM_SMS sms;
boolean allarme = 1;
boolean presenza = 0;

// PIN Number
#define PINNUMBER ""

// initialize the library instance
GSM gsmAccess;
GSMVoiceCall vcs;

// Array to hold the number for the incoming call
char numtel[20];
int rel1 = 4;

void setup() {
  // initialize serial communications and wait for port to open:


  Serial.begin(9600);
  pinMode(10, INPUT_PULLUP);
  pinMode(13, OUTPUT);
  digitalWrite(13, LOW);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.println("Receive Voice Call");

  // connection state
  boolean notConnected = true;

  // Start GSM shield
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while (notConnected) {
    if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
      notConnected = false;
    } else {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  // This makes sure the modem correctly reports incoming events
  vcs.hangCall();

  Serial.println("Waiting for a call");
}

void loop() {
  if (allarme == 1) {
    digitalWrite(13, HIGH);
  }
  else {
    digitalWrite(13, LOW);
  }

  if (digitalRead(10) == LOW) {
presenza = 1;
  }
  
 if ( presenza ==1) {
  Serial.println("chiamo");
 vcs.voiceCall("+390185358719");
  delay(5000);
  Serial.println("fine");
  vcs.hangCall();
  presenza = 0;
  }
 
 
//"ATH\r\n*";
 
 //vcs.hangCall();

  // Check the status of the voice call
  switch (vcs.getvoiceCallStatus()) {
    case IDLE_CALL: // Nothing is happening

      break;

    case RECEIVINGCALL: // Yes! Someone is calling us

      Serial.println("RECEIVING CALL");

      // Retrieve the calling number
      vcs.retrieveCallingNumber(numtel, 20);


      if ((strcmp(numtel, "+390185358719") == 0) || (strcmp(numtel, "+393381231212") == 0)) {
        Serial.println(allarme);
        allarme = !allarme;
        vcs.hangCall(); //serve per far cadere la chiamata
      }

      else
        Serial.println(" => non riconosciuto!");
      vcs.hangCall();
  }

};

ecco la risposta sulla seriale

17:58:31.992 -> Receive Voice Call
17:58:47.063 -> Waiting for a call
17:58:49.738 -> chiamo
17:59:24.763 -> fine

il problema dove e'
grazie del aiuto

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.