1

I am implementing a GSM project using the Arduino MKR 1400 GSM board and I would like to achieve the following:

Establish a call to a specific number, wait for a certain amount of seconds and then hag the call. I have written the following test code in order to see how to manage it.

#include <MKRGSM.h>

// PIN Number
#define PINNUMBER ""

GSM gsmAccess;
GSMVoiceCall vcs;

void setup()
{

  Serial.begin(9600); 

  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);
    }
  }

  Serial.println("GSM initialized.");

  if (vcs.voiceCall(char_array_number)) {
    Serial.println("Call established");
    delay(10000);
  } else {
    Serial.println("Something is going wrong");
  }

}

void loop()
{

}

Well, the call is established, the phone rings but the instructions inside the if statement won't get execute. Instead I get the following Serial Monitor output.

enter image description here

I don't really understand why that happens because since the call is stablished the first if statement would be executed. I would really appreciate any help, since this is like the final step of my project and been struggling for some time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.