Introduction
RS-485 is the backbone of industrial communication — it's the differential serial standard that connects everything from Modbus RTU energy meters to VFDs, valve actuators, and temperature transmitters in factories and buildings worldwide. While RS-485 is robust and long-distance (up to 1200 meters), its biggest drawback is that querying multiple devices manually or scripting responses for each model is tedious. ASI Biont changes that by letting an AI agent handle the entire integration through a simple chat, using the Hardware Bridge and industrial_command tool. No dashboard panels, no vendor-specific SDKs — just describe your device, and the AI writes the code.
How ASI Biont Connects to RS-485 Devices
ASI Biont does not have direct hardware access — it runs in the cloud. To talk to RS-485 devices, you use the Hardware Bridge: a lightweight Python script (bridge.py) that you download from the ASI Biont dashboard (Devices → Create API Key → Download bridge). The bridge runs on your local PC (Windows, Linux, macOS) and connects to ASI Biont via a secure WebSocket. When you ask the AI to read or write to an RS-485 device, it sends commands through industrial_command(protocol='serial://', command='serial_write_and_read', data='hex_string'). The bridge receives the command, writes the hex data to the COM port using pyserial, and returns the response. The bridge automatically handles Windows-specific quirks like overlapping I/O failures by calling CancelIoEx and PurgeComm.
Wiring RS-485 to Your Computer
To connect an RS-485 device (e.g., an Eastron SDM630 Modbus energy meter or a temperature transmitter), you need a USB-to-RS-485 converter (like a FTDI-based USB-485). Wiring is simple:
| Device Pin | USB-485 Pin |
|---|---|
| A / D+ | A / D+ |
| B / D- | B / D- |
| GND | GND |
Termination resistors (120 Ω) are recommended on long runs. On Windows, the converter will appear as COM3, COM4, etc. On Linux, as /dev/ttyUSB0.
Step-by-Step Integration
-
Download and run the bridge: From the dashboard, get
bridge.py. Run it with:
bash pip install pyserial requests websockets python bridge.py --token=YOUR_API_KEY --ports=COM3 --baud 9600
The bridge connects to ASI Biont via WebSocket and opens COM3 at 9600 baud. -
Describe your device in chat: In the ASI Biont chat, tell the AI: "I have an Eastron SDM630 Modbus energy meter on COM3 at 9600 baud. Read voltage on register 0x0000."
-
AI sends the command: The AI uses
industrial_commandwith the correct Modbus RTU frame. For example, to read voltage (register 0x0000, 2 bytes): - Slave address: 0x01
- Function code: 0x04 (read input register)
- Register high: 0x00
- Register low: 0x00
- Quantity high: 0x00
- Quantity low: 0x02
- CRC16: calculated by AI
Hex:01040000000002CRC
The AI sends: industrial_command(protocol='serial://', command='serial_write_and_read', data='0104000000000279CB')
-
Bridge returns response: The bridge writes the hex to COM3, reads the response (e.g.,
010402080A), and sends it back. The AI decodes it: voltage = 0x080A = 2058 → 205.8 V. -
Automate: You can ask the AI to poll every 5 minutes and send a Telegram alert if voltage exceeds 250 V. The AI will write a Python script using
execute_pythonwithpaho-mqttorrequeststo schedule the polling.
Real-World Scenario: Energy Monitoring with Alerts
A factory engineer wants to monitor power consumption of a production line using an Eastron SDM630 over RS-485. They connect the meter to a USB-485 adapter on a Windows PC, run the bridge with --ports=COM4 --baud=9600, and tell the AI: "Read power (register 0x000C) every 30 seconds. If power exceeds 5000 W, send me a Telegram message."
The AI responds by:
- Building a Modbus RTU frame for register 0x000C: 0104000C0002CRC
- Using industrial_command to poll every 30 seconds via a scheduled Python script in execute_python
- Checking the decoded value (32-bit float in registers 0x000C and 0x000D)
- Sending a Telegram alert via telegram library
The entire integration takes seconds — no manual CRC calculation, no Modbus library setup.
Why This Matters: No Programming Required
RS-485 devices often require custom Python scripts with Modbus libraries, CRC calculators, and error handling. With ASI Biont, you simply describe the task in natural language. The AI knows the Modbus protocol, generates the correct hex frames, handles CRC, and manages the bridge communication. If you need to connect a different device — say, a Danfoss VFD or a Siemens S7 PLC — just change the description. The same bridge works for any RS-485 device.
Conclusion
RS-485 is not going away — it's in every substation, solar farm, and HVAC system. ASI Biont makes it trivially easy to bring those devices into an AI-driven automation loop. Download the bridge, connect your converter, and start automating. Try it today at asibiont.com.
Comments