-
Notifications
You must be signed in to change notification settings - Fork 36
error for compiling ESp 32 dev module on arduino ide #6
Comments
I guess you need to installa the library for the DHT sensor, which is available in https://github.com/adafruit/DHT-sensor-library
Cheers
LF
Da: hadjer39 <[email protected]>
Inviato: lunedì 30 aprile 2018 13:18
A: lucafabbri/HiGrow-Arduino-Esp <[email protected]>
Cc: Subscribed <[email protected]>
Oggetto: [lucafabbri/HiGrow-Arduino-Esp] error for compiling ESp 32 dev module on arduino ide (#6)
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");
}
}
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<http://t.sidekickopen08.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XZs1qwhgTW643TNC653tNHW7dSptd56dW4zf3yr-7z02?t=https%3A%2F%2Fgithub.com%2Flucafabbri%2FHiGrow-Arduino-Esp%2Fissues%2F6&si=5432252815376384&pi=9fec56cb-d453-494e-af60-874b30d3082b>, or mute the thread<http://t.sidekickopen08.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XZs1qwhgTW643TNC653tNHW7dSptd56dW4zf3yr-7z02?t=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAL7JppezhfxYeE_YXq_2EH3z0WHmcI3Vks5ttvLhgaJpZM4TscIe&si=5432252815376384&pi=9fec56cb-d453-494e-af60-874b30d3082b>.
|
Thank you LF for your kind help |
Thank you LF for your kind help
Now I could compile and upload it,
But I got different readings from serial monitor like ⸮ ⸮ ⸮⸮ ⸮ ⸮ ⸮ ⸮⸮⸮⸮ ⸮ ⸮
⸮⸮⸮ ⸮ ⸮⸮⸮ ⸮ ⸮ ⸮ ⸮ ⸮⸮⸮⸮⸮⸮ ⸮⸮⸮ ⸮ ⸮ ⸮ ⸮ ⸮⸮⸮ ⸮ ⸮⸮⸮ ⸮⸮⸮⸮ ⸮ ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮⸮⸮⸮ ⸮ ⸮
⸮ ⸮⸮ ⸮⸮⸮ ⸮⸮⸮⸮⸮ ⸮ ⸮ ⸮⸮⸮ ⸮⸮⸮ ⸮⸮⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮⸮ ⸮⸮⸮⸮ ⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮⸮ ⸮
⸮⸮⸮⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮ ⸮ ⸮⸮⸮ ⸮⸮⸮⸮⸮ ⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮ ⸮⸮ ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮ ⸮ ⸮
⸮⸮⸮ ⸮⸮ ⸮ ⸮ ⸮ ⸮⸮⸮ ⸮ ⸮ ⸮ ⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮ ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮ ⸮⸮ ⸮⸮⸮
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮ ⸮⸮ ⸮⸮⸮⸮⸮⸮⸮ ⸮ ⸮⸮⸮⸮ ⸮⸮⸮ ⸮⸮⸮⸮ ⸮⸮⸮⸮ ⸮ ⸮⸮⸮⸮⸮ ⸮⸮⸮ ⸮ ⸮⸮⸮
I would appreciate your help,
…On Mon, Apr 30, 2018 at 9:55 PM, lucafabbri ***@***.***> wrote:
I guess you need to installa the library for the DHT sensor, which is
available in https://github.com/adafruit/DHT-sensor-library
Cheers
LF
Da: hadjer39 ***@***.***>
Inviato: lunedì 30 aprile 2018 13:18
A: lucafabbri/HiGrow-Arduino-Esp ***@***.***>
Cc: Subscribed ***@***.***>
Oggetto: [lucafabbri/HiGrow-Arduino-Esp] error for compiling ESp 32 dev
module on arduino ide (#6)
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");
}
}
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<http://t.
sidekickopen08.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nM
JW7t5XZs1qwhgTW643TNC653tNHW7dSptd56dW4zf3yr-7z02?t=https%
3A%2F%2Fgithub.com%2Flucafabbri%2FHiGrow-Arduino-Esp%2Fissues%2F6&si=
5432252815376384&pi=9fec56cb-d453-494e-af60-874b30d3082b>, or mute the
thread<http://t.sidekickopen08.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nM
JW7t5XZs1qwhgTW643TNC653tNHW7dSptd56dW4zf3yr-7z02?t=https%
3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-
auth%2FAL7JppezhfxYeE_YXq_2EH3z0WHmcI3Vks5ttvLhgaJpZM4Ts
cIe&si=5432252815376384&pi=9fec56cb-d453-494e-af60-874b30d3082b>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AlDlf4mYeKqhnQYVHgRszZ8j_wP9J7p2ks5ttwnPgaJpZM4TscIe>
.
--
Hadjer Hamaidi
Kobe Institute of Computing
|
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. |
how to solve this issue? Not used: /home/arduino-1.8.5/libraries/WiFi |
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. |
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 |
hi, collect2.exe: error: ld returned 1 exit status exit status 1 |
What libraries did you include in your sketch and what is in the folders the error messages lead to? |
same problem.... have you solved this? |
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;
}
}
The text was updated successfully, but these errors were encountered: