|
Post by KartRacer on Feb 1, 2015 17:19:16 GMT
I am getting this error when trying to verify the UberSensor sketch before I upload it to the Arduino.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"
C:\Program Files\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\Program Files\Arduino\hardware\arduino\cores\arduino -IC:\Program Files\Arduino\hardware\arduino\variants\standard -IC:\Program Files\Arduino\libraries\RFM69 -IC:\Program Files\Arduino\libraries\SPI -IC:\Program Files\Arduino\libraries\DHT C:\Users\Scott\AppData\Local\Temp\build7504179925801519978.tmp\UberSensor.cpp -o C:\Users\Scott\AppData\Local\Temp\build7504179925801519978.tmp\UberSensor.cpp.o
UberSensor:75: error: 'DHT11' was not declared in this scope
UberSensor.ino: In function 'void setup()':
UberSensor:141: error: 'class DHT' has no member named 'begin'
UberSensor.ino: In function 'void loop()':
UberSensor:354: error: 'class DHT' has no member named 'readHumidity'
UberSensor:356: error: 'class DHT' has no member named 'readTemperature'
UberSensor:358: error: 'class DHT' has no member named 'readTemperature'
I was able to get the Ethernet Gateway sketch upload, but can't seem to find a DHT Library that works.
|
|
kylix
New Member
Posts: 1
|
Post by kylix on Feb 1, 2015 21:19:03 GMT
You need to load the DHT library.
|
|
|
Post by KartRacer on Feb 2, 2015 3:22:50 GMT
You need to load the DHT library. I have tried a couple different DHT Librarys with no luck. Any Idea which DHT Library to use. I am installing them in: Arduino/libraries/DHT
|
|
|
Post by Kylix_not_logged on Feb 2, 2015 16:42:03 GMT
Do you have the .cpp and the .h files inside the DHT library folder?
|
|
|
Post by camblonie on Feb 2, 2015 16:43:01 GMT
Kart, Are you renaming / moving the folder once you expand it in the library folder. Most times you need to remove "-master" in the name but you may also need to pull the files up one level in the structure.
|
|
|
Post by kartracer on Feb 2, 2015 16:53:38 GMT
Kart, Are you renaming / moving the folder once you expand it in the library folder. Most times you need to remove "-master" in the name but you may also need to pull the files up one level in the structure. I did rename it, I put the DHT.cpp, DHT.h files in this directory: c:/Program Files/Arduino/libraries/DHT I have tried a couple of different DHT libraries with no luck. I am stumped.
|
|
|
Post by camblonie on Feb 2, 2015 18:43:18 GMT
I think that's the wrong location. Look for an arduino folder under c:/users/username/... I'm not by my computer to check but that's the general area.
|
|
|
Post by kartracer on Feb 2, 2015 22:19:52 GMT
I think that's the wrong location. Look for an arduino folder under c:/users/username/... I'm not by my computer to check but that's the general area. I don't have any thing related to Arduino in C:/users/username/... I have added other libraries to c:/program files/arduino/libraries and they have worked fine, just not the DHT library.
|
|
|
Post by mothpaul on Mar 15, 2015 18:25:40 GMT
Greetings,
I too am having trouble with an Arduio Sketch. I modified the UberSensor Sketch for just a PIR sensor and an DHT22 Temperature Sensor. Every time the Node updates the Temperature/Humidity, it also sends a notice that the PIR sensor has detected motion. If someone could tell me where to look for this error in my sketch, it would be appriciated.
void loop() { unsigned long time_passed = 0; //=================================================================== //device #3 //PIR PIR_reading = digitalRead(PirInput); if ((PIR_reading == 1) && ( ((millis() - pir_time)>60000)||( (millis() - pir_time)< 0)) ) { pir_time = millis(); theData.deviceID = 3; theData.var1_usl = millis(); theData.var2_float = 1111.; theData.var3_float = 1112.; //null value; radio.sendWithRetry(GATEWAYID, (const void*)(&theData), sizeof(theData)); delay(2000); } //=================================================================== //device #2 //temperature / humidity time_passed = millis() - temperature_time; if (time_passed < 0) { temperature_time = millis(); } if (time_passed > 360000) { float h = dht.readHumidity(); float t = dht.readTemperature(); float f = dht.readTemperature(true); // Check if any reads failed and exit early (to try again). if (isnan(h) || isnan(t) || isnan(f)) { Serial.println("Failed to read from DHT sensor!"); return; } temperature_time = millis(); //send data theData.deviceID = 2; theData.var1_usl = millis(); theData.var2_float = f; theData.var3_float = h; radio.sendWithRetry(GATEWAYID, (const void*)(&theData), sizeof(theData)); delay(1000); } // end Device #2 }//end loop
|
|
|
Post by Liam on Mar 18, 2015 9:29:18 GMT
Hey mothpaul. Sorry I cannot help identify the exact problem but what I can say is I have the exact same setup and I have also modified the code as above for just PIR and temp and I do not have the same problem. The only difference I can see is that I have kept the original device ID's as per the untouched code.
|
|
|
Post by mothpaul on Mar 19, 2015 16:00:54 GMT
Hey mothpaul. Sorry I cannot help identify the exact problem but what I can say is I have the exact same setup and I have also modified the code as above for just PIR and temp and I do not have the same problem. The only difference I can see is that I have kept the original device ID's as per the untouched code. I posted only the Void Loop part of the Sketch because I din't think there would be a problem elsewhere. Could you share what you are using. Perhaps it would work for me too. Thanks
|
|
|
Post by mothpaul on Mar 20, 2015 18:04:36 GMT
ALCON,
Please disregard. I have sensors working now. I believe my error was that I changed the frequency that the Temperature Sensor was sending a reading for my testing purposes (i.e., from 6 minutes to 1 minute in the 'if time passed' line). I changed it back and it works now.
Thank you
|
|