Mission 7 - Weather Station
 DuinoKit Essentials - View Only. See new "Mission Manual" forum for manual and code   Started by Daniel Alich   2017-06-27 21:39:52 -04:00   Comments: 8    Viewed: 2644

  1. Daniel Alich
    Daniel Alich Member Staff Member
    252_1511880916_Mission 7 – Weather Sta

    We are trying something a little bit different here.  This program requires you to install a "library file" to understand data from the DHT11 (Digital Temperature and Humidity Sensor) so we can make the weather station function.

    Included in this .ZIP file is the instructions for installing the library file OR you should be able to run the program directly from the downloaded folder.  You will notice the library files are included in the file folder and will open in a separate tab wile opening the .ino file.  There are also instructions in the code if you wish to install the library directly on your computer for future reference.

    https://drive.google.com/open?id=1d2rZjS96sosvAYuRiCYlYgErDYu_5tCn


    Daniel Alich, 2017-06-27 21:39:52 -04:00
    Raul Lara likes this.
  2. Josh Rawls
    Josh Rawls Member St. Louis, MO
    This code isn't working for me. I believe it has something to do with the DHT library. Here's the errors I'm getting. I used the libraries linked above and also the latest version from GIThub (https://github.com/RobTillaart/Arduino/blob/master/libraries/DHTlib/dht.h).

    Arduino: 1.8.5 (Mac OS X), Board: "Arduino Nano, ATmega328P"

    /Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/joshrawls/Documents/Arduino/libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10805 -build-path /var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793 -warnings=none -build-cache /var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_cache_207134 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/joshrawls/Documents/Arduino/Lesson_7_-_Weather_Station_-_2/Lesson_7_-_Weather_Station_-_2.ino
    /Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/joshrawls/Documents/Arduino/libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10805 -build-path /var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793 -warnings=none -build-cache /var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_cache_207134 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/joshrawls/Documents/Arduino/Lesson_7_-_Weather_Station_-_2/Lesson_7_-_Weather_Station_-_2.ino
    Using board 'nano' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
    Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
    Detecting libraries used...
    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs" "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/sketch/Lesson_7_-_Weather_Station_-_2.ino.cpp" -o "/dev/null"
    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs" "-I/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src" "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/sketch/Lesson_7_-_Weather_Station_-_2.ino.cpp" -o "/dev/null"
    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs" "-I/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src" "-I/Users/joshrawls/Documents/Arduino/libraries/DHTLib" "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/sketch/Lesson_7_-_Weather_Station_-_2.ino.cpp" -o "/dev/null"
    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs" "-I/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src" "-I/Users/joshrawls/Documents/Arduino/libraries/DHTLib" "/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src/LiquidCrystal.cpp" -o "/dev/null"
    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs" "-I/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src" "-I/Users/joshrawls/Documents/Arduino/libraries/DHTLib" "/Users/joshrawls/Documents/Arduino/libraries/DHTLib/dht.cpp" -o "/dev/null"
    Generating function prototypes...
    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs" "-I/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src" "-I/Users/joshrawls/Documents/Arduino/libraries/DHTLib" "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/sketch/Lesson_7_-_Weather_Station_-_2.ino.cpp" -o "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/preproc/ctags_target_for_gcc_minus_e.cpp"
    "/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/preproc/ctags_target_for_gcc_minus_e.cpp"
    Compiling sketch...
    "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/eightanaloginputs" "-I/Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal/src" "-I/Users/joshrawls/Documents/Arduino/libraries/DHTLib" "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/sketch/Lesson_7_-_Weather_Station_-_2.ino.cpp" -o "/var/folders/x4/k8fqjwfs42j9l_3_9qh1d9gw0000gp/T/arduino_build_862793/sketch/Lesson_7_-_Weather_Station_-_2.ino.cpp.o"
    Lesson_7_-_Weather_Station_-_2:9: error: 'DHT' does not name a type
    DHT dht(DHTPIN, DHTTYPE);
    ^
    /Users/joshrawls/Documents/Arduino/Lesson_7_-_Weather_Station_-_2/Lesson_7_-_Weather_Station_-_2.ino: In function 'void setup()':
    Lesson_7_-_Weather_Station_-_2:12: error: expected unqualified-id before '.' token
    dht.begin();
    ^
    /Users/joshrawls/Documents/Arduino/Lesson_7_-_Weather_Station_-_2/Lesson_7_-_Weather_Station_-_2.ino: In function 'void loop()':
    Lesson_7_-_Weather_Station_-_2:17: error: expected primary-expression before '.' token
    float h = dht.readHumidity();
    ^
    Lesson_7_-_Weather_Station_-_2:18: error: expected primary-expression before '.' token
    float t = dht.readTemperature();
    ^
    Using library LiquidCrystal at version 1.0.7 in folder: /Applications/Arduino.app/Contents/Java/libraries/LiquidCrystal
    Using library DHTLib in folder: /Users/joshrawls/Documents/Arduino/libraries/DHTLib (legacy)
    exit status 1
    'DHT' does not name a type
    Josh Rawls, 2018-08-01 01:31:42 -04:00
  3. Isaac Allen
    Isaac Allen Member
    I recently used the download link above and it worked fine.  (See post below)

    DHT11.Zip Download Link
     
    The install the .zip file library
    In the top menu select:  Sketch => Include Library => Add .ZIP Library
    Navigate to your "Downloads" folder and select the DHTLib.zip file that was downloaded using the link above.

    It does appear to be a probelm with DHT libary.  I'll look into it and see if there were changed made.  MACs often have other permissions or groups.  I've not used them but I'll see if I can find somehting.




    Isaac Allen, 2018-08-01 08:24:31 -04:00
  4. Josh Rawls
    Josh Rawls Member St. Louis, MO
    Thanks for looking into it. I copied and pasted everything and installed the library from that link and followed the instructions to install. Those are the errors I recieved. I am just learining programming so I'm not sure how to troubleshoot this very far. Thanks again!
    Josh Rawls, 2018-08-01 08:44:44 -04:00
  5. Isaac Allen
    Isaac Allen Member
    Look at your code (Line 9?).  remove the (DHTPIN, DHTTYPE) and info after the DHT setting.   

    dht DHT;

    This seems to be the line casuign the issues in your code.  saw it done this wany in a similar project listed here.

    http://duinokit.com/store/showandtell/topic/2-data-logger-temperature-humidity-and-light-level.html
    Isaac Allen, 2018-08-01 09:58:50 -04:00
  6. Josh Rawls
    Josh Rawls Member St. Louis, MO
    OK, it needed more than just that one change, which makes me suspect that maybe the library in your donwload link has changed from what you used to code with originally.

    Anyways, I got it all working as far as the code goes. However I'm getting a timeout error trying to read the DHT11 chip. The display shows 0.00% humidity and 32º for temperature and it never changes. Do I possibly have a defective chip?
    Josh Rawls, 2018-08-02 18:35:13 -04:00
  7. Daniel Alich
    Daniel Alich Member Staff Member
    Making code updates sohortly.  Will supply in a .ZIP file that includes the library.
    Daniel Alich, 2019-01-22 12:29:02 -05:00
  8. no, it won't work on my uno or nano. same issue. has the code been updated yet?
    Luke skywalker, 2019-04-15 14:37:52 -04:00
  9. (You must log in or sign up to post here)

Report Post

Write your reason

Log in | Sign up
Terms & Conditions!
Help!