I need help my project take so many erorr pls say me What am I doing wrong? :)

</>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266HTTPClient.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
#include <Keypad.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <SoftwareSerial.h>

LiquidCrystal_I2C lcd(0x27,16,2); // Arduino İçin Adres:0x27

const char* ssid = "Beleşwifi"; //WIFI BILGILERI
const char* password = "1122335"; //WIFI SIFRESİ

// LOCALDEKİ BİLGİSAYARIN IPV4 IP ADRESİ
const char *host = "http://ipadresim/projekilit";

int sure = 1000;
const byte SatirSayisi = 4; // 4 satırlı
const byte SutunSayisi = 3; // 3 sütunlu
char tuslar[SatirSayisi][SutunSayisi] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
byte SatirPinleri[SatirSayisi] = {8, 7, 6, 5}; //Satırların bağlanacağı pinler
byte SutunPinleri[SutunSayisi] = {4, 3, 2}; //Sütunların bağlanacağı pinler
Keypad TusTakimi = Keypad( makeKeymap(tuslar), SatirPinleri, SutunPinleri, SatirSayisi, SutunSayisi );

String Sifre = "XXXX";
String Username = "";
String KayitId = "";
String KeypadSifre = "";
int YesilLed= 9;
int KirmiziLed= 12;
void setup() {
delay(500);
delay(500);
Serial.begin(115200);
delay(500);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.println("");
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(250);
}
Serial.println("");
Serial.print("Successfully connected to : ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.println();
}
HTTPClient http;
WiFiClient client1;
lcd.begin();
delay(500);
pinMode(YesilLed,OUTPUT);
pinMode(KirmiziLed,OUTPUT);
digitalWrite(YesilLed,0);
digitalWrite(KirmiziLed,0);
Serial.begin(9600);
delay(500);
yeniSerialPort.begin(9600);
delay(500);
Serial.println("Arduino Başlatıldı.");
void loop() {
String Link, Data, GercekVeri;
Data = String("veri");
Serial.println("---------------- test.php -----------------");
String planlanan = "/test.php";
Link = host + planlanan;
http.begin(client1, Link.c_str());
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
int cevap = http.POST(Data);
String veri = http.getString();
Serial.println("Gelen Cevap:" + String(cevap));
Serial.println("Gelen Veri:" + String(veri));
delay(1000);
http.end();
Serial.println("---------------- test.php -----------------");
delay(sure);
Serial.println("---------------- PlanlananKontrol.php -----------------");
planlanan = "/PlanlananKontrol.php";
Link = host + planlanan;
http.begin(client1, Link.c_str());
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
cevap = http.POST(Data);
veri = http.getString();
Serial.println("Gelen Cevap:" + String(cevap));
Serial.println("Gelen Veri:" + String(veri));
delay(1000);
http.end();
Serial.println("---------------- PlanlananKontrol.php -----------------");
delay(sure);

Serial.println("---------------- AktifKontrol.php -----------------");
String aktif = "/AktifKontrol.php";
Link = host + aktif;
http.begin(client1, Link.c_str());
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
cevap = http.POST(Data);
veri = http.getString();
Serial.println("Gelen Cevap:" + String(cevap));
Serial.println("Gelen Veri:" + String(veri));
delay(1000);
http.end();
Serial.println("---------------- AktifKontrol.php -----------------");
delay(sure);

Serial.println("---------------- NodemcuVeri.php -----------------");
String nodemcu = "/NodemcuVeri.php";
Link = host + nodemcu;
http.begin(client1, Link.c_str());
http.addHeader("Content-Type", "application/x-www-form-urlencoded");
cevap = http.POST(Data);
veri = http.getString();
Serial.println("Gelen Cevap:" + String(cevap));
Serial.println("Gelen Veri:" + String(veri));
delay(1000);
http.end();
GercekVeri = veri;
Serial.println("Gerçek Veri:" + String(GercekVeri));
Serial.println("---------------- NodemcuVeri.php -----------------");
// GercekVeri = "username:0000;34#"
String gonderilecekVeri;
if (GercekVeri.length() > 1) {
int x1 = veri.indexOf(":");
int x2 = veri.indexOf(";");
int x3 = veri.indexOf("#");
String Username = veri.substring(0, x1);
String Sifre = veri.substring(x1 + 1, x2);
String KayitId = veri.substring(x2 + 1, x3);
Serial.println("Username:" + Username);
Serial.println("Şifre:" + Sifre);
Serial.println("KayitID:" + KayitId);
gonderilecekVeri = "Y" + Username + ":" + Sifre + ";" + KayitId + "#";
//"Yusername:0000;34#"
}
else {
gonderilecekVeri = "X";
}

Serial.println("Arduinoya Gönderilen Veri:");
char tus = TusTakimi.getKey();
if(tus != NO_KEY){
if(KeypadSifre.length()<4){
KeypadSifre += tus;
Serial.println("SİFRE:"+KeypadSifre);
}
}
if(KeypadSifre.length()<4){
LCD.setCursor(0,0);
LCD.print(" SIFRE GIRINIZ! ");
LCD.setCursor(0,1);
LCD.print(" SIFRE:"+KeypadSifre+" ");
}
if(KeypadSifre.length()==4){
Serial.println("SİFRE:"+KeypadSifre);
if(KeypadSifre==Sifre){
Serial.println("SİFRE DOGRU");
Serial.println("LUTFEN BEKLEYIN.");

  LCD.clear();
  LCD.setCursor(0,0);
  LCD.print("   SIFRE DOGRU  ");
  LCD.setCursor(0,1);
  LCD.print("LUTFEN BEKLEYIN.");
  digitalWrite(YesilLed,1);
  delay(3000);
  //    Ahmet      5  11/2 5;
  // Yunus Emre 10 3;
  int bosluk = (16-Username.length())/2;
  LCD.clear();
  LCD.setCursor(bosluk,0);
  LCD.print(Username);
  Serial.println(Username);
  delay(1000);
  
  delay(4000);
  digitalWrite(YesilLed,0);
  KeypadSifre = "";
}
else{
  Serial.println("SİFRE YANLIS");
  Serial.println("LUTFEN BEKLEYIN.");
  LCD.clear();
  LCD.setCursor(0,0);
  LCD.print("  SIFRE YANLIS! ");
  LCD.setCursor(0,1);
  LCD.print("LUTFEN BEKLEYIN.");
  for(int i=0;i<3;i++){
    digitalWrite(KirmiziLed,1);
    delay(1000);
    digitalWrite(KirmiziLed,0);
    delay(1000);
  }
  KeypadSifre = "";
}

}
if (yeniSerialPort.available()) { //Veri geldiyse
String veri = gonderilecekVeri();
Serial.println("Veri Geldi:"+veri);
if(veri.length()>0){
if(veri[0]=='X'){
Sifre = "XXXX";
KayitId = "";
Username = "";
}
else if(veri[0]=='Y'){
int x1 = veri.indexOf(":");
int x2 = veri.indexOf(";");
int x3 = veri.indexOf("#");
Username = veri.substring(1, x1);
Sifre = veri.substring(x1 + 1, x2);
KayitId = veri.substring(x2 + 1, x3);
}
}
Serial.println("Username:"+Username);
Serial.println("KayitId:"+KayitId);
Serial.println("Güncel Sifre:"+Sifre);
}
Serial.println("----------------BAĞLANTI KAPATILIYOR----------------");
delay(100000);
Serial.println();

for (byte i = 10; i > 0; i--) {
delay(1000);
Serial.println("LÜTFEN " + String(i) + " SN BEKLEYİNİZ.");
}
}
'

