Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By GroovyGrovesy
#13634 Hi, I have just tried this example and am getting the following compilation error

Arduino: 1.6.3 (Windows 8.1), Board: "Generic ESP8266 board"

DHT11_and_MQTT_V1.ino:8:15: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

DHT11_and_MQTT_V1.ino:9:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

DHT11_and_MQTT_V1.cpp.o:(.text.startup+0xc): undefined reference to `__dso_handle'

c:/users/adam/google drive/arduino/hardware/arduino-esp8266-master/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Adam\AppData\Local\Temp\build2633711181703228646.tmp/DHT11_and_MQTT_V1.cpp.elf: hidden symbol `__dso_handle' isn't defined

c:/users/adam/google drive/arduino/hardware/arduino-esp8266-master/tools/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: final link failed: Bad value

collect2.exe: error: ld returned 1 exit status

Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.


Any ideas???

Thanks
User avatar
By cswiger
#14863 Just want to point out - the adafruit dhtxx code works fine with the esp8266 - but I did (after days of head scratching) have to change the 'count' argument in the DHT constructor to compensate for a faster processor.

This is working for me, a value of 20 (may not be optimum - haven't tried to find the upper and lower working values to get an optimum midpoint).

// Initialize DHT sensor for a fast 52MHz esp8266
DHT dht(DHTPIN, DHTTYPE,20);

// NOTE: For working with a faster chip, like an Arduino Due or Teensy, you
// might need to increase the threshold for cycle counts considered a 1 or 0.
// You can do this by passing a 3rd parameter for this threshold. It's a bit
// of fiddling to find the right value, but in general the faster the CPU the
// higher the value. The default for a 16mhz AVR is a value of 6. For an
// Arduino Due that runs at 84mhz a value of 30 works.
// Example to initialize DHT sensor for Arduino Due:
//DHT dht(DHTPIN, DHTTYPE, 30);