Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GSM CALL RELAY
#1
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
}
Reply
#2
next month we will release new firmware KCS V2, will support SIM7600 use by voice call relay ON/OFF
Reply
#3
(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 ?
Reply
#4
here have some GSM AT command for SMS function arduino IDE source code, you can check that.
Reply
#5
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
Reply
#6
check your RXD, TXD pin define, sometimes maybe need exchange.
Reply
#7
In the script or Hardware ?
When i change the define in script i have any information on the monitor i have tested that...
Reply
#8
in arduino IDE config file
Reply
#9
(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
Reply
#10
do you means, your mobile phone call the board (user phone number), then board relay ON?
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)