Your topic was MOVED to its current forum category as it is more suitable than the original

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

yeniSerialPort.begin(9600);

One of the errors will be here
Where is yeniSerialPort defined ?

Other errors will be anywhere in the code that tries to use the LCD object. Where is LCD defined ? I see an object named lcd but that is not the same

okey delete yeniSerialPort.begin(9600); this but how can defined to lcd can you help ?

LiquidCrystal_I2C lcd(0x27,16,2); // Arduino İçin Adres:0x27

You seem to have lcd defined
What you don't have defined is LCD

Make the name of the object consistent throughout the code

Sorry, that's not my eror. me right now 'LCD' does not name a type take this
I fixed the error you said but that's not the problem

I am not sure what you are trying to say. Which error have you fixed ?

Please post your code as it is now and the full error message copied from the IDE using the "Copy error message" button. Use code tags when you post them

Here is a version that compiles for me. I didn't know which pins you wanted to use for SoftwareSerial so I just picked two.

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266HTTPClient.h>
#include <SoftwareSerial.h>
#include <Keypad.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>

LiquidCrystal_I2C lcd(0x27, 16, 2); // Arduino İçin Adres:0x27

const char* ssid = "Beleşwifi"; //WIFI BILGILERI
const char* password = "1122335"; //WIFI SIFRESİ

// LOCALDEKİ BİLGİSAYARIN IPV4 IP ADRESİ
const char *host = "http://ipadresim/projekilit";

int sure = 1000;
const byte SatirSayisi = 4; // 4 satırlı
const byte SutunSayisi = 3; // 3 sütunlu
char tuslar[SatirSayisi][SutunSayisi] =
{
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};
byte SatirPinleri[SatirSayisi] = {8, 7, 6, 5}; //Satırların bağlanacağı pinler
byte SutunPinleri[SutunSayisi] = {4, 3, 2}; //Sütunların bağlanacağı pinler
Keypad TusTakimi = Keypad( makeKeymap(tuslar), SatirPinleri, SutunPinleri, SatirSayisi, SutunSayisi );

