Smart Home Automation Forum
GSM CALL RELAY - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-A2 (https://www.kincony.com/forum/forumdisplay.php?fid=43)
+--- Thread: GSM CALL RELAY (/showthread.php?tid=3017)



GSM CALL RELAY - Anthonio - 06-24-2023

Hello,

I am having difficulty for coding my script, I would like to make a GSM relay which activates the GPIO 15 relay upon the module receipt a call ! but I cannot do it can you help me?

I think my problem is from the command of call detection.

Thanks


Code:
#include <SoftwareSerial.h>

// Create software serial object to communicate with A6
SoftwareSerial mySerial(13, 34); // A6 Tx & Rx is connected to Arduino #3 & #2

int relayPin = 15; // GPIO 15 connected to the relay

void setup()
{
  // Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
  Serial.begin(115200);
 
  // Begin serial communication with Arduino and A6
  mySerial.begin(115200);

  Serial.println("Initializing...");

  pinMode(relayPin, OUTPUT); // Set the relay pin as an output
  digitalWrite(relayPin, LOW); // Initialize the relay as OFF
}

void loop()
{
  updateSerial();
  checkCall();
}

void updateSerial()
{
  delay(500);
  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
  }
}

void checkCall()
{
  if (mySerial.available())
  {
    String response = mySerial.readString();
    if (response.indexOf("+CLCC: 1,1,2,4,0") != -1) // Check if "+CLCC: 1,1,2,4,0" is present in the response
    {
      activateRelay();
    }
  }
}

void activateRelay()
{
  digitalWrite(relayPin, HIGH); // Turn ON the relay
  delay(5000); // Keep the relay ON for 5 seconds
  digitalWrite(relayPin, LOW); // Turn OFF the relay
}



RE: GSM CALL RELAY - admin - 06-24-2023

next month we will release new firmware KCS V2, will support SIM7600 use by voice call relay ON/OFF


RE: GSM CALL RELAY - Anthonio - 06-24-2023

(06-24-2023, 03:10 AM)admin Wrote: next month we will release new firmware KCS V2, will support SIM7600 use by voice call relay ON/OFF

Thanks for your answer but i need to work with arduino script because i have an other script with 

this for command the relay ! I think i can't use KCS with my arduino script

Can you help me on this code ?


RE: GSM CALL RELAY - admin - 06-24-2023

here have some GSM AT command for SMS function arduino IDE source code, you can check that.


RE: GSM CALL RELAY - Anthonio - 06-25-2023

I have tested all script...
I find my probleme i receive the information by the serial grom gsm serial but i can't send it.

I think it's GPIO problème same the other thread


RE: GSM CALL RELAY - admin - 06-26-2023

check your RXD, TXD pin define, sometimes maybe need exchange.


RE: GSM CALL RELAY - Anthonio - 06-26-2023

In the script or Hardware ?
When i change the define in script i have any information on the monitor i have tested that...


RE: GSM CALL RELAY - admin - 06-26-2023

in arduino IDE config file


RE: GSM CALL RELAY - attilhacks - 09-18-2024

(06-24-2023, 03:10 AM)admin Wrote: next month we will release new firmware KCS V2, will support SIM7600 use by voice call relay ON/OFF

Hello, can you publish the esphome code to answer a call and activate a relay please?
thanks


RE: GSM CALL RELAY - admin - 09-18-2024

do you means, your mobile phone call the board (user phone number), then board relay ON?