Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

error for compiling ESp 32 dev module on arduino ide #6

Open
hadjer39 opened this issue Apr 30, 2018 · 10 comments
Open

error for compiling ESp 32 dev module on arduino ide #6

hadjer39 opened this issue Apr 30, 2018 · 10 comments

Comments

@hadjer39
Copy link

Hi,
I'm trying to use Higrow esp32 moisture sensor on arduino ide,
I upload this sketch I got this error:
Build options changed, rebuilding all
/home/hadjer/arduino-1.8.5/Arduino/higrow-test/higrow-test.ino:2:17: fatal error: DHT.h: No such file or directory
compilation terminated.
Multiple libraries were found for "WiFi.h"
Used: /home/hadjer/arduino-1.8.5/hardware/espressif/esp32/libraries/WiFi
Not used: /home/hadjer/arduino-1.8.5/libraries/WiFi
exit status 1
Error compiling for board ESP32 Dev Module.

here is the code source :
#include <WiFi.h>
#include "DHT.h"

#define DHTTYPE DHT11

const char* ssid = "Buffalo-G-38D3";
const char* password = "n7pws65ixfb7f";

WiFiServer server(80);

const int DHTPin = 22;
DHT dht(DHTPin, DHTTYPE);

static char celsiusTemp[7];
static char fahrenheitTemp[7];
static char humidityTemp[7];

char linebuf[80];
int charcount=0;

void setup() {

dht.begin();

Serial.begin(115200);
while(!Serial) {
;
}

Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while(WiFi.status() != WL_CONNECTED) {

delay(500);
Serial.print(".");
}

Serial.println("");
Serial.println("WiFI connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());

server.begin();

}

void loop() {

WiFiClient client = server.available();
if (client) {
Serial.println("New client");
memset(linebuf,0,sizeof(linebuf));
charcount=0;

boolean currentLineIsBlank = true;
while (client.connected()) {
  if (client.available()) {
    char c = client.read();
    Serial.write(c);
    linebuf[charcount]=c;
    if (charcount<sizeof(linebuf)-1) charcount++;
    if (c == '\n' && currentLineIsBlank) {

        float h = dht.readHumidity();
        float t = dht.readTemperature();
        float f = dht.readTemperature(true);
        if (isnan(h) || isnan(t) || isnan(f)) {
          Serial.println("Failed to read from DHT sensor!");
          strcpy(celsiusTemp,"Failed");
          strcpy(fahrenheitTemp, "Failed");
          strcpy(humidityTemp, "Failed");
        }
        else{

          float hic = dht.computeHeatIndex(t, h, false);
          dtostrf(hic, 6, 2, celsiusTemp);
          float hif = dht.computeHeatIndex(f, h);
          dtostrf(hif, 6, 2, fahrenheitTemp);
          dtostrf(h, 6, 2, humidityTemp);
        }

        client.println("HTTP/1.1 200 OK");
        client.println("Content-Type: text/html");
        client.println("Connection: close");
        client.println();
        client.println("<!DOCTYPE HTML><html><head><meta name=\"viewport\"content=\"width=device-width, initial-serial=1\">");
        client.println("meta http-equiv=\"refresh\" content=\"30\"></head>");
        client.println("<body><div style=\"font-size: 3.5rem;\"><p>ESP32 - DHT</p><p>");
        if(atoi(clesiusTemp)>=25) {
          client.println("<div style=\"color: #930000;\">");
        }
        else if(atoi(celsiusTemp)<25 && atoi(celsiusTemp)>=5) {
          client.println("<div style=\"color: #006601;\">");
        }
        else if(atoi(celsiusTemp)<5) {
          client.println("<div style=\"color: #009191:\">");
        }
        client.println(celsiusTemp);
        client.println("*C</p><p>");
        client.println(fahrenheitTemp);
        client.println("*F</p></div><p>");
        client.println(humidityTemp);
        client.println("%</p><p>");
        client.println(analogRead(32));
        client.println("</p></div>");
        client.println("</body></html>");
        break;
    }
    if (c == '\n') {
      currentLineIsBlank = true;
      memset(linebuf,0,sizeof(linebuf));
      charcount=0;
    } else if (c != '\r') {
      currentLineIsBalnk = false;
      
    }
    }

}
delay(1);

client.step();
Serial.println("client disconnected");

}
}

@lucafabbri
Copy link
Owner

lucafabbri commented Apr 30, 2018 via email

@hadjer39
Copy link
Author

hadjer39 commented May 1, 2018

Thank you LF for your kind help
Now I could compile and upload it,
But I got different readings from serial monitor like: �

@hadjer39
Copy link
Author

hadjer39 commented May 1, 2018 via email

@wooghee
Copy link

wooghee commented Feb 22, 2019

make sure you have all the necessary libraries in the libraries folder of you IDE. libraries are always included at the top of a sketch: // #include <wire.h> // and have .h ending.
if the serial monitor does not work, make sure that you set it the same baud rate that you initalized it with in the sketch; //Serial.begin(115200); //

@simo2410
Copy link

how to solve this issue?

Not used: /home/arduino-1.8.5/libraries/WiFi
exit status 1
Error compiling for board ESP32 Dev Module.

@wooghee
Copy link

wooghee commented May 16, 2019

exit status 1 means it did not compile

do you have two different WiFi.h libraries? if they have the same content it should not matter but if they are different it may use the wrong one.
make sure you have all the libraries you need in the correct folder.
are there any other error messages when you try to compile?

@simo2410
Copy link

In the arduino's libraries folder there is only one wifi folder i can't find the other if there is any.. im trying to switch a led using esp32

@avi183
Copy link

avi183 commented Jul 29, 2019

hi,
I can't able to dump anything on esp32 devkit board i'm getting this error anyone plz help me
c:/users/user/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:/users/user/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/xtensa-esp32-elf/5.2.0/liblto_plugin-0.dll: error loading plugin:

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board ESP32 Dev Module.

@wooghee
Copy link

wooghee commented Jul 29, 2019

What libraries did you include in your sketch and what is in the folders the error messages lead to?
Any idea what the plugin is? Maybe you need to move it to a different folder?
For ease of use I would recommend that you keep all project related files in the same folder.
exit status 1 means that it could not compile.

@faisal888-88
Copy link

hi,
I can't able to dump anything on esp32 devkit board i'm getting this error anyone plz help me
c:/users/user/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: c:/users/user/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../libexec/gcc/xtensa-esp32-elf/5.2.0/liblto_plugin-0.dll: error loading plugin:

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board ESP32 Dev Module.

same problem.... have you solved this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants