Could use a bid help to get started



  • Hi there,

    Today i started with MySensor,
    I installed Domoticz on an arduino.
    I made MySensor gateway that runs on Domoticz Gateway Version: 2.1.0
    then i took a nano and installed a DHT11 took a sample code and i can read in serial monitor the temperature.
    I i am trying by using many sample codes for sending the dht11 data to domoticz
    but almost with all sample codes i get messages
    about :

    exit status 1
    no matching function for call to 'DHT::DHT()'

    or that the code is not for the nano.

    Is there one simple working sample so i can test if i can sent a bid of data into domoticz.

    im getting crazy because simple code can be written into my nano but stuff related to my sensor ... i get all kinds of problems..

    Sorry for my bad english im a Dutch guy.

    Kind Regards Rene.

    p.s. i hope once to get a weather station running with more sensors, but would be glad to get 1 thing working


  • Hardware Contributor

    @Rene046 - Hi and welcome!
    no matching function for call to 'DHT::DHT()' means you are missing the DHT library. You need to install it from here: https://github.com/mysensors/MySensorsArduinoExamples



  • Thx for you fast answer,

    i installed you links library, seems i had to overwrite because i already had those,during compiling i get....

    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Rene\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Rene\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10801 -build-path H:\WINDOW~1\Temp\arduino_build_113476 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\DHT22-1\DHT22-1.ino
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Rene\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Rene\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries -fqbn=arduino:avr:nano:cpu=atmega328 -ide-version=10801 -build-path H:\WINDOW~1\Temp\arduino_build_113476 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\DHT22-1\DHT22-1.ino
    Using board 'nano' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
    Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr
    Detecting libraries used...
    "C:\Program Files (x86)\Arduino\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=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "H:\WINDOW~1\Temp\arduino_build_113476\sketch\DHT22-1.ino.cpp" -o "nul"
    "C:\Program Files (x86)\Arduino\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=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "H:\WINDOW~1\Temp\arduino_build_113476\sketch\DHT22-1.ino.cpp" -o "nul"
    "C:\Program Files (x86)\Arduino\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=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\MySensors-2.0.0" "H:\WINDOW~1\Temp\arduino_build_113476\sketch\DHT22-1.ino.cpp" -o "nul"
    "C:\Program Files (x86)\Arduino\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=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\MySensors-2.0.0" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library" "H:\WINDOW~1\Temp\arduino_build_113476\sketch\DHT22-1.ino.cpp" -o "nul"
    "C:\Program Files (x86)\Arduino\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=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\MySensors-2.0.0" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library" "C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src\SPI.cpp" -o "nul"
    "C:\Program Files (x86)\Arduino\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=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\MySensors-2.0.0" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library" "H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library\DHT.cpp" -o "nul"
    Generating function prototypes...
    "C:\Program Files (x86)\Arduino\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=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\MySensors-2.0.0" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library" "H:\WINDOW~1\Temp\arduino_build_113476\sketch\DHT22-1.ino.cpp" -o "H:\WINDOW~1\Temp\arduino_build_113476\preproc\ctags_target_for_gcc_minus_e.cpp"
    "C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "H:\WINDOW~1\Temp\arduino_build_113476\preproc\ctags_target_for_gcc_minus_e.cpp"
    Compiling sketch...
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10801 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\MySensors-2.0.0" "-IH:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library" "H:\WINDOW~1\Temp\arduino_build_113476\sketch\DHT22-1.ino.cpp" -o "H:\WINDOW~1\Temp\arduino_build_113476\sketch\DHT22-1.ino.cpp.o"
    DHT22-1:73: error: no matching function for call to 'DHT::DHT()'

    DHT dht;

     ^
    

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\DHT22-1\DHT22-1.ino:73:5: note: candidates are:

    In file included from H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\DHT22-1\DHT22-1.ino:44:0:

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library/DHT.h:40:4: note: DHT::DHT(uint8_t, uint8_t, uint8_t)

    DHT(uint8_t pin, uint8_t type, uint8_t count=6);
    
    ^
    

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library/DHT.h:40:4: note: candidate expects 3 arguments, 0 provided

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library/DHT.h:38:7: note: constexpr DHT::DHT(const DHT&)

    class DHT {

       ^
    

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library/DHT.h:38:7: note: candidate expects 1 argument, 0 provided

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library/DHT.h:38:7: note: constexpr DHT::DHT(DHT&&)

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library/DHT.h:38:7: note: candidate expects 1 argument, 0 provided

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\DHT22-1\DHT22-1.ino: In function 'void setup()':

    DHT22-1:91: error: 'class DHT' has no member named 'setup'

    dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor

       ^
    

    DHT22-1:92: error: 'class DHT' has no member named 'getMinimumSamplingPeriod'

    if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {

                              ^
    

    DHT22-1:97: error: 'class DHT' has no member named 'getMinimumSamplingPeriod'

    sleep(dht.getMinimumSamplingPeriod());

             ^
    

    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\DHT22-1\DHT22-1.ino: In function 'void loop()':

    DHT22-1:104: error: 'class DHT' has no member named 'readSensor'

    dht.readSensor(true);

       ^
    

    DHT22-1:107: error: 'class DHT' has no member named 'getTemperature'

    float temperature = dht.getTemperature();

                           ^
    

    DHT22-1:114: error: 'class DHT' has no member named 'toFahrenheit'

       temperature = dht.toFahrenheit(temperature);
    
                         ^
    

    DHT22-1:131: error: 'class DHT' has no member named 'getHumidity'

    float humidity = dht.getHumidity();

                        ^
    

    Multiple libraries were found for "DHT.h"
    Used: H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library
    Not used: H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT-sensor-library-master
    Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
    Using library MySensors-2.0.0 at version 2.0.0 in folder: H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\MySensors-2.0.0
    Using library DHT_sensor_library at version 1.2.3 in folder: H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT_sensor_library
    exit status 1
    no matching function for call to 'DHT::DHT()'



  • this is the sketch :
    /**

    • The MySensors Arduino library handles the wireless radio link and protocol
    • between your home built sensors/actuators and HA controller of choice.
    • The sensors forms a self healing radio network with optional repeaters. Each
    • repeater and gateway builds a routing tables in EEPROM which keeps track of the
    • network topology allowing messages to be routed to nodes.
    • Created by Henrik Ekblad henrik.ekblad@mysensors.org
    • Copyright (C) 2013-2015 Sensnology AB
    • Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
    • Documentation: http://www.mysensors.org
    • Support Forum: http://forum.mysensors.org
    • This program is free software; you can redistribute it and/or
    • modify it under the terms of the GNU General Public License
    • version 2 as published by the Free Software Foundation.

    • REVISION HISTORY
    • Version 1.0: Henrik EKblad
    • Version 1.1 - 2016-07-20: Converted to MySensors v2.0 and added various improvements - Torben Woltjen (mozzbozz)
    • DESCRIPTION
    • This sketch provides an example of how to implement a humidity/temperature
    • sensor using a DHT11/DHT-22.
    • For more information, please visit:
    • http://www.mysensors.org/build/humidity

    */

    // Enable debug prints
    #define MY_DEBUG

    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    //#define MY_RS485

    #include <SPI.h>
    #include <MySensors.h>
    #include <DHT.h>

    // Set this to the pin you connected the DHT's data pin to
    #define DHT_DATA_PIN 2

    // Set this offset if the sensor has a permanent small offset to the real temperatures
    #define SENSOR_TEMP_OFFSET 0

    // Sleep time between sensor updates (in milliseconds)
    // Must be >1000ms for DHT22 and >2000ms for DHT11
    static const uint64_t UPDATE_INTERVAL = 60000;

    // Force sending an update of the temperature after n sensor reads, so a controller showing the
    // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
    // the value didn't change since;
    // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
    static const uint8_t FORCE_UPDATE_N_READS = 10;

    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1

    float lastTemp;
    float lastHum;
    uint8_t nNoUpdatesTemp;
    uint8_t nNoUpdatesHum;
    bool metric = true;

    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    DHT dht;

    void presentation()
    {
    // Send the sketch version information to the gateway
    sendSketchInfo("TemperatureAndHumidity", "1.1");

    // Register all sensors to gw (they will be created as child devices)
    present(CHILD_ID_HUM, S_HUM);
    present(CHILD_ID_TEMP, S_TEMP);

    metric = getConfig().isMetric;
    }

    void setup()
    {
    dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor
    if (UPDATE_INTERVAL <= dht.getMinimumSamplingPeriod()) {
    Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!");
    }
    // Sleep for the time of the minimum sampling period to give the sensor time to power up
    // (otherwise, timeout errors might occure for the first reading)
    sleep(dht.getMinimumSamplingPeriod());
    }

    void loop()
    {
    // Force reading sensor, so it works also after sleep()
    dht.readSensor(true);

    // Get temperature from DHT library
    float temperature = dht.getTemperature();
    if (isnan(temperature)) {
    Serial.println("Failed reading temperature from DHT!");
    } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) {
    // Only send temperature if it changed since the last measurement or if we didn't send an update for n times
    lastTemp = temperature;
    if (!metric) {
    temperature = dht.toFahrenheit(temperature);
    }
    // Reset no updates counter
    nNoUpdatesTemp = 0;
    temperature += SENSOR_TEMP_OFFSET;
    send(msgTemp.set(temperature, 1));

    #ifdef MY_DEBUG
    Serial.print("T: ");
    Serial.println(temperature);
    #endif
    

    } else {
    // Increase no update counter if the temperature stayed the same
    nNoUpdatesTemp++;
    }

    // Get humidity from DHT library
    float humidity = dht.getHumidity();
    if (isnan(humidity)) {
    Serial.println("Failed reading humidity from DHT");
    } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) {
    // Only send humidity if it changed since the last measurement or if we didn't send an update for n times
    lastHum = humidity;
    // Reset no updates counter
    nNoUpdatesHum = 0;
    send(msgHum.set(humidity, 1));

    #ifdef MY_DEBUG
    Serial.print("H: ");
    Serial.println(humidity);
    #endif
    

    } else {
    // Increase no update counter if the humidity stayed the same
    nNoUpdatesHum++;
    }

    // Sleep for a while to save energy
    sleep(UPDATE_INTERVAL);
    }



  • Hi,

    What i see also often is that Mysensor.h is used in a lot of sketches
    and cant be found by Arduino's ide.

    WARNING: Spurious .mystools folder in 'MySensors' library
    H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\DHT22-1\DHT22-1.ino:2:22: fatal error: MySensor.h: No such file or directory

    i am afraid i have done something verry wrong that nothing seems to be working here.

    Installed arduino ide many times removed library's many time's but still no sketch with Mysensor works here.

    Please please help


  • Mod

    @Rene046 how did you install the MySensors library? Did you use the instructions at https://www.mysensors.org/about/arduino#installing-the-sensor-libraries ?

    Where did you find the dht11 sketch? MySensor.h (without s before the dot) is from MySensors 1.x so it seems there is a mixup between different versions.



  • jes i installed it like in your link.

    Seems my sketch is then from an older version. because it uses Mysensor.h
    I also tried changing it to mysensors.h but then allot of things go wrong while compiling

    Maybe you could point me to a DHT sketch thats up-to-date ? for mysensor version 2.1.1
    i installed.

    Im totally new with mysensor, and now you told me i understand that lots of sketches on internet are old and dont work anymore.
    Where can i find info about changes ?

    i now am trying the sketch of this person
    https://forum.mysensors.org/topic/3774/multiple-dht22-in-one-sensor-for-greenhouse-newbee-question/5

    but he also seems to use old version, i see again mysensor.h instead of mysensors.h

    hope for an answer....


  • Mod

    @Rene046 many MySensors sketches are included with the MySensors library. You can find them in File->Examples-MySensors in the Arduino IDE

    However, sketches that require external libraries (such as the temperature example which requires a MySensors fork of the DHT library) can not be included within the library. Therefore, they are available at https://github.com/mysensors/MySensorsArduinoExamples/archive/master.zip



  • All those samples seems to work and compile perfect,

    But there is no sample with an DHT sensor temp. and hum included. or do i overlook ?


  • Mod

    @Rene046 in the MySensorsArduinoExamples zip file is examples/DhtTemperatureAndHumiditySensor and libraries/DHT

    You'll need both those folders.



  • should i unzip those inside the mysensor map or arduino ?


  • Mod

    @Rene046 I am not sure, but try putting DhtTemperatureAndHumiditySensor in the Arduino sketch folder (My Documents\Arduino on my computer) and DHT in the libraries folder (My Documents\Arduino\libraries on my computer)



  • ok done that, opened the sketch sample for dht.
    compile and i get :

    H:\WINDOW~1\Temp\arduino_modified_sketch_660970\DhtTemperatureAndHumiditySensor.ino: In function 'void presentation()':
    
    DhtTemperatureAndHumiditySensor:85: error: 'getConfig' was not declared in this scope
    
       metric = getConfig().isMetric;
    
                          ^
    
    Multiple libraries were found for "DHT.h"
     Used: H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT
     Not used: H:\WINDOWS GEBRUIKERS\MIJN_DOCUMENTEN\Arduino\libraries\DHT-sensor-library-master
    exit status 1
    'getConfig' was not declared in this scope
    
    

  • Mod

    @Rene046 There are two DHT folders. Delete the DHT folder that didn't come from the MySensorsArduinoExamples zip file.



  • ok now im left with this

    H:\WINDOW~1\Temp\arduino_modified_sketch_225110\DhtTemperatureAndHumiditySensor.ino: In function 'void presentation()':
    
    DhtTemperatureAndHumiditySensor:85: error: 'getConfig' was not declared in this scope
    
       metric = getConfig().isMetric;
    
                          ^
    
    exit status 1
    'getConfig' was not declared in this scope
    
    

  • Mod



  • thanks it works... i love you ..lol

    why do they change basic commands.... this make it hard to use.......

    Like this command and why make from mysensor.h mysensors.h.

    i also looked inside domoticz and i got data

    thank you very very much


  • Mod

    @Rene046 the change from MySensor to MySensors is because the Arduino IDE requires the .h file to have exactly the same name as the library. That was not the case when MySensors was created, but happened some time in 2015 I think. So to comply with Arduino IDE rules, it had to be changed.

    The reason for changing getConfig is logged at https://github.com/mysensors/MySensors/issues/736 but I am not sure why and the fix (https://github.com/mysensors/MySensors/pull/737 ) does not explain why either, but seems to be due to a mistake in https://github.com/mysensors/MySensors/commit/92cbd2ac8f49fe2f8cb25726e08aac9ecd597b84



  • ok,

    At least i can now experiment with other sensors for my weather station project.
    i now all electronics are working, i saved this sketch and commented those changes.
    Again thank you for getting me started.


  • Mod

    @Rene046 you're welcome. Great that you got it working.



  • can i ask another question....

    Im trying to add a battery sense pin to the sketch. they use gw. commands, are those also changed in the new version ?they are not recognized....

    They serail monitor shows me the voltage but how do i send it as and child to domoticz.


  • Mod

    @Rene046 most commands were simplified in MySensors 2.0. If the example you found uses gw.send(), remove gw. and just use send().



  • Thanks Mikael,

    could i find those new commands somewhere


  • Mod

    @Rene046 yes they are all documented in the api. https://www.mysensors.org/download/sensor_api_20


Log in to reply
 

Suggested Topics

68
Online

11.4k
Users

11.1k
Topics

112.7k
Posts