Picture this: a warehouse manager walks past a 55-inch display on the factory floor. The screen is supposed to show real-time OEE (Overall Equipment Effectiveness) and machine uptime. Instead, it's frozen on a stale slide from last month's safety meeting. Someone has to manually update that screen every shift, or worse, it's forgotten for weeks. This is the reality for many companies that rely on Raspberry Pi-driven signage. The hardware is cheap, flexible, and ubiquitous—but the content is static.
What if the display could think for itself? What if an AI agent could decide what to show, when to show it, and pull live data from PLCs, databases, and APIs—all without a human touching a keyboard? That's exactly what ASI Biont makes possible. In this guide, I'll walk through a practical integration between a Raspberry Pi with an HDMI display and ASI Biont, showing code, architecture, and a real-world use case. No prior AI experience needed, but a basic grasp of Python and HTTP will help.
Why HDMI Raspberry Pi? A Quick Primer
The Raspberry Pi is a credit-card-sized computer that costs around $35–75. Pair it with an HDMI monitor, and you have a digital signage player, a dashboard display, or even an interactive kiosk. It's wildly popular in industrial and retail settings because it's low-power, silent, and runs Linux. Typical uses include:
- Factory dashboards showing KPIs like OEE, downtime, and scrap rate
- Retail promotional screens that rotate offers based on time of day
- Conference room booking displays that sync with calendar systems
- Public transit information boards that pull data from city APIs
But the Raspberry Pi on its own is dumb. It can run a Chromium webpage in kiosk mode, but someone has to configure that webpage or update the content. ASI Biont is an AI agent that can generate Python code on the fly, connect to almost any device, and orchestrate data flows. When you combine the two, you get a screen that updates itself based on live conditions.
Choosing the Right Integration Protocol
ASI Biont supports a broad set of protocols: COM port (RS-232/485), MQTT, Modbus/TCP, SSH, HTTP API/WebSocket, OPC-UA, Siemens S7, BACnet, EtherNet/IP, CAN bus, gRPC, CoAP, and a universal execute_python method. For a Raspberry Pi showing a dashboard, the most straightforward approach is HTTP API.
Why HTTP API? Because the Pi can run a simple web server (Flask or FastAPI) that exposes an endpoint like POST /display. ASI Biont's Python client then sends a JSON payload with the content to display. This is stateless, easy to debug, and works over any IP network—even across the internet with proper security. For lower latency or two-way communication, WebSocket is a good alternative. But for most dashboard use cases, a simple POST request every few seconds is more than enough.
If you're already running MQTT in your factory, ASI Biont can publish to an MQTT topic that your Pi subscribes to. That's also a valid approach. But I'll focus on HTTP here since it's the most universal and requires zero extra software beyond a tiny Flask app.
Step-by-Step Implementation
Prerequisites
- A Raspberry Pi (any model from 3B+ upward) connected to an HDMI display
- Raspberry Pi OS (or any Linux distro) with Python 3.8+
- The Pi's IP address reachable from the machine running ASI Biont
- An ASI Biont account with access to
execute_python(you'll get this from the dashboard)
Phase 1: Write a Minimal Display Server on the Pi
The Pi needs a small server that accepts updated content and renders it. Here's a minimal Flask app that reads a JSON payload and displays it as a full-screen web page.
# display_server.py on Raspberry Pi
from flask import Flask, request, render_template_string, jsonify
import threading
app = Flask(__name__)
# Global content state (protected by a lock)
content_state = {
'title': 'Factory Dashboard',
'oee': '—',
'uptime': '—',
'scrap': '—'
}
lock = threading.Lock()
HTML_TEMPLATE = '''
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="5">
<style>
body { font-family: Arial, sans-serif; background: #111; color: #eee; padding: 2em; }
h1 { color: #4CAF50; }
.kpi { display: inline-block; margin: 20px; padding: 20px; border: 2px solid #333; }
.value { font-size: 3em; font-weight: bold; }
</style>
</head>
<body>
<h1>{{ title }}</h1>
<div>
<div class="kpi">OEE <div class="value">{{ oee }}</div></div>
<div class="kpi">Uptime <div class="value">{{ uptime }}%</div></div>
<div class="kpi">Scrap <div class="value">{{ scrap }}</div></div>
</div>
</body>
</html>
'''
@app.route('/', methods=['GET'])
def home():
with lock:
return render_template_string(HTML_TEMPLATE, **content_state)
@app.route('/display', methods=['POST'])
def update_display():
data = request.get_json()
with lock:
if 'title' in data: content_state['title'] = data['title']
if 'oee' in data: content_state['oee'] = data['oee']
if 'uptime' in data: content_state['uptime'] = data['uptime']
if 'scrap' in data: content_state['scrap'] = data['scrap']
return jsonify({'status': 'ok'})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
Save this as display_server.py, install Flask (pip install flask), and run it with python display_server.py. To make it persistent, add it to systemd or run it in a tmux session. Test it by visiting http://<pi-ip>:5000 and POSTing a sample payload with curl.
Phase 2: Ask ASI Biont to Connect and Update the Display
Now comes the magic. Instead of writing a Python client yourself, you describe the task in the ASI Biont chat. For example:
“Connect to my Raspberry Pi at 192.168.1.50 via HTTP API. Every 30 seconds, fetch the OEE and uptime data from the Modbus server at 192.168.1.10 (register 1 and 2) and update the display by POSTing
{'oee': .92, 'uptime': .98, 'scrap': 15}to/displayon port 5000.”
ASI Biont translates this into a working Python script using aiohttp and pymodbus. The script runs inside a sandbox with a 30-second timeout per execution. For recurring tasks, ASI Biont schedules a new execution every 30 seconds, so the while loop is not needed.
Phase 3: The AI-Generated Integration Script
Here’s a representative script that ASI Biont might generate using execute_python:
import asyncio
from pymodbus.client import AsyncModbusTcpClient
import aiohttp
async def update_display():
# Read data from Modbus PLC
modbus_client = AsyncModbusTcpClient('192.168.1.10', port=502)
await modbus_client.connect()
rr = await modbus_client.read_holding_registers(1, 2, unit=1)
if rr.isError():
print('Modbus read failed')
return
oee = rr.registers[0] / 1000 # scale to percentage
uptime = rr.registers[1] / 1000
# Send to Raspberry Pi display
payload = {'oee': oee, 'uptime': uptime, 'scrap': 12}
async with aiohttp.ClientSession() as session:
async with session.post('http://192.168.1.50:5000/display', json=payload) as resp:
print('Status:', resp.status)
asyncio.run(update_display())
This is a simplified version—AI might split it into functions, add error handling, or use a different Modbus register mapping. The point is that you don’t have to write it. You only need to describe the data source and the target endpoint. ASI Biont generates the integration in seconds, and it works with any device that can be reached via TCP/IP, serial, or even CAN bus.
If your Pi doesn’t have a Flask server yet, you can also ask ASI Biont to deploy the server script via SSH. It uses paramiko to connect and write the file, then starts it as a background process. But for this article, we assume the server is already running.
Real-World Use Case: Factory OEE Board
Let me give you a concrete example from a mid-sized manufacturing plant that produces injection-molded parts. They had a Raspberry Pi display in the production area showing OEE data, but it was manually updated by a team lead every morning. After integrating with ASI Biont, the workflow became fully automated:
- Data source: The injection molding machines are connected to a PLC that publishes OEE, cycle time, and scrap count over Modbus/TCP.
- Display: A Raspberry Pi drives a 49-inch HDMI TV in the factory cafeteria and another one on the production floor.
- AI agent: ASI Biont is configured with two scheduled tasks—one reads Modbus registers every 10 seconds, and another updates the display with a new dashboard every 30 seconds.
- Dynamic logic: The AI agent also checks the time of day. During shift changes, it displays a safety briefing message instead of the live dashboard. On weekends, it shows an energy-saving screen with the next shift schedule.
The team lead now focuses on continuous improvement instead of updating slides. The maintenance manager can walk past any screen and see live data without logging into a computer. The plant reported a noticeable reduction in downtime—managers were alerted to slow cycles within minutes rather than at the end of the day.
Alternative Protocols: SSH, MQTT, and WebSocket
While HTTP API is clean, there are scenarios where other protocols shine:
- SSH: If you need to execute a command on the Pi—like rebooting it, changing the browser URL, or installing software—ASI Biont can connect via SSH using
paramiko. This is useful for remote configuration. - MQTT: If your Pi is already subscribed to an MQTT topic for other sensors, the AI agent can publish display updates to a topic like
factory/oee/display. The Pi runs an MQTT client that renders incoming JSON. - WebSocket: For real-time collaborative dashboards (e.g., multiple clients), WebSocket eliminates HTTP polling overhead. ASI Biont supports
aiohttpWebSocket clients.
Here’s an example of an MQTT subscription on the Pi:
# On Raspberry Pi using paho-mqtt
import paho.mqtt.client as mqtt
import json
def on_message(client, userdata, msg):
data = json.loads(msg.payload.decode())
update_display(data) # function that changes the web page
client = mqtt.Client()
client.connect('mqtt-broker.local')
client.subscribe('factory/oee/display')
client.on_message = on_message
client.loop_forever()
But for most users, HTTP is the best starting point because it’s easy to debug and you don’t need to set up a broker.
The Power of execute_python: Connect to Anything
One of the most liberating aspects of ASI Biont is the execute_python protocol. You don’t have to wait for a vendor to build a “Raspberry Pi connector” or a “digital signage integration.” If you can describe the communication logic in plain English, ASI Biont will write a Python script that runs in its sandbox and interacts with your device. It can use pyserial for a COM port, paramiko for SSH, paho-mqtt for MQTT, pymodbus for Modbus/TCP, aiohttp for HTTP, or opcua-asyncio for OPC-UA. The user simply supplies the connection parameters (IP, port, baud rate, API key, etc.) and describes the data flow.
For example, if you have a sensor on an Arduino connected via USB to a Raspberry Pi, you can ask ASI Biont: “Read the temperature from the Arduino serial port on the Pi and show it on the HDMI display.” It will generate a script that uses pyserial to parse the serial stream and aiohttp to update the Flask server. No new hardware or vendor SDK required.
This is a major shift from traditional integration platforms that require an “integration wizard” or custom plugins. ASI Biont treats the integration as a natural language conversation. It’s like having a senior embedded engineer on standby who writes tested Python code for you.
Security Considerations
With any networked integration, you should be mindful of security. When you expose a Flask server on the Raspberry Pi, limit access to your local network or implement an API key. For instance, modify the /display endpoint to check a token in the POST header. ASI Biont can include that token in the script it generates. Also consider using SSH tunneling for remote displays. Many factories isolate this kind of dashboard network from the main corporate IT to reduce risk.
Why This Matters: Time and Flexibility
Traditional integration requires a developer to write glue code, test it, and maintain it. ASI Biont does that in seconds and adapts to changes instantly. If you move the Pi to a new IP, you just tell the AI. If you add a new display, you simply describe it. The result is not just a cost saving—it’s a qualitative change in how fast you can deploy new visualizations.
A dashboard that takes a week to build with a traditional software team can now be up in an afternoon. And because the AI agent can pull data from multiple protocols (Modbus, MQTT, OPC-UA) simultaneously, you can create a single pane of glass that unifies data from machines that previously spoke different languages.
Ready to Try It?
If you have a Raspberry Pi lying around and a screen that could be smarter, visit asibiont.com and open the chat. Describe your device, its IP or port, and what you want to display. ASI Biont will generate the integration code and even schedule recurring updates. You’ll be amazed by how fast a static screen becomes a living, data-driven dashboard.
The HDMI Raspberry Pi is just one example. The same approach works for COMs, PLCs, robots, and sensors. With ASI Biont, every device in your facility is one conversation away from being AI-controlled.
Comments