GSM CALL - SMS ANSWER

Hello my friends

sorry for my bad endgish.
I am from Grecce and i am new to Arduino world.
I want to call arduino (sim800l) and arduino answers via SMS.
here is the code i have made so far.

#include <SoftwareSerial.h>
 #include <Adafruit_Sensor.h>
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
#define SIM800_TX_PIN 8
#define SIM800_RX_PIN 7
  float h = dht.readHumidity();
   float t = dht.readTemperature();
SoftwareSerial serialSIM800(SIM800_TX_PIN,SIM800_RX_PIN);
int incomingByte;
void setup() {
  Serial.begin(9600);
  while(!Serial);
   dht.begin();
  serialSIM800.begin(9600);
  delay(1000);
    float h = dht.readHumidity();
   float t = dht.readTemperature();
    Serial.print("Humidity: ");
    Serial.print(h);
    Serial.print(" %");
    Serial.print("Temperature: ");
    Serial.print(t);
    Serial.println(" *C");
  Serial.println("Setup Complete!");
 delay(1000);

}
 
 void loop() {
  if(serialSIM800.available()){
    Serial.write(serialSIM800.read());
    delay(5000);
  }{
  if (Serial.available()>0)
   incomingByte = Serial.read();
   if (incomingByte == 'RING');
    {
      Serial.println("Start SMS sequense...");
     serialSIM800.write("AT+CMGF=1\r\n");
  delay(1000);
  serialSIM800.write("AT+CMGS=\"+306985123172\"\r\n");
  delay(100);
   serialSIM800.print("Humidity: ");
    serialSIM800.print(h);
    serialSIM800.print(" %");
    serialSIM800.println();
    serialSIM800.print("Temperature: ");
    serialSIM800.print(t);
    serialSIM800.print(" C");
    serialSIM800.println();
    serialSIM800.print("Weight: ");
  delay(1000);
     serialSIM800.write((char)26);
  delay(1000);  
  Serial.println("SMS Sent!");
    }
  }}

i dont were is the problem.
thans for your time
:slight_smile:

i dont were is the problem.
thans for your time
:slight_smile:

Well what exactly is the problem?
What do you expect that isn't happening?

Also please when you're in the IDE press CTRL + T and edit your code.

I want to

  1. call the SIM800 module from my cellphone
    2.the arduino must detect my call byt not answer.
  2. After the detection of my call must send me back the values of sensor dht11 via SMS.
  3. after arduino send SMS must wait my phonecall again.

The problem is that i dont know how to detect incoming call, how to make the if sequense and the loop sequense.

I want to

  1. call the SIM800 module from my cellphone

That's not something we can help you with.

2.the arduino must detect my call byt not answer.

OK.

  1. After the detection of my call must send me back the values of sensor dht11 via SMS.

Have you read the sensor? Have you written any code to send the data in an SMS?

  1. after arduino send SMS must wait my phonecall again.

That's what loop() is all about.

It would probably be simpler if you programmed the Arduino to accept a text message, and reply to that.

thank you PaulS for your answer.

I will try to arduino accept a text message, and reply to that.
Ihope to have good news soon!!