They are also really capable processors on their own with some nice I/O, and they can be integrated to be really low power so things can run on battery power for months to years.
Can they really last that long (on their own)? I looked into this when the ESP8266 first became popular maybe 4 years ago as I wanted to build WiFi temperature and humidity sensors. My calculations were that a set of AAA rechargable batteries (~2000mAh) would last a few days at most, with the device in deep sleep most of the time and waking up every 10 mins to take a reading and send it over WiFi.
Right now I'm looking to create smart blinds. The motors don't use that much power, but the issue is the MCU listening for commands. The ESP32 support BLE, but it's power consumption is still rather high, so batteries would only last a few days at most.
Personal experience: I have a ESP32 that runs as a sort of weather station. It has a ~2000mAh battery and lasts almost 2 months, getting a data point once every 30 minutes. That is using the ESPHome to program it.
Even at once every 10 minutes, it should manage almost 3 weeks without requiring a recharge.
Some options that definitely help is to quicken the Wifi reconnect. ESPHome has options to disable AP scanning and doing a fast-and-dirty connect&send. Using MQTT also helped a lot compared to using HTTP.
The most important part is to reduce the on-time as much as possible. 30 seconds is still way above the lower limit that I can do. If you halve it you can double the amount of data points without additional energy by reducing the sleep time.
I'm working on replacing the battery with a solar panel and supercap to power it from ambient shadow light entirely, the numbers to agree that it is possible in my case. Would help to keep it alive in cold weather.
Ah ha, that's good to know! Yeah in my case I had a small solar panel (a few quid of eBay, I guess around 1W) which was able to power it through a British winter (it did get direct sunlight though). I had some rechargable AAA batteries and just wired the solar panel in parallel with them.
After a few months it stopped working, I think some moisture got in and the DHT11 failed.
I was able to power ESP-12E based humidity and temperature sensor for about 6 months from 18650 cell. I've used deep sleep and 15 minutes intervals between readings.
Not totally sure about the ESP8266. I used a WiFly RN131 in a sensor product that woke up every 15 minutes and sent a reading. AA batteries lasted probably 18 months.
Biggest problem we found was enterprise networks would randomly kick you off if you were using DHCP. I think because they would assume that if you hadn't transmitted in five to ten minutes it meant you'd gone away. Using static IP fixed that.
Edit: Friend of mine that mucks with ESP8266's uses the low power timer to reset and wake the device up out of deep sleep. (Via a simple hack I think just connecting a timer pin to the reset).
Star-mesh topology, with batteries on the leaf nodes. Solar further in. Excerpt: "I’m expecting about 3 months at a 5min log interval using a 2000mAh lipo battery."