Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By Dennis
#13537 Hello all,

I've problems getting the OneWire library to work. I downloaded the 1.6.1 IDE windows from the github repo, erased the onewire folder in users\me\documents\arduino\libraries, and the new IDE is using the proper customized version of OneWire.h for esp8266, the one that was included in the esp8266 arduino IDE download.

Still, every example of onewire ds18x20 temperature readout I try, as well as every example of dallastemperaturecontrol.h, only gives a temperature reading of "0.0" or says "no more addresses"...

I have attached the ds18b20 to GPIO2, the data pin pulled to VCC via 4k7 resistor, and I am using esp-01 module...

Webserver example runs fine, just not the ds18b20 sensor.

I suspected a broken sensor, or faulty wiring, BUT with different firmware from here (and with identical hardware, wiring, same sensor), http://homes-smart.ru/index.php/oborudo ... arodmon-ru

the esp shows the device address and gives correct reading of the ds18b20, so it must be some software issue...

Any ideas? Has Anyone got ds18b20 working?

regards

Dennis
Last edited by Dennis on Tue Apr 07, 2015 3:47 am, edited 1 time in total.
User avatar
By phipli
#13567 I'm not having any issues reading a DS18b20. I shoehorned the built in OneWire "DS18x20_Temperature" example from the Arduino IDE into the "WiFiClient" ESP8266 example and have it happily uploading temperatures to Spark Fun's Data service.

I think the example loaded straight into the ESP8266... I didn't even have to change the i/o pin as they've kindly put it on pin 2, which is broken out.

Try that example and see where it gets you?

Phil
User avatar
By Dennis
#13609 No, just downloaded the IDE again, cleaned everything arduino-related from my system (appdata temp folder, preferences.txt, hardware and libraries folders under user\documents), then tried the DS18x20_Temperature example sketch of the OneWire library and still: no device is found, "addr" address array right after running the search function contains only zeroes. Tomorrow I'll give it another shot on a system where I never installed arduino IDE before.

Reading the 1wire sensor works with nodeMCU on the very same esp-01 module, and also works with homesmart.ru firmware (so wiring is ok, obviously)!

This is driving me crazy, need some sleep now. :D

regards
User avatar
By phipli
#13624 What is your supply voltage? The DS18b20 requires at least 3v, but the ESP8266 works on lower voltages? If you're using batteries, has the voltage dropped a bit? This is just an outside chance as my DS18b20 seems to just give the wrong temperature when the voltage is too low...

Good idea removing the existing libraries folder.

Do you have access to any other platforms (guessing by mention of appdata you're using windows)? Are you 100% sure that your code references the correct pin? Have you introduced a second error while trying to trouble shoot? (Who hasn't at some time... I keep forgetting to power on in the re-flashing mode whenever I'm trying to fix something else, which really doesn't help!)