This is the code for the How to Run Your ESP8266 for Years on a Battery article on the Open Home Automation website. In this article, I will show you how to significantly reduce the power consumption of your ESP8266 boards using the deep sleep mode of the chip, so you can build projects that will last for years on a single battery.
You can find the article on our website: