Prerequisites

To build this setup, you will need:

Warning!
The code is in LUA and therefore requires the ESP8266 to have the nodemcu firmware.

Wiring

I2C Diagram

Code

Github

Principle

The principle is as follows:

  1. The ESP creates an MQTT client with a unique id;
  2. It connects to the MQTT broker;
  3. The client subscribes to a specific topic where the desired data is published;
  4. The ESP displays the data on the screen for the first time;
  5. Then each time the MQTT broker receives new data on this topic, our client updates the data on the screen.

Result

I2C Screen