ESP8266

In this chapter, we will install and configure a firmware called ESP-link on an ESP8266 SoC that connects an Arduino Mega2560 to the local WiFi. ESP-link is a small firmware packing features like hosting a WiFi hotspot, fetching date and time over the internet, a web server, MQTT client, REST API support, and an option to relay the serial output of the Arduino to its web console.

This chapter splits into:

  • Mega2560 WiFi: Hardware option 1 - Installing ESP-link on a special board with an Arduino Mega2560 and ESP8266 with 32Mbit (4MB) built-in flash.

  • ESP-01S: Hardware option 2 - Installing ESP-link on an ESP-01S with 8Mbit (1MB) built-in flash

  • ESP-link setup: Configuring ESP-link features

  • Google Sheets logging: Logging option 1 - Store data in Google Sheets using the REST API

  • MQTT: Logging option 2- Store data in a local database hosted by Home Assistant using the MQTT protocol

Flash storage

ESP-link supports multiple ESP8266 flash storage sizes with some limitations:

  • 4 Mbit (0.5MB): Single partition, no over-the-air update support.

  • 8 Mbit (1MB): Two partitions for updating the ESP-link firmware over the Web interface

  • 32 Mbit (4MB): Required for hosting custom Web pages for the Arduino Modules

Screenshots

The user interface of ESP-link is hosted as a web page on the local WiFi network.

Home - Gives an overview of the current status of ESP-link and allows changing the pin assignment of the ESP SoC:

WiFi Station - For configuring the local WiFi connection:

WiFi Soft-AP - When the ESP-link cannot connect to a local network it creates its own WiFi Access Point.

µC Console - Monitors the serial output of the attached Arduino (also has a button to reset it):

Custom user interface for controlling the Arduino. Minimum 16Mbit (2MB) flash is needed for hosting custom web-pages!