E-Ink Waveshare Display + ASI Biont AI: Build a Smart Information Dashboard in Minutes

E-Ink Waveshare Display + ASI Biont AI: Build a Smart Information Dashboard in Minutes

E‑ink displays are loved for their ultra‑low power consumption and excellent readability in sunlight, but they become truly powerful when driven by an AI agent that curates and formats the content in real time. In this guide we’ll integrate a Waveshare e‑Paper display (any size) with the ASI Biont AI agent using an ESP32 and MQTT. The result: a dynamic information board that shows weather, calendar events, task reminders, and notifications – all without writing a single line of glue code yourself. The AI handles the logic, the API calls, and the message formatting; you just describe what you want in plain language.

Why Connect an E‑Ink Display to an AI Agent?

E‑ink screens are static by nature – they only update when you send new data. An AI agent can decide when to refresh, what to display, and how to lay out the information based on context (time of day, incoming alerts, user preferences). Instead of hard‑coding a weather API call and a task list parser, you simply tell the AI: “Show today’s forecast and my three top‑priority tasks on the e‑ink display.” The AI fetches the data, formats a JSON payload, and publishes it to the display via MQTT. This makes the dashboard adaptable to any data source without firmware changes.

Connection Method: MQTT over Wi‑Fi

We use MQTT – a lightweight pub/sub protocol ideal for IoT. The ESP32 runs a MicroPython script that connects to a public broker (e.g., broker.hivemq.com) and subscribes to a topic like display/update. ASI Biont’s execute_python sandbox runs a script that uses paho-mqtt to publish JSON messages to that same topic. The AI agent itself writes both sides of the integration dialogue: it generates the MicroPython code for the ESP32 (which you flash once) and the Python publisher script (which runs in the cloud every time you request a new display).

This approach works without any bridge software – the ESP32 talks directly to the broker, and the AI talks to the same broker. No serial cables, no local PC required.

Real‑World Scenario: Smart Information Display

Imagine an e‑ink screen mounted on your wall or desk. At 7:00 AM it shows the day’s weather, your top three tasks, and a motivational quote. At noon it switches to a meeting agenda. If an urgent notification arrives (e.g., “Server CPU > 90%”), the AI pushes an alert to the display immediately.