String Sifre = "XXXX";
String Username = "";
String KayitId = "";
String KeypadSifre = "";
int YesilLed = 9;
int KirmiziLed = 12;

SoftwareSerial yeniSerialPort(9, 10);

void setup()
{
  delay(500);
  delay(500);
  Serial.begin(115200);
  delay(500);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.println("");
  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    Serial.print(".");
    delay(250);
  }
  Serial.println("");
  Serial.print("Successfully connected to : ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  Serial.println();

  lcd.begin(16, 2);
  delay(500);
  pinMode(YesilLed, OUTPUT);
  pinMode(KirmiziLed, OUTPUT);
  digitalWrite(YesilLed, 0);
  digitalWrite(KirmiziLed, 0);
  Serial.begin(9600);
  delay(500);
  yeniSerialPort.begin(9600);
  delay(500);
  Serial.println("Arduino Başlatıldı.");
}


void loop()
{
  HTTPClient http;
  WiFiClient client1;
  String Link, Data, GercekVeri;
  Data = String("veri");
  Serial.println("---------------- test.php -----------------");
  String planlanan = "/test.php";
  Link = host + planlanan;
  http.begin(client1, Link.c_str());
  http.addHeader("Content-Type", "application/x-www-form-urlencoded");
  int cevap = http.POST(Data);
  String veri = http.getString();
  Serial.println("Gelen Cevap:" + String(cevap));
  Serial.println("Gelen Veri:" + String(veri));
  delay(1000);
  http.end();
  Serial.println("---------------- test.php -----------------");
  delay(sure);
  Serial.println("---------------- PlanlananKontrol.php -----------------");
  planlanan = "/PlanlananKontrol.php";
  Link = host + planlanan;
  http.begin(client1, Link.c_str());
  http.addHeader("Content-Type", "application/x-www-form-urlencoded");
  cevap = http.POST(Data);
  veri = http.getString();
  Serial.println("Gelen Cevap:" + String(cevap));
  Serial.println("Gelen Veri:" + String(veri));
  delay(1000);
  http.end();
  Serial.println("---------------- PlanlananKontrol.php -----------------");
  delay(sure);

  Serial.println("---------------- AktifKontrol.php -----------------");
  String aktif = "/AktifKontrol.php";
  Link = host + aktif;
  http.begin(client1, Link.c_str());
  http.addHeader("Content-Type", "application/x-www-form-urlencoded");
  cevap = http.POST(Data);
  veri = http.getString();
  Serial.println("Gelen Cevap:" + String(cevap));
  Serial.println("Gelen Veri:" + String(veri));
  delay(1000);
  http.end();
  Serial.println("---------------- AktifKontrol.php -----------------");
  delay(sure);

  Serial.println("---------------- NodemcuVeri.php -----------------");
  String nodemcu = "/NodemcuVeri.php";
  Link = host + nodemcu;
  http.begin(client1, Link.c_str());
  http.addHeader("Content-Type", "application/x-www-form-urlencoded");
  cevap = http.POST(Data);
  veri = http.getString();
  Serial.println("Gelen Cevap:" + String(cevap));
  Serial.println("Gelen Veri:" + String(veri));
  delay(1000);
  http.end();
  GercekVeri = veri;
  Serial.println("Gerçek Veri:" + String(GercekVeri));
  Serial.println("---------------- NodemcuVeri.php -----------------");
  // GercekVeri = "username:0000;34#"
  String gonderilecekVeri;
  if (GercekVeri.length() > 1)
  {
    int x1 = veri.indexOf(":");
    int x2 = veri.indexOf(";");
    int x3 = veri.indexOf("#");
    String Username = veri.substring(0, x1);
    String Sifre = veri.substring(x1 + 1, x2);
    String KayitId = veri.substring(x2 + 1, x3);
    Serial.println("Username:" + Username);
    Serial.println("Şifre:" + Sifre);
    Serial.println("KayitID:" + KayitId);
    gonderilecekVeri = "Y" + Username + ":" + Sifre + ";" + KayitId + "#";
    //"Yusername:0000;34#"
  }
  else
  {
    gonderilecekVeri = "X";
  }

  Serial.println("Arduinoya Gönderilen Veri:");
  char tus = TusTakimi.getKey();
  if (tus != NO_KEY)
  {
    if (KeypadSifre.length() < 4)
    {
      KeypadSifre += tus;
      Serial.println("SİFRE:" + KeypadSifre);
    }
  }
  if (KeypadSifre.length() < 4)
  {
    lcd.setCursor(0, 0);
    lcd.print(" SIFRE GIRINIZ! ");
    lcd.setCursor(0, 1);
    lcd.print(" SIFRE:" + KeypadSifre + " ");
  }
  if (KeypadSifre.length() == 4)
  {
    Serial.println("SİFRE:" + KeypadSifre);
    if (KeypadSifre == Sifre)
    {
      Serial.println("SİFRE DOGRU");
      Serial.println("LUTFEN BEKLEYIN.");

      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("   SIFRE DOGRU  ");
      lcd.setCursor(0, 1);
      lcd.print("LUTFEN BEKLEYIN.");
      digitalWrite(YesilLed, 1);
      delay(3000);
      //    Ahmet      5  11/2 5;
      // Yunus Emre 10 3;
      int bosluk = (16 - Username.length()) / 2;
      lcd.clear();
      lcd.setCursor(bosluk, 0);
      lcd.print(Username);
      Serial.println(Username);
      delay(1000);

      delay(4000);
      digitalWrite(YesilLed, 0);
      KeypadSifre = "";
    }
    else
    {
      Serial.println("SİFRE YANLIS");
      Serial.println("LUTFEN BEKLEYIN.");
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("  SIFRE YANLIS! ");
      lcd.setCursor(0, 1);
      lcd.print("LUTFEN BEKLEYIN.");
      for (int i = 0; i < 3; i++)
      {
        digitalWrite(KirmiziLed, 1);
        delay(1000);
        digitalWrite(KirmiziLed, 0);
        delay(1000);
      }
      KeypadSifre = "";
    }
  }

  if (yeniSerialPort.available())   //Veri geldiyse
  {
    String veri = gonderilecekVeri;
    Serial.println("Veri Geldi:" + veri);
    if (veri.length() > 0)
    {
      if (veri[0] == 'X')
      {
        Sifre = "XXXX";
        KayitId = "";
        Username = "";
      }
      else if (veri[0] == 'Y')
      {
        int x1 = veri.indexOf(":");
        int x2 = veri.indexOf(";");
        int x3 = veri.indexOf("#");
        Username = veri.substring(1, x1);
        Sifre = veri.substring(x1 + 1, x2);
        KayitId = veri.substring(x2 + 1, x3);
      }
    }
    Serial.println("Username:" + Username);
    Serial.println("KayitId:" + KayitId);
    Serial.println("Güncel Sifre:" + Sifre);
  }
  Serial.println("----------------BAĞLANTI KAPATILIYOR----------------");
  delay(100000);
  Serial.println();

  for (byte i = 10; i > 0; i--)
  {
    delay(1000);
    Serial.println("LÜTFEN " + String(i) + " SN BEKLEYİNİZ.");
  }
}

