Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Compilation Error for Arduino Pro or Pro Mini

Compilation Error for Arduino Pro or Pro Mini

Scheduled Pinned Locked Moved Troubleshooting
29 Posts 5 Posters 5.8k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Daniel RuizD Daniel Ruiz

    Thank you for your help.
    I do not understand very well with the translation in French. Could you explain to me in more detail or I have to add the two lines.
    DANIEL

    dbemowskD Offline
    dbemowskD Offline
    dbemowsk
    wrote on last edited by
    #14

    @Daniel-Ruiz Can we see your whole sketch?

    Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
    Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

    1 Reply Last reply
    0
    • Daniel RuizD Offline
      Daniel RuizD Offline
      Daniel Ruiz
      wrote on last edited by
      #15

      [code]
      /**

      • 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.

      • DESCRIPTION
      • Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller
      • http://www.mysensors.org/build/temp
        */

      // Enable debug prints to serial monitor
      //#define MY_DEBUG

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

      #include <SPI.h>
      #include <MySensors.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>

      #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No

      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected
      #define MAX_ATTACHED_DS18B20 16
      unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature.
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      bool receivedConfig = false;
      bool metric = true;
      // Initialize temperature message
      MyMessage msg(0,V_TEMP);
      int resolution = 12; //<---added

      void before()
      {
      // Startup up the OneWire library
      sensors.begin();
      conversionTime = 750 / (1 << (12 - resolution)); //<---added
      }

      void setup()
      {
      // requestTemperatures() will not block current thread
      sensors.setWaitForConversion(false);
      }

      void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Temperature Sensor", "1.1");

      // Fetch the number of attached temperature sensors
      numSensors = sensors.getDeviceCount();

      // Present all sensors to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
      present(i, S_TEMP);
      }
      }

      void loop()
      {
      // Fetch temperatures from Dallas sensors
      sensors.requestTemperatures();

      // query conversion time and sleep until conversion completed
      int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
      // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
      sleep(conversionTime);

      // Read temperatures and send them to controller
      for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {

      // Fetch and round temperature to one decimal
      float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
      
      // Only send data if temperature has changed and no error
      #if COMPARE_TEMP == 1
      if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
      #else
      if (temperature != -127.00 && temperature != 85.00) {
      #endif
      
        // Send in the new temperature
        send(msg.setSensor(i).set(temperature,1));
        // Save new temperatures for next compare
        lastTemperature[i]=temperature;
      }
      

      }
      sleep(SLEEP_TIME);
      }
      [/code]

      rejoe2R 1 Reply Last reply
      0
      • Daniel RuizD Daniel Ruiz

        [code]
        /**

        • 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.

        • DESCRIPTION
        • Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller
        • http://www.mysensors.org/build/temp
          */

        // Enable debug prints to serial monitor
        //#define MY_DEBUG

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

        #include <SPI.h>
        #include <MySensors.h>
        #include <DallasTemperature.h>
        #include <OneWire.h>

        #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No

        #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected
        #define MAX_ATTACHED_DS18B20 16
        unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
        OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
        DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature.
        float lastTemperature[MAX_ATTACHED_DS18B20];
        int numSensors=0;
        bool receivedConfig = false;
        bool metric = true;
        // Initialize temperature message
        MyMessage msg(0,V_TEMP);
        int resolution = 12; //<---added

        void before()
        {
        // Startup up the OneWire library
        sensors.begin();
        conversionTime = 750 / (1 << (12 - resolution)); //<---added
        }

        void setup()
        {
        // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
        }

        void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Temperature Sensor", "1.1");

        // Fetch the number of attached temperature sensors
        numSensors = sensors.getDeviceCount();

        // Present all sensors to controller
        for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
        present(i, S_TEMP);
        }
        }

        void loop()
        {
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();

        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(conversionTime);

        // Read temperatures and send them to controller
        for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {

        // Fetch and round temperature to one decimal
        float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
        
        // Only send data if temperature has changed and no error
        #if COMPARE_TEMP == 1
        if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
        #else
        if (temperature != -127.00 && temperature != 85.00) {
        #endif
        
          // Send in the new temperature
          send(msg.setSensor(i).set(temperature,1));
          // Save new temperatures for next compare
          lastTemperature[i]=temperature;
        }
        

        }
        sleep(SLEEP_TIME);
        }
        [/code]

        rejoe2R Offline
        rejoe2R Offline
        rejoe2
        wrote on last edited by
        #16

        @Daniel-Ruiz OK. Just to be sure:
        This sketch now is compiling and working as expected?

        Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

        1 Reply Last reply
        0
        • Daniel RuizD Offline
          Daniel RuizD Offline
          Daniel Ruiz
          wrote on last edited by
          #17

          C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Daniel\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10802 -build-path C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187 -warnings=none -build-cache C:\Users\Daniel\AppData\Local\Temp\arduino_cache_4544 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -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 -verbose C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino
          C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Daniel\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10802 -build-path C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187 -warnings=none -build-cache C:\Users\Daniel\AppData\Local\Temp\arduino_cache_4544 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -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 -verbose C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino
          Using board 'pro' 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=10802 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp\DallasTemperature.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\Documents\Arduino\libraries\OneWire-master\OneWire.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.ino.cpp" -o "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\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 "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\preproc\ctags_target_for_gcc_minus_e.cpp"
          Compilation du croquis...
          "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 -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.ino.cpp" -o "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.ino.cpp.o"
          C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino: In function 'void before()':

          sketch_aug01a:59: error: 'conversionTime' was not declared in this scope

          conversionTime = 750 / (1 << (12 - resolution)); //<---added

          ^

          C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino: In function 'void loop()':

          sketch_aug01a:87: error: 'class DallasTemperature' has no member named 'millisToWaitForConversion'

          int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());

          Utilisation de la bibliothèque SPI version 1.0 dans le dossier: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
          Utilisation de la bibliothèque MySensors version 2.1.1 dans le dossier: C:\Users\Daniel\Documents\Arduino\libraries\MySensors
          Utilisation de la bibliothèque MAX31850_DallasTemp version 1.0.0 dans le dossier: C:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp
          Utilisation de la bibliothèque OneWire-master version 2.3.3 dans le dossier: C:\Users\Daniel\Documents\Arduino\libraries\OneWire-master
          exit status 1
          'conversionTime' was not declared in this scope

          rejoe2R 1 Reply Last reply
          0
          • Daniel RuizD Daniel Ruiz

            C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Daniel\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10802 -build-path C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187 -warnings=none -build-cache C:\Users\Daniel\AppData\Local\Temp\arduino_cache_4544 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -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 -verbose C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino
            C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Daniel\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10802 -build-path C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187 -warnings=none -build-cache C:\Users\Daniel\AppData\Local\Temp\arduino_cache_4544 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -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 -verbose C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino
            Using board 'pro' 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=10802 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" "-IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp\DallasTemperature.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\Documents\Arduino\libraries\OneWire-master\OneWire.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=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.ino.cpp" -o "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\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 "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\preproc\ctags_target_for_gcc_minus_e.cpp"
            Compilation du croquis...
            "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 -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10802 -DARDUINO_AVR_PRO -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" "-IC:\Users\Daniel\Documents\Arduino\libraries\MySensors" "-IC:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp" "-IC:\Users\Daniel\Documents\Arduino\libraries\OneWire-master" "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.ino.cpp" -o "C:\Users\Daniel\AppData\Local\Temp\arduino_build_29187\sketch\sketch_aug01a.ino.cpp.o"
            C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino: In function 'void before()':

            sketch_aug01a:59: error: 'conversionTime' was not declared in this scope

            conversionTime = 750 / (1 << (12 - resolution)); //<---added

            ^

            C:\Users\Daniel\Documents\Arduino\sketch_aug01a\sketch_aug01a.ino: In function 'void loop()':

            sketch_aug01a:87: error: 'class DallasTemperature' has no member named 'millisToWaitForConversion'

            int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());

            Utilisation de la bibliothèque SPI version 1.0 dans le dossier: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
            Utilisation de la bibliothèque MySensors version 2.1.1 dans le dossier: C:\Users\Daniel\Documents\Arduino\libraries\MySensors
            Utilisation de la bibliothèque MAX31850_DallasTemp version 1.0.0 dans le dossier: C:\Users\Daniel\Documents\Arduino\libraries\MAX31850_DallasTemp
            Utilisation de la bibliothèque OneWire-master version 2.3.3 dans le dossier: C:\Users\Daniel\Documents\Arduino\libraries\OneWire-master
            exit status 1
            'conversionTime' was not declared in this scope

            rejoe2R Offline
            rejoe2R Offline
            rejoe2
            wrote on last edited by rejoe2
            #18

            @Daniel-Ruiz Thx.
            You may start the line with

            const int conversionTime = 750 / (1 << (12 - resolution));
            

            Sorry for letting that out...

            Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

            1 Reply Last reply
            0
            • Daniel RuizD Offline
              Daniel RuizD Offline
              Daniel Ruiz
              wrote on last edited by
              #19

              @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

              This sketch now is compiling and working as expected?

              Sorry to bore you again.
              I have to add the two lines as you indicated.
              I now have a new errone message.
              Daniel

              rejoe2R 1 Reply Last reply
              0
              • Daniel RuizD Daniel Ruiz

                @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

                This sketch now is compiling and working as expected?

                Sorry to bore you again.
                I have to add the two lines as you indicated.
                I now have a new errone message.
                Daniel

                rejoe2R Offline
                rejoe2R Offline
                rejoe2
                wrote on last edited by
                #20

                @Daniel-Ruiz Already noticed that.
                Fix above should work (newest version, had first vo check for the correct type of data type).

                Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                1 Reply Last reply
                0
                • Daniel RuizD Offline
                  Daniel RuizD Offline
                  Daniel Ruiz
                  wrote on last edited by
                  #21

                  @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

                  Fix above should work (newest version, had first vo check for the correct type of data type).

                  I have just done your last modification I have a new error message0_1501769497783_2017-08-03_16h11_10.png

                  1 Reply Last reply
                  0
                  • rejoe2R Offline
                    rejoe2R Offline
                    rejoe2
                    wrote on last edited by
                    #22

                    just comment this line out (start with //int16_t). This calculation is replaced by the one in the before() section.

                    Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                    1 Reply Last reply
                    0
                    • Daniel RuizD Offline
                      Daniel RuizD Offline
                      Daniel Ruiz
                      wrote on last edited by
                      #23

                      @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

                      just comment this line out (start with //int16_t). This calculation is replaced by the one in the before() section

                      I also put // before the line sleep (conversatuionTime);
                      Which gave an error message.
                      And now lr sketch no longer has any error.
                      I thank you for help, and I will try to advance now in the discovery of MY SENSORS.

                      Daniel

                      rejoe2R 1 Reply Last reply
                      0
                      • Daniel RuizD Daniel Ruiz

                        @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

                        just comment this line out (start with //int16_t). This calculation is replaced by the one in the before() section

                        I also put // before the line sleep (conversatuionTime);
                        Which gave an error message.
                        And now lr sketch no longer has any error.
                        I thank you for help, and I will try to advance now in the discovery of MY SENSORS.

                        Daniel

                        rejoe2R Offline
                        rejoe2R Offline
                        rejoe2
                        wrote on last edited by rejoe2
                        #24

                        @Daniel-Ruiz
                        Sorry, but to make the picture complete:
                        the sleep() is necessary!
                        Please do as follows:
                        insert

                        const int conversionTime;
                        

                        in the line below int resolution...

                        revert back in before to conversionTime = 750 / (1 << (12 - resolution)); //<---added
                        reactivate the sleep(conversionTime) in loop() (or use wait(conversionTime) instead.

                        Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                        1 Reply Last reply
                        0
                        • Daniel RuizD Offline
                          Daniel RuizD Offline
                          Daniel Ruiz
                          wrote on last edited by
                          #25

                          @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

                          const int conversionTime;

                          J'ai modifié comme ci dessous:
                          il n'y plus d'érreur0_1501771521501_2017-08-03_16h44_00.png

                          rejoe2R 1 Reply Last reply
                          0
                          • Daniel RuizD Daniel Ruiz

                            @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

                            const int conversionTime;

                            J'ai modifié comme ci dessous:
                            il n'y plus d'érreur0_1501771521501_2017-08-03_16h44_00.png

                            rejoe2R Offline
                            rejoe2R Offline
                            rejoe2
                            wrote on last edited by
                            #26

                            @Daniel-Ruiz je parle aussi un peu de francais, mais comme ce n'est pas gentile aux autres, je continue en anglais:
                            This is not a a good idea to "solve" the problem like this.

                            What is necessary is a global variable. This has to be introduced in the header of the c file (before the before() part). But as in the header no calculation is allowed, we have to do this calculation somwhere else (proposal was in the before() section. It is sufficient, to do this once, but it would also be possible to do that in loop(). If you do not want to calculate at all, you may just delete everything with "conversionTime" and do a sleep() with 750ms like that: sleep(750); this is absolutely necessary to get proper results from the DS18x20!
                            Further remark: If you want to go further steps with MySensors, you should try to understand the meanings of global variables, data-types, initialisation-functions like before(), presentation() and setup() and the loop().

                            Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                            1 Reply Last reply
                            1
                            • Daniel RuizD Offline
                              Daniel RuizD Offline
                              Daniel Ruiz
                              wrote on last edited by
                              #27

                              I modified as follows:
                              There is no more errors

                              I thought that setting up MYSENSORS was something simple, as indicated in the presentation of the website. I thought the skits were working without changing them. I note that this is not the case, and that it is necessary to have notions of programming.

                              rejoe2R 1 Reply Last reply
                              0
                              • Daniel RuizD Daniel Ruiz

                                I modified as follows:
                                There is no more errors

                                I thought that setting up MYSENSORS was something simple, as indicated in the presentation of the website. I thought the skits were working without changing them. I note that this is not the case, and that it is necessary to have notions of programming.

                                rejoe2R Offline
                                rejoe2R Offline
                                rejoe2
                                wrote on last edited by
                                #28

                                @Daniel-Ruiz According to my experience, it normally is not necessary to change sketches.
                                Especially not as long as they are "official" MySensors Sketches. But as soon as additional libs are concerned (here: dallasTemperature), the developers may not be able to survey all external changes that may happen. (The conversionTime calculation had been "public" in the past; this had been changed for whatever reason by the dallas-lib-guys). So this sketch originally had worked. It also may have worked, if you installed an older version of the relevant lib (with the lib manager in the IDE).

                                Nevertheless: You most likely already got a first idea how these things work. Me too, I had to fullfill a fast learning curve... BUT: It is fun!

                                Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                                1 Reply Last reply
                                0
                                • Daniel RuizD Offline
                                  Daniel RuizD Offline
                                  Daniel Ruiz
                                  wrote on last edited by
                                  #29

                                  @rejoe2 said in Compilation Error for Arduino Pro or Pro Mini:

                                  @Daniel-Ruiz According to my experience, it normally is not necessary to change sketches.
                                  Especially not as long as they are "official" MySensors Sketches. But as soon as additional libs are concerned (here: dallasTemperature), the developers may not be able to survey all external changes that may happen. (The conversionTime calculation had been "public" in the past; this had been changed for whatever reason by the dallas-lib-guys). So this sketch originally had worked. It also may have worked, if you installed an older version of the relevant lib (with the lib manager in the IDE).
                                  Nevertheless: You most likely already got a first idea how these things work. Me too, I had to fullfill a fast learning curve... BUT: It is fun!

                                  I fully agree with you.
                                  I have already assimilated some notions thanks to your experience. I'm going to hang on and move on. I love learning and discovering new technologies.
                                  I wish you a good evening.
                                  Daniel

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  12

                                  Online

                                  11.7k

                                  Users

                                  11.2k

                                  Topics

                                  113.1k

                                  Posts


                                  Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • MySensors
                                  • OpenHardware.io
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular