Industrial IoT Gateways + ASI Biont: How to Connect Legacy Factory Equipment to an AI Agent in Minutes

Why Industrial IoT Gateways Are the Missing Link in Smart Manufacturing

Industrial IoT gateways sit at the edge of factory networks, bridging legacy PLCs, sensors, and controllers with modern cloud or on-premise systems. According to a 2025 IoT Analytics report, over 60% of industrial equipment still relies on serial protocols (RS-232/RS-485) or older fieldbuses, making them invisible to AI-driven analytics without a gateway. ASI Biont’s AI agent connects directly to these gateways—via Modbus/TCP, MQTT, OPC-UA, or even raw COM ports through a Hardware Bridge—to read real-time data, detect anomalies, and issue control commands. No dashboard configuration, no pre-built integrations. You just describe your gateway in plain English, and the AI writes the Python code to talk to it.

Which Connection Method Should You Use?

Different gateways expose different interfaces. Here’s how ASI Biont matches them:

Gateway Type Typical Interface ASI Biont Method Protocol Used
Serial-to-Ethernet (e.g., USR-TCP232) RS-232/RS-485 on COM port Hardware Bridge + industrial_command serial://
Modbus TCP gateway (e.g., Moxa MGate) Ethernet, Modbus/TCP industrial_command read_registers, write_register
MQTT-enabled gateway (e.g., Advantech WISE) Ethernet, MQTT execute_python with paho-mqtt MQTT subscribe/publish
OPC-UA gateway (e.g., Softing) Ethernet, OPC-UA industrial_command read_variable, write_variable
Industrial PC (e.g., Siemens IPC) Ethernet, SSH execute_python with paramiko SSH command execution

Most common choice for brownfield factories: Hardware Bridge + Modbus/TCP. You connect the gateway’s serial port to a local PC (or run bridge.py on a Raspberry Pi next to the gateway), and ASI Biont bridges the gap between the cloud sandbox and the factory floor.

Real-World Use Case: Monitoring a Temperature Controller via Modbus Gateway

Imagine a plastic molding plant with 20 temperature controllers (each with a Modbus RTU interface) connected to a single Moxa MGate 5105-MB-EIO Modbus TCP gateway. The goal: log temperature every 5 seconds, alert if any zone exceeds 250°C, and automatically reduce the setpoint when the ambient humidity rises above 70%.

Step 1: User Describes the Setup in Chat

User types:

“Connect to Moxa gateway at 192.168.1.100:502 via Modbus TCP. Read holding registers 40001–40020 (temperature values, 16-bit signed, scale factor 0.1). If any register > 2500 (250.0°C), send a Telegram alert. Also read humidity from register 40021 and if > 700 (70.0%), set register 40030 (master setpoint) to 2000 (200.0°C).”

Step 2: AI Writes and Executes the Integration Code

The AI uses execute_python with pymodbus and aiohttp (for Telegram). Here’s the generated script (simplified):

import asyncio
from pymodbus.client import AsyncModbusTcpClient
import aiohttp

TELEGRAM_BOT_TOKEN = "your_bot_token"
TELEGRAM_CHAT_ID = "your_chat_id"

async def read_and_control():
    client = AsyncModbusTcpClient("192.168.1.100", port=502)
    await client.connect()
    if not client.connected:
        print("Connection failed")
        return

    # Read 20 temperature registers (address 0 to 19)
    rr = await client.read_holding_registers(0, 20, unit=1)
    if rr.isError():
        print("Read error")
        return
    temps = [v * 0.1 for v in rr.registers]

    # Check threshold
    for i, t in enumerate(temps):
        if t > 250.0:
            msg = f"Zone {i+1} temperature {t:.1f}°C exceeds 250°C!"
            async with aiohttp.ClientSession() as session:
                url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
                await session.post(url, json={"chat_id": TELEGRAM_CHAT_ID, "text": msg})

    # Read humidity register (address 20)
    rh = await client.read_holding_registers(20, 1, unit=1)
    if not rh.isError():
        humidity = rh.registers[0] * 0.1
        if humidity > 70.0:
            # Write setpoint register (address 29) with value 2000
            wr = await client.write_register(29, 2000, unit=1)
            if not wr.isError():
                print("Setpoint reduced due to high humidity")

    client.close()

asyncio.run(read_and_control())

The AI runs this in the sandbox (30-second timeout), connects to the gateway, reads registers, sends alerts via Telegram, and adjusts the setpoint—all from a single chat message.

Step 3: Ongoing Automation

You can ask the AI to schedule this script every 5 seconds using a cron-like pattern (the AI creates a scheduled task in the cloud). From then on, ASI Biont polls the gateway constantly, and you get alerts directly in Telegram when something goes wrong.

Connecting via Hardware Bridge (for Serial-Only Gateways)

If your gateway only exposes a COM port (e.g., USB-to-RS485 converter), you use the Hardware Bridge:

  1. Download bridge.py from the ASI Biont dashboard (Devices → Create API Key → Download bridge).
  2. Run it on a local PC connected to the gateway:
    bash python bridge.py --token=YOUR_TOKEN --ports=COM3 --default-baud=9600
  3. In chat, tell the AI:

    ”Use bridge to read from COM3 at 9600 baud. Send AT command and parse response.”

  4. The AI sends industrial_command(protocol='bridge://', command='serial://COM3?baud=9600###AT\r\n', ...) and bridge forwards the command to the serial port.

This works even for old PLCs that only speak Modbus RTU over RS-485. The AI handles the protocol conversion on the fly.

Why This Approach Beats Traditional SCADA Integration

Aspect Traditional SCADA ASI Biont + AI Agent
Setup time Weeks of engineering Minutes of chat conversation
Protocol support Vendor-specific drivers Any protocol via Python libraries (pymodbus, paho-mqtt, opcua-asyncio, etc.)
Changes Requires developer User just asks the AI to modify the script
Cost Expensive licenses Free tier available, pay per compute
Scalability Add new OPC tags manually AI auto-discovers registers and creates logic

Pitfalls to Avoid

  • Timeout in execute_python: The sandbox kills scripts after 30 seconds. Never write while True loops. Instead, use scheduled tasks or MQTT callbacks.
  • COM port access: execute_python runs in the cloud and cannot access your local serial ports. Always use Hardware Bridge for serial communication.
  • Wrong register addressing: Modbus addressing can be 0-based or 1-based. Tell the AI the exact manual reference (e.g., “holding register 40001 is address 0 in pymodbus”).
  • Firewall rules: The gateway must be reachable from the ASI Biont cloud server (or use a local bridge with tunnel). Test with ping and telnet first.

The Bottom Line

Industrial IoT gateways are the key to unlocking legacy factory data. With ASI Biont, you don’t need to be a Modbus expert or a Python developer. You just describe your gateway and what you want to monitor/control, and the AI writes the integration code in seconds. Try it yourself: go to asibiont.com, create a free account, and start connecting your factory equipment today.

← All posts

Comments