WiFi thermostat project at Github: WiFi thermostat
Support the WiFi thermostat project via PayPal. Support will allow you to add new features in the future and open the source code of the application: PayPal donate
ESP8266 ESP32 WiFi DS18B20 OneWire Dallas HTML Webserver WebSocket JSON mDNS UART

Launch of the WiFi thermostat project - ESP8266 / ESP32

The WiFi thermostat project exists in several versions, which are available on Githube in the repository of the whole project. Versions differ in functionality only in advanced usage options and remote firmware update options. The firmware is available in compiled - binary form, which is executable for the target platform. Therefore, it is tested in advance, compiled for you. The firmware is universal, which guarantees that it will work with the cloned binary program on all microcontrollers in the same way.

The free version is available only in the form of a compiled - binary program without access to an application written in .ino format.

Firmware distribution based on supported WiFi platforms

  • ESP8266 - target platform with ESP8266 chip in versions 12E to 12F (conditioned by flash DIO method)
  • ESP32 - target platform with ESP-32S chip (AI-Thinker), ESP32-WROOM-32 (Espressif Systems)

  • Firmware distribution by function

    Available firmware (.bin) for ESP8266 and ESP32 microcontrollers. Firmware upload is done via esptool - part of the downloaded .zip firmware archive.
    Firmware name Firmware features ESP8266 ESP32
    WiFi_TERMOSTAT Thermostat with the possibility of setting the target temperature and hysteresis via a web interface, controlled automatically ESP8266 EN firmware ESP32 EN firmware
    WiFi_TERMOSTAT_mDNS Thermostat with the possibility of setting the target temperature and hysteresis via a web interface, controlled automatically. Possibility to use a domain name within the LAN network (mDNS record) for connection with thermostat ESP8266 EN firmware ESP32 EN firmware
    WiFi_TERMOSTAT_MANUAL_experimental Thermostat with the possibility of setting the target temperature and hysteresis via a web interface, controlled automatically. Experimental possibility of manual control of SW output by a button from a web server. Switching heating control modes automatic / manual. ESP8266 SK firmware ESP32 SK firmware

    To upload the binary program to the ESP platform, it is necessary to use the ESPTOOL tool. The tool also uses, for example, the Arduino IDE environment for uploading the program after compilation, or the development framework from Espressif Systems - ESP-IDF. For the ESP32 platform, it is necessary to hold the BOOT button until the beginning of the "Connecting ........_____....." recording process, or to do a pulldown on GPIO 0 (if the development kit does not have a BOOT button on the board ). An automated - executable .bat script is prepared in the folder of each firmware (it has a set COM port of the microcontroller set to COM7 for ESP8266 and COM17 for ESP32), which starts the enclosed ESPTOOL and loads the program with the specific firmware located in the given folder.

    Device Manager - Windows - a registered ESP microcontroller

    The destination COM port must be changed based on the COM port on which your board / microcontroller logs in - (can be found via the Peripherals and Drivers Manager on which COM port is ESP logged in). The ESP8266 microcontroller on the NodeMCU / Wemos D1 Mini development kits most often has a CH340 USB-UART converter and also acts in the device manager under this name. In the case of the ESP32 microcontroller, the most commonly used USB-UART converter is CP2102 from Silicon Labs - referred to as the CP210X USB UART Bridge. The program implementation for ESP8266 assumes that the board has loaded the basic parts of the flash memory - the partition table and so on ... The binary program is exclusively a thermostat application without other bundled parts of the program. After loading the program, the ESPTOOL program window automatically shuts down and performs a software restart of the ESP platform, which then boots the new firmware and prepares the WiFi thermostat for use. For the ESP8266 microcontroller, the firmware is written to the standard offset 0x00000 - (the partition table is not part of the firmware, it is not required). The firmware for ESP32 also contains a partition table that is written to offset 0x8000, the bootloader to offset 0x1000. The firmware itself is written to the standard offset 0x10000.

    ESPTOOL - a tool for uploading firmware to the ESP8266 / ESP32 microcontroller
    After successful loading of the binary program - firmware, the thermostat is fully ready for operation.

    If the data on the existing WiFi network is not stored in its flash memory (for example, also from a sketch recorded before), it will start broadcasting its own SSID - WiFi_TERMOSTAT_AP . After connecting to a WiFi network with a smartphone / computer, the WiFi Manager web interface is available at , which provides the option of configuring a WiFi thermostat for your home WiFi network. In the interface it is possible to enter the name and password of the existing WiFi network to which the WiFi thermostat will connect.

    WiFi thermostat is uperational only after successful connection to your LAN network! After assigning an IP address for connectivity on your network.
    After connecting to the home WiFi network, the ESP stops broadcasting the SSID, switches to STA (Station) mode and already works in thermostat mode The entered data about the WiFi network are stored in the flash memory of the thermostat and it is no longer necessary to enter them again when restarting the thermostat, power failure, device restart. If the network is not available, ESP will start broadcasting its own SSID again: WiFi_TERMOSTAT_AP and you can re-enter your credentials. The thermostat is available on its IP address (which it prints every 10 seconds also on the UART), or on the local mDNS -> http: //WiFi-termostat.local . The mDNS service only works after connecting to an existing WiFi network. Once the thermostat is transmitting its own SSID, it is not possible to access the device via a domain name. The program works on the basis of the project wiring diagram and the logic from the description.

    WiFi thermostat settings (ESP8266 / ESP32) via WiFiManager

    WiFi thermostat - ESP8266 / ESP32 - Android - network connection via WiFiManager

    WiFi thermostat - HTTP web server - functional thermostat after connecting to the LAN network

    Refresh the web interface automatically every 30 seconds
    A working WiFi thermostat at an IP address in the local WiFi network available to clients

    WiFiManager - UART output - system information and logic listing

    Output to UART automatically every 10 seconds + temperature measurement on the OneWire bus by the DS18B20 sensor
    ESP - WiFi thermostat - UART statement - system logic - boiler control, assigned IP address in the home LAN