Industrial IoT (IIoT) gateways are the backbone of modern manufacturing, energy, and logistics. These devices aggregate data from sensors, PLCs, and controllers, translate diverse industrial protocols (Modbus, OPC-UA, BACnet, EtherNet/IP), and forward it to cloud or on-premises systems. However, traditional gateways are passive – they collect and route data, but lack the ability to dynamically adapt, analyze, or trigger corrective actions without human intervention. Enter ASI Biont, an AI agent that connects directly to IIoT gateways via multiple methods, turning them into intelligent edge nodes that can diagnose anomalies, optimize processes, and even write their own control logic on the fly.
This article explores how ASI Biont integrates with industrial IoT gateways using real protocols, provides concrete code examples, and demonstrates why this fusion is a game-changer for lean automation. Whether you're connecting an ESP32 via MQTT, a Siemens S7 PLC via Snap7, or a GPS tracker via a COM port, ASI Biont writes the integration code in seconds through a simple chat conversation.
The Integration Philosophy: Chat, Don’t Configure
ASI Biont does not offer a drag-and-drop dashboard or a device catalog. Instead, the user describes their device and connection parameters in plain English (or code). The AI agent generates and executes the appropriate Python script using the industrial_command tool or execute_python sandbox. Supported connection methods include:
- Hardware Bridge for local COM ports (RS-232/485, Arduino, GPS)
- SSH for single-board computers (Raspberry Pi, BeagleBone)
- MQTT for IoT sensors and actuators
- Modbus/TCP for PLCs and industrial controllers
- Snap7 for Siemens S7 PLCs
- BACnet for building management systems
- EtherNet/IP for Rockwell/Allen-Bradley controllers
- CAN bus for vehicles and machinery
- gRPC, CoAP, HTTP API, WebSocket, OPC-UA for diverse devices
The AI can also use execute_python – a sandboxed Python environment with dozens of pre-installed libraries (pyserial, pymodbus, paho-mqtt, opcua-asyncio, paramiko, etc.) – to craft custom integration scripts for any device that communicates via a network protocol.
Let’s examine six concrete use cases that showcase the power of this approach.
1. ESP32 + DHT22 via MQTT – Smart Temperature Monitoring
Device: ESP32 microcontroller with a DHT22 temperature and humidity sensor, publishing data to an MQTT broker (e.g., Mosquitto).
Problem: Facility managers need to monitor environmental conditions across multiple zones and receive alerts when thresholds are breached. Manual setup of cloud dashboards is time-consuming.
ASI Biont solution: The user tells the AI: “Connect to MQTT broker at 192.168.1.100:1883, subscribe to topic sensor/room1, parse temperature and humidity, and alert me via Telegram if temp > 30°C.”
The AI generates a Python script using paho-mqtt and executes it in the sandbox:
import paho.mqtt.client as mqtt
import json
import requests
# Telegram bot token and chat ID (configured by user)
BOT_TOKEN = 'your_token'
CHAT_ID = 'your_chat_id'
def on_message(client, userdata, msg):
data = json.loads(msg.payload.decode())
temp = data['temperature']
if temp > 30:
message = f"🚨 Temperature alert in Room 1: {temp}°C"
requests.post(f'https://api.telegram.org/bot{BOT_TOKEN}/sendMessage',
json={'chat_id': CHAT_ID, 'text': message})
client = mqtt.Client()
client.on_message = on_message
client.connect('192.168.1.100', 1883, 60)
client.subscribe('sensor/room1')
client.loop_forever() # sandbox timeout 30s – designed as a quick test
Note: The sandbox has a 30-second timeout, so the script is used for testing logic. For production, the same code can be deployed on the gateway itself. The user verifies that the alert fires correctly.
Results: Previously, setting up a MQTT subscriber with alerting required writing a custom service, installing dependencies, and handling errors. ASI Biont completed the integration in under 60 seconds. The facility now receives real-time alerts without any dashboard configuration.
2. Raspberry Pi + Camera via SSH – Edge Computer Vision
Device: Raspberry Pi 4 with a USB camera, running Raspberry Pi OS. Python and OpenCV are installed.
Problem: A warehouse wants to detect when packages fall off conveyors. A local AI vision model would be ideal, but deploying it manually involves SSH sessions, script uploads, and maintenance.
ASI Biont solution: The user says: “SSH to raspberrypi.local (user: pi, password: raspberry), run a Python script that captures frames from /dev/video0, applies a pre-trained YOLO model (tiny-yolo.weights on the Pi), and if a person is detected, save the image to /home/pi/alerts.”
The AI connects via paramiko (inside execute_python) and executes the script on the Pi:
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('raspberrypi.local', username='pi', password='raspberry')
# Write and run a Python script that uses OpenCV
command = """
python3 << 'EOF'
import cv2
import time
cap = cv2.VideoCapture(0)
net = cv2.dnn.readNet('tiny-yolo.weights', 'tiny-yolo.cfg')
ret, frame = cap.read()
if ret:
blob = cv2.dnn.blobFromImage(frame, 0.00392, (416,416), (0,0,0), True)
net.setInput(blob)
detections = net.forward()
for detection in detections:
scores = detection[5:]
class_id = np.argmax(scores)
if scores[class_id] > 0.5 and class_id == 0:
cv2.imwrite('/home/pi/alerts/person.jpg', frame)
print('Person detected')
cap.release()
EOF
"""
stdin, stdout, stderr = ssh.exec_command(command)
print(stdout.read().decode())
ssh.close()
The AI sends the script to the sandbox, which uses paramiko to run it on the Pi. The output is returned to the user.
Results: The integration eliminates manual script deployment. The AI handles error checking (e.g., if OpenCV is missing, it suggests installing it). Warehouse operators now get instant alerts with images when a person enters a restricted zone.
3. Modbus/TCP PLC – Automated Batch Control
Device: An industrial PLC (e.g., Siemens S7-1200 or WAGO) with Modbus/TCP enabled. Holding registers 0-9 store temperature setpoints; coil 0 controls the main pump.
Problem: A chemical plant needs to adjust setpoints based on real-time analytics – for example, reduce heating when electricity prices spike. Manual tweaking is slow.
ASI Biont solution: The user connects via Modbus/TCP using the industrial_command tool. They instruct: “Read register 0 (setpoint) every 5 minutes. If electricity price (fetched from an API) > $0.12/kWh, write 10% lower value to register 0.”
The AI uses the industrial_command tool:
industrial_command(
protocol='modbus',
command='read_registers',
params={
'host': '192.168.1.50',
'port': 502,
'start_address': 0,
'count': 1
}
)
Then the AI writes a Python script (via execute_python) that loops (respecting sandbox timeout) to fetch price, compare, and write:
import requests
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient('192.168.1.50')
client.connect()
# Read current setpoint
result = client.read_holding_registers(0, 1, unit=1)
current_setpoint = result.registers[0] if not result.isError() else 50
# Fetch electricity price from public API
price = requests.get('https://api.electricityprice.com/current?zone=DE').json()['price']
if price > 0.12:
new_setpoint = int(current_setpoint * 0.9)
client.write_register(0, new_setpoint, unit=1)
print(f"Reduced setpoint from {current_setpoint} to {new_setpoint}")
else:
print(f"Price {price} is OK, no change")
client.close()
Results: The plant now automatically optimizes energy consumption without human intervention. The AI handles connection errors, retries, and logs actions. Over a month, energy costs decreased by an estimated 8% (based on utility bills).
4. Arduino via COM Port – Real-Time Sensor Logging
Device: Arduino Uno connected to a PC via USB (virtual COM port COM3 at 115200 baud). The Arduino sends a reading every second in format: T:25.3 H:60.1\n.
Problem: A lab needs to log readings to a file and trigger a buzzer if humidity exceeds 80% – but the lab technician has no programming experience.
ASI Biont solution: The user runs bridge.py on their Windows PC (downloaded from ASI Biont dashboard). It connects to the cloud via WebSocket with token. Then in chat, the user says: “Connect to COM3 at 115200 baud, read the serial data, parse temperature and humidity, log to a CSV file, and if humidity > 80, send command ‘BUZZER_ON’ to the Arduino.”
The AI uses the industrial_command tool with serial protocol:
industrial_command(
protocol='serial',
command='serial_write_and_read',
params={
'data': '', # read without writing
'bridge_token': 'your_token'
}
)
But for continuous monitoring, the AI writes a Python script that runs in the sandbox and communicates with the bridge via WebSocket (the only method). However, the bridge doesn't expose an HTTP API – the AI uses the chat-based serial_write_and_read command to poll the Arduino. To automate, the user can instruct: “Every 10 seconds, read the serial port and check humidity.” The AI sets up a repeating task (using ASI Biont's built-in scheduler, not described in detail here).
Upon exceeding threshold, the AI sends:
industrial_command(
protocol='serial',
command='serial_write_and_read',
params={
'data': '42555a5a45525f4f4e0a', # BUZZER_ON in hex
'bridge_token': 'your_token'
}
)
Results: The lab now has an automated logging system with alerts, all set up through a chat conversation. The technician doesn't need to write any code – the AI handles the hex conversion, baud rate, and error handling.
5. OPC UA Server – Predictive Maintenance
Device: An OPC UA server in a factory exposing variables: temperature (ns=2;i=100), vibration (ns=2;i=101), runtime hours (ns=2;i=102).
Problem: Equipment failures cause downtime. The maintenance team wants to predict failures by analyzing trends – but building an OPC UA client requires understanding of namespaces, node IDs, and async programming.
ASI Biont solution: The user provides the server endpoint (opc.tcp://192.168.1.200:4840) and says: “Read temperature and vibration every minute, store in a local SQLite database, and if the derivative of temperature exceeds 5°C per minute, alert the team.”
The AI uses the industrial_command tool with protocol='opcua' to read variables:
industrial_command(
protocol='opcua',
command='read_variable',
params={
'host': '192.168.1.200',
'port': 4840,
'node_id': 'ns=2;i=100'
}
)
Then it creates a Python script (execute_python) that repeatedly reads and stores data (with sandbox constraints, it logs a few samples). The same logic can be exported as a standalone script.
Results: Within minutes, the maintenance team has a trend analysis tool. The AI also generated a chart showing how vibration increased before a bearing failure in historical data (provided by user). Predictive maintenance rules are now in place, reducing unplanned downtime.
6. CAN Bus – Vehicle Diagnostics
Device: A CAN bus interface (e.g., USBtin or PCAN) connected to a vehicle's OBD-II port. The vehicle sends CAN frames with IDs 0x7DF (OBD request) and 0x7E8 (response).
Problem: A fleet manager wants to read engine RPM and coolant temperature from all vehicles, but CAN bus programming is complex.
ASI Biont solution: The user connects the CAN interface to a Raspberry Pi that runs bridge.py (Hardware Bridge doesn't handle CAN directly, but the AI can use execute_python with python-can on a remote machine). Alternatively, the user can run a Python script on their PC that uses python-can to read from the virtual CAN interface. The AI writes the script:
import can
bus = can.interface.Bus(bustype='socketcan', channel='can0', bitrate=500000)
while True: # sandbox will stop after 30s
msg = bus.recv()
if msg.arbitration_id == 0x7E8:
if msg.data[0] == 0x41 and msg.data[1] == 0x0C: # RPM response
rpm = (msg.data[2] * 256 + msg.data[3]) / 4
print(f"RPM: {rpm}")
Results: The fleet manager now gets real-time RPM alerts via Telegram when values exceed safe limits. The AI automatically decodes the CAN payload according to ISO 15765-2.
The Universal Enabler: execute_python
All the above examples rely on the AI's ability to write and run arbitrary Python code. The sandbox (execute_python) includes 30+ pre-installed libraries covering industrial protocols, database access, cloud APIs, and machine learning. Users can describe any device with a network interface or serial port, and the AI will generate the appropriate client code. No waiting for plugin development – the integration happens instantly in the chat.
For local COM port access, bridge.py must be running on the user's PC (downloaded from the ASI Biont dashboard, not from GitHub). The bridge connects to the cloud via WebSocket; the AI sends commands through the industrial_command tool, which routes them to the bridge. The bridge then handles the serial transaction using pyserial, with robust error handling on Windows (CancelIoEx + PurgeComm + synchronous WriteFile).
Conclusion: The Gateway Becomes an Intelligent Edge
Industrial IoT gateways no longer just transport data – they become the execution arm of an AI agent. ASI Biont's integration approach reduces the barrier to automation: instead of months of development, a single chat conversation yields a working integration with error handling, logging, and alerts. Whether you're monitoring a pump via Modbus, tracking a vehicle via CAN bus, or analyzing sensor data via OPC UA, the AI writes the code, connects the protocols, and delivers actionable insights.
Try it yourself. Go to asibiont.com, create an API key from the Devices section, download bridge.py for your local COM ports, and start a chat. Describe your Industrial IoT gateway – ASI Biont will connect it in seconds. No dashboards, no plugins – just pure AI-powered automation.
Comments