Introduction
In 2026, countless warehouses and factories still run on RS-232 serial devices. Digital scales, barcode scanners, CNC controllers and laboratory instruments use a protocol standardized back in 1962. These devices are reliable but silent: data sits in a COM port, waiting to be read. Connecting them to an AI agent unlocks real-time monitoring, anomaly detection, and full automation.
ASI Biont is an AI agent platform that handles device integration through a simple chat dialog. You describe the device, the port, the baud rate and the data format — and the agent writes the integration code, tests it, and starts processing. No management panels, no plugin stores. For serial ports, ASI Biont provides a Hardware Bridge (bridge.py) that connects a local COM port directly to the AI agent.
What Is a COM / RS-232 Device?
RS-232 is a serial communication standard introduced by the Electronic Industries Association (EIA) in 1962. It defines point-to-point communication over a few wires. On Windows, serial ports appear as COM3 or COM4; on Linux they are /dev/ttyS0 or /dev/ttyUSB0.
Why is RS-232 still relevant? Because it is simple, low-cost and supported by virtually every industrial chip. Common devices with RS-232 interfaces include:
- Industrial scales and weigh modules
- Barcode and QR code scanners
- CNC machines and motion controllers
- Laboratory meters (pH, temperature, balances)
- Modems and IoT gateways
- Arduino / ESP32 prototypes with UART output
Most RS-232 devices transmit ASCII text lines terminated by a newline. For example, a scale may send SST+0001.234 kg. This straightforward format is ideal for AI-based parsing.
Why Connect a Serial Device to an AI Agent?
Without integration, a scale on a production line is just a display. An operator reads the value, writes it down, and later enters it into a spreadsheet. This process is slow and error-prone. After integration, the same scale becomes a sensor that:
- Continuously emits weight readings
- Compares them with expected values from an ERP or database
- Sends alerts when values deviate
- Triggers downstream actions via MQTT, HTTP, or Modbus
This enables use cases like automated receiving: a barcode scanner and a scale verify a delivered package against a purchase order before the warehouse accepts it.
How ASI Biont Connects to COM / RS-232
ASI Biont supports many industrial protocols: MQTT, Modbus/TCP, HTTP/WebSocket, OPC-UA, Siemens S7, BACnet, EtherNet/IP, CAN bus, gRPC, CoAP, and serial ports via a dedicated Hardware Bridge.
Hardware Bridge for COM Ports
The Hardware Bridge is a small Python program (bridge.py) available from the ASI Biont dashboard. The dashboard provides the exact file; it is not hosted on GitHub. Launch it from a terminal:
python bridge.py --token=YOUR_TOKEN --ports=COM3 --baud=9600 --rate=10
--tokenconnects the bridge to your ASI Biont account--portslists the serial ports to monitor--baudsets the baud rate, e.g. 9600 or 115200--rateis the polling frequency (reads per second)
The bridge has no HTTP API; all interaction is done through the agent's industrial_command() function. For example, the chat command "read the current weight from COM3" is translated by AI into:
result = industrial_command(protocol="com", command="read", port="COM3", max_bytes=128)
print(result)
The exact command set is documented on the dashboard's Hardware Bridge page.
Universal execute_python with pyserial
If the device uses a binary protocol or a non-standard baud rate, ASI Biont can fall back to execute_python. The AI writes a Python script using the pyserial library and runs it in a sandbox. The script is executed once, with a 30-second timeout. For serial line reads this is more than enough.
Minimal one-shot read:
import serial, json
with serial.Serial("COM3", 9600, timeout=2) as ser:
raw = ser.readline().decode("ascii", errors="ignore").strip()
print(json.dumps({"raw": raw}))
To extract a weight from SST+0001.234 kg:
import serial, re, json
with serial.Serial("COM3", 9600, timeout=2) as ser:
raw = ser.readline().decode("ascii", errors="ignore").strip()
match = re.search(r"([-+]?\d+\.\d+)\s*kg", raw)
if match:
print(json.dumps({"weight_kg": float(match.group(1)), "raw": raw}))
else:
print(json.dumps({"raw": raw, "error": "unexpected format"}))
The printed JSON is returned to the chat, where the AI agent can act on it. Note: avoid while True loops in execute_python because of the 30-second timeout. For continuous processing, use the Hardware Bridge with --rate or let the agent schedule repeated executions.
Connection Methods Compared
| Method | Best for | Library / Protocol | Complexity |
|---|---|---|---|
| Hardware Bridge (COM) | Local serial devices, continuous polling | bridge.py, industrial_command() | Low |
| execute_python (pyserial) | Binary and custom serial protocols | pyserial | Medium |
| MQTT | Networked IoT devices | paho-mqtt | Low |
| Modbus/TCP | PLCs and controllers | pymodbus | Low |
| HTTP API / WebSocket | REST services | aiohttp | Low |
| OPC-UA | Industrial automation servers | opcua-asyncio | Medium |
| Siemens S7 | SIMATIC PLCs | snap7 | Medium |
| BACnet | Building automation | bac0 | Medium |
| CAN bus | Vehicles and machines | python-can | Medium |
| gRPC / CoAP | Microservices and constrained devices | grpcio, aiocoap | Medium |
Use Case: Automated Weighing Station in a Warehouse
Imagine a receiving line with a digital scale connected via RS-232 to a PC running the Hardware Bridge. The scale outputs WT+0001.234 kg when weight stabilizes. The warehouse wants to:
- Capture the weight automatically when a package is placed on the scale.
- Match it with the purchase order number from a barcode scanner.
- Accept or reject the package and send the result to the ERP API.
In ASI Biont, the operator describes this scenario in chat:
"Create a workflow: when the scale on COM3 sends a stable weight, scan the barcode field from the last reading, compare with the expected weight from the order database, and send the decision to
https://erp.example.com/api/receiving."
The agent then generates a Python script that combines all these steps. A simplified version:
import serial, re, requests
with serial.Serial("COM3", 9600, timeout=2) as ser:
raw = ser.readline().decode("ascii", errors="ignore").strip()
match = re.search(r"([-+]?\d+\.\d+)\s*kg", raw)
if not match:
print("No stable weight")
raise SystemExit
weight = float(match.group(1))
order_data = get_last_barcode() # generated by AI
expected_weight = get_expected_weight(order_data)
decision = "accepted" if abs(weight - expected_weight) < 0.5 else "rejected"
resp = requests.post(
"https://erp.example.com/api/receiving",
json={"order": order_data, "weight": weight, "decision": decision},
timeout=5,
)
print(f"Decision: {decision}, ERP status: {resp.status_code}")
This is not pseudocode; ASI Biont really generates and runs such scripts. If something fails, you can ask the agent to fix the regex or switch from Modbus to HTTP.
12 Automation Scenarios with COM / RS-232
- Warehouse receiving — barcode + scale verification against purchase orders.
- Production line weighing — reject parts that are over or under target weight.
- Laboratory logging — read a serial pH meter or balance and save results to CSV.
- CNC machine monitoring — parse tool numbers and cycle times.
- PLC data bridge — convert serial input to MQTT topics.
- Flow meter totalization — accumulate daily volume and send hourly summaries.
- Label printing trigger — send a serial command to a printer after a check.
- Access control — read a serial RFID reader and notify a REST API.
- Vending machine telemetry — collect coin acceptor pulses and estimate inventory.
- Energy meter reading — poll a Modbus-over-serial meter and store kWh.
- Agriculture sensors — read a soil moisture probe on a USB serial adapter.
- Arduino / ESP32 prototypes — parse JSON from custom UART firmware.
Each follows the same pattern: read, parse, apply business logic, send the result elsewhere.
How to Set Up the Integration in 3 Steps
- Download
bridge.pyfrom the ASI Biont dashboard. - Run it on the PC connected to the device:
bash python bridge.py --token=TOKEN --ports=COM3 --baud=9600 --rate=10 - Describe the task in chat:
"Read COM3 at 9600 baud, parse weight lines, and send me a Telegram message when weight exceeds 25 kg."
Because execute_python accepts arbitrary scripts, ASI Biont can also connect to devices via paramiko (SSH), paho-mqtt (MQTT), pymodbus (Modbus), aiohttp (HTTP/WebSocket), or opcua-asyncio (OPC-UA). You don't need to wait for new plugins — the AI writes the integration code on demand.
Why This Is a Game Changer
Traditional serial integration takes days: writing a Windows service, defining a parser, configuring connectors. ASI Biont does it in seconds. The generated code is transparent — you can read it, adjust a regex, or change the output format by simply asking.
The result is a lower barrier to automation: new devices are connected in minutes, middleware costs disappear, and maintenance becomes a conversation rather than a software release.
Conclusion
A COM/RS-232 port is often the only digital output of an otherwise analogue industrial device. ASI Biont makes it readable, analyzable and actionable. Whether you choose the Hardware Bridge for continuous polling or execute_python for custom protocols, the path is the same: describe, run, automate.
Try it now on asibiont.com — turn a serial scale, scanner, or sensor into an intelligent, AI-managed device. One chat message can be the start of your next automation project.
Comments