hi thank you for the reply, I am a beginner at this and don't understand much at the moment I'm struggling to get anything to work and have no clue what do do with what you sent, I am at the stage that I have the software downloaded on my Mac I have a esp8622 module but that's as much as I know I don't know how to communicate with the module I know how to verify and upload but have been unable to upload as error keeps appearing and if it does upload how will I know if its able to communicate to my Mac over wifi and upload sketch over wifi.
sorry for sounding thick but I've just started with Arduino.
cheers
David

first you need to download the esp8266 library, there are videos to do this on youtube, then it is completely the same as ardunio

I missed the camphare -> davidpirie interaction.

However I suggest you cannot / should not try to do all at one time. You should pick each piece of hardware and get it working on its own. Then when all is working you combine them.

Hi, I agree I have everything else working but nothing will work till I get the esp8622 working.
cheers
David

Hi I seam to have managed to do that just not seeing the module I think I have ordered a data cable maybe that will help.
cheers
David

It seems that you need the experience of some more days with shooting into the fog without any success.

To give you a picture of what you are trying to do
You want to build a customized truck like this:


But without knowing the basics about programming you might end up with a code that is like this

Though it is not obvious that your code is so scrappy.

You should really take the advice of adding

one thing at a time.

programming is very different from choosing wheels and a certain kind of motor in a PC-game
It does not work like pick & click

I recommend that you work through this tutorial

Arduino Programming Course

It is easy to understand and has a good mixture between explaining important concepts and example-codes to get you going. So give it a try and report your opinion about this tutorial.

best regards Stefan

1 Like

I don't understand your reply. Do you have all the pieces working individually on the ESP8622?

hi sorry I have got everything working on Arduino Uno but I want to use the esp8622 to do it as I can upload different sketches ota and no need for cables etc

did you install the ESP8266 board?

did you change the IO-pin numbers to match the ESP8266 I2C-io-pins?

I think from these questions you can see. You have to learn quite a bit more.
Re-edit your code in the first posting after reading this manual

best regards Stefan

If I were in your position I would get everything working on the ESP8622 before fully integrating them. I have a bunch of folders under "_DeviceProveoutCode" every device and board alternate has a place under this folder. And when I start a new project and forget the details of some piece of hardware I just have to look to the proper folder and see how i proved out the device.

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