What You Need

  • Waveshare e‑ink display (any SPI model, e.g., 2.13", 4.2", 7.5")
  • ESP32 development board (ESP32‑DevKitC, NodeMCU‑32S, etc.)
  • Jumper wires (3.3V logic – note that most Waveshare displays run on 3.3V)
  • MicroPython firmware on the ESP32 (or Arduino – we show MicroPython for brevity)
  • MQTT broker (public or self‑hosted; we use broker.hivemq.com)
  • ASI Biont account (asibiont.com) with API access

Step 1: Wiring (Example for Waveshare 2.13" V4)

ESP32 Pin E‑Ink Display
3.3V VCC
GND GND
GPIO 18 DIN (MOSI)
GPIO 23 CLK (SCK)
GPIO 5 CS
GPIO 17 DC
GPIO 16 RST
GPIO 4 BUSY

Double‑check your specific Waveshare model’s pinout – the principle is SPI with additional control pins.

Step 2: MicroPython Firmware on the ESP32

We’ll write a simple script that connects to Wi‑Fi, subscribes to display/update, and on receiving a JSON payload, parses it and draws text on the e‑ink screen. The full driver for Waveshare e‑ink displays is available as a MicroPython module (e.g., epaper2in13.py). Upload it together with main.py.

# main.py on ESP32
import network
import time
import json
from machine import Pin, SPI
import epaper2in13  # Waveshare driver for 2.13"
from umqtt.simple import MQTTClient

# Wi‑Fi credentials – store securely or use environment
WIFI_SSID = "YourSSID"
WIFI_PASS = "YourPassword"

# MQTT broker
BROKER = "broker.hivemq.com"
TOPIC = b"display/update"

# Initialize e‑ink display
spi = SPI(2, baudrate=2000000, polarity=0, phase=0, sck=Pin(23), mosi=Pin(18))
cs = Pin(5, Pin.OUT)
dc = Pin(17, Pin.OUT)
rst = Pin(16, Pin.OUT)
busy = Pin(4, Pin.IN)

display = epaper2in13.EPD(spi, cs, dc, rst, busy)
display.init()

def draw_content(data):
    """Clear display and draw lines of text from a JSON array."""
    display.clear()
    lines = data.get("lines", [])
    y = 10
    for line in lines:
        display.text(line, 10, y, 0)  # black text on white
        y += 20
    display.display()
    display.sleep()  # deep sleep to save power

def callback(topic, msg):
    try:
        payload = json.loads(msg)
        draw_content(payload)
        print("Display updated")
    except Exception as e:
        print("Error:", e)

# Connect Wi‑Fi
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(WIFI_SSID, WIFI_PASS)
while not wlan.isconnected():
    time.sleep(1)
print("Wi‑Fi connected")

# Connect MQTT
client = MQTTClient("esp32_epaper", BROKER)
client.set_callback(callback)
client.connect()
client.subscribe(TOPIC)
print("Subscribed to", TOPIC)

while True:
    client.wait_msg()  # blocks until message arrives
    # after drawing, we could deep sleep, but keep listening for next update

Upload this script and the driver module to the ESP32 using ampy or Thonny. The device will now wait for MQTT messages.

Step 3: AI Agent Publishes Content via ASI Biont

Now the magic part. Open the ASI Biont chat and describe what you want displayed. For example:

“Connect to MQTT broker broker.hivemq.com. Subscribe to no topics, but publish to topic display/update. Fetch current weather for London from OpenWeatherMap (API key: YOUR_API_KEY), get the top 3 tasks from my Google Tasks (use the Google API token I configured earlier), and combine them into a JSON payload with a lines array. Publish the payload to the topic. Keep the message concise – no more than 6 lines.”

The AI agent will generate a Python script that runs inside the execute_python sandbox. It uses paho-mqtt, requests, and any API libraries available in the sandbox. The script will:

  1. Call OpenWeatherMap API to get current conditions.
  2. Retrieve tasks from Google Tasks (or any source you’ve linked).
  3. Build a JSON object like:
    json { "lines": [ "London: 18°C, Cloudy 🌤", "Tasks:", "1. Finish report", "2. Call plumber", "3. Buy groceries" ] }
  4. Publish it to display/update.

The AI writes the complete code and executes it. If you want a different layout or additional data (e.g., a motivational quote), just ask.

Example AI‑generated publisher script (simplified):

import paho.mqtt.publish as publish
import requests
import json

# Fetch weather
weather_api = "https://api.openweathermap.org/data/2.5/weather?q=London&appid=YOUR_API_KEY&units=metric"
weather_resp = requests.get(weather_api).json()
temp = weather_resp["main"]["temp"]
cond = weather_resp["weather"][0]["description"]

# Fetch tasks (mock – replace with real API call)
tasks = ["Finish report", "Call plumber", "Buy groceries"]

# Build payload
lines = [
    f"London: {temp}°C, {cond}",
    "Tasks:"
]
for i, t in enumerate(tasks[:3], 1):
    lines.append(f"{i}. {t}")

payload = {"lines": lines}

# Publish
publish.single("display/update", json.dumps(payload), hostname="broker.hivemq.com")
print("Published successfully")

The AI delivers this script to the sandbox, which runs it and publishes the message. Your e‑ink display updates within seconds.

Why This Is Revolutionary

  • Zero manual integration code: You never write a Python script yourself. The AI understands your natural language request, fetches data from any API, formats the output, and sends it via MQTT.
  • Any data source: Weather, tasks, calendar, stock prices, server metrics, news headlines – as long as the AI can access an API, it can push it to the display.
  • Dynamic scheduling: Ask the AI to “update the display every hour” – it will use a scheduler (or you can set a cron job on your own server) to run the script periodically.
  • Adaptable layout: Ask for “larger text on the first line” or “show a progress bar for my daily step goal” – the AI adjusts the JSON structure accordingly.

ASI Biont connects to any device through execute_python – the AI writes the integration code on the fly. There are no “supported device” lists; if you can connect it via MQTT, HTTP, Modbus, OPC‑UA, SSH, or a dozen other protocols, the AI generates the right script. You just explain in the chat what to connect and what parameters to use.

Conclusion: From “Smart Display” to Truly Intelligent Display

An e‑ink screen driven by an AI agent is no longer a static picture frame – it becomes a context‑aware assistant that anticipates what information you need and when. With ASI Biont, setting up this integration takes minutes, not days. Describe your desired dashboard, and the AI handles the rest: fetching, formatting, and publishing.

Try it yourself – head over to asibiont.com, create an account, and tell the AI to connect your Waveshare E‑Ink display. Watch as it automatically generates both the firmware snippet and the cloud publisher script. You’ll have a working smart dashboard before your coffee gets cold.

← All posts

Comments