Let op: Tweakers stopt per 2023 met Tweakblogs. In dit artikel leggen we uit waarom we hiervoor hebben gekozen.

Getting started with ESP-01s

Door LEiPiE op vrijdag 30 oktober 2020 23:11 - Reacties (7)
Categorie: home automation, Views: 3.089

Yeah, it's about time to dive into the world of home automation. I've always been interested in making graphs of everything and I've been wanting to track temperature in our house for quite some time.

So, opened up Aliexpress and ordered six ESP-01s: 2 with relay, 2 with DHT-11 and 2 with DS18B20 and a flasher.

Of course things didn't go smoothly:
sudo apt-get install python3-pip
(I didn't have python/pip on my personal laptop)
pip install epshome
errors out... ah, need to install setuptools
sudo apt-get install python3-setuptools
pip install esphome
warnings about python 3.5 being deprecated, no problem (I'm still running Linux Mint 18.3, didn't feel the need to upgrade yet :) )
ok, so
esphome livingroom.yaml wizard
should be a command to make a configfile, but fails with a python stack trace, but no usable error info
according to https://stackoverflow.com...t-needs-an-argument-while this was fixed in python 3.5.3... guess what I'm running... 3.5.2 :(

Ok, so we will use the docker route then :)

Of course the wizards asks questions I don't know the answer to: is the esp-01s an ESP32 or ESP8266? I think the latter.
But what board is it? esp01 I guess.

Ok, so I now have a yaml file, now we need to customize it.
So, I'm starting with the DHT11 one... but what pin is it connected to? The boards have a sensor and a reset switch and they have IO0 and IO2. Examples say it's pin 2, so we'll go for that :)

Well, at least it compiles... now let's flash the esp-01s, with esphome run
Mmz, it times out... why doesn't shit just work at first try...
Found in one tutorial that you should connect io0 to gnd, but that didn't help.
Enough for today.

Had to try one more time: take out the ftdi, connect io0 and gnd, put the ftdi back in, let go of te io0/gnd combo (I was using a pair of scissors to make that connection...).
And yes! It flashes!

Reacties


Door Tweakers user elhopo, zaterdag 31 oktober 2020 16:12

It was better to buy the ESP8266 boards, like the Wemos D1 mini. It already has a USB serial converter, power converter (5v -> 3.3v), you can put standard shields on it. Then flash it with ESPEasy, and you're done. No extra tools needed, connect it directly to Domotics and there you have your graphs.

Door Tweakers user Thijsmans, zondag 1 november 2020 08:52

Woot woot, another ESP blog :9 Why choose both the dht11 and ds18b20 modules? Looking forward to the next blog!

[Reactie gewijzigd op zondag 1 november 2020 08:52]


Door aerodactyl, zondag 1 november 2020 11:58

elhopo schreef op zaterdag 31 oktober 2020 @ 16:12:
It was better to buy the ESP8266 boards, like the Wemos D1 mini. It already has a USB serial converter, power converter (5v -> 3.3v), you can put standard shields on it. Then flash it with ESPEasy, and you're done. No extra tools needed, connect it directly to Domotics and there you have your graphs.
That completely depends on what you want to be honest. ESP01's are a better solution if you want to power them with a battery and make use of deep sleep. It's easier to do the initial setup on a Wemos, but yeah, depends on the use case.

Door Tweakers user LEiPiE, zondag 1 november 2020 23:30

Oh wow, people actually read this, I'll try to make the next one better ;)
Not sure why I've typed it in English, but maybe it'll help someone someday.

Yeah, just trying out some stuff, as cheap as possible.
My ex-colleague Franck is the inspiration: https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/

I've ordered both the DHT11 and the DS18B20 just to see how accurate each one is, before I'll order one for each room in the house :)

I think I fried one esp-01s already, but not sure if it was the adapter or if it was faulty to start with.
Second one seems to be ok and running from a 9V battery (just to be safe). Can't reach it yet though.

Door Tweakers user Thijsmans, maandag 2 november 2020 13:13

Als je toch niet bewust voor Engels gekozen hebt, ga ik lekker door in 't Nederlands :+

Zowel de DHT11 als de DS18B20 zijn niet bijzonder accuraat. De DHT22 is het betere broertje van de 11 (en is alweer opgevolgd door de 23). Zelf gebruik ik de BME280, al kun je ook de goedkopere BMP280 nemen (zonder luchtdruk). Zie hier:

Thijsmans' Tweakblog: Eerste ervaring met JLCPCB

Precisie van de sensor is trouwens alleen belangrijk als je ook nadenkt over de warmte die de ESP zelf produceert. In bovenstaande blog gebruikte ik de deepsleap functie om de ESP uit te houden tussen metingen, zodat die ook geen warmte produceert.

En 9V op een ESP8266 is vrijwel zeker het einde. 5V is vaak al fataal.

Door Tweakers user _ferry_, maandag 2 november 2020 14:44

Thijsmans schreef op maandag 2 november 2020 @ 13:13:
Als je toch niet bewust voor Engels gekozen hebt, ga ik lekker door in 't Nederlands :+

Zowel de DHT11 als de DS18B20 zijn niet bijzonder accuraat. De DHT22 is het betere broertje van de 11 (en is alweer opgevolgd door de 23). Zelf gebruik ik de BME280, al kun je ook de goedkopere BMP280 nemen (zonder luchtdruk). Zie hier:

Thijsmans' Tweakblog: Eerste ervaring met JLCPCB

Precisie van de sensor is trouwens alleen belangrijk als je ook nadenkt over de warmte die de ESP zelf produceert. In bovenstaande blog gebruikte ik de deepsleap functie om de ESP uit te houden tussen metingen, zodat die ook geen warmte produceert.

En 9V op een ESP8266 is vrijwel zeker het einde. 5V is vaak al fataal.
De DS18B20 niet accuraat?
Max. 0,5*C afwijking bij -10 tot +85, waarbij de mean nog veel dichterbij 0 is: https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf
Tenzij je wetenschappelijke dingen gaat doen, ga je niet veel last hebben van die afwijking.
Bij mij zitten er 2 op de CV leiding, en als die een tijdje niet draait geven ze uiteindelijk precies dezelfde temperatuur aan. Op 0.1*C nauwkeurig.

Door Tweakers user LEiPiE, vrijdag 13 november 2020 10:07

De 9V zit op het sensorboardje, dat als ik het goed heb begrepen 'm netjes naar 3.3V drukt.
Gaat mij inderdaad om simpel een idee te krijgen van de temperatuur op diverse plek in en om huis en vooral eens met dit soort bordjes te spelen :)
Alleen is de tijd nogal schaars, al weer 2 weken niks gedaan. Moet eens wat gestructureerder dingen aanpakken :D

Reageren is niet meer mogelijk