Node-RED Integration
Connect LINK485 to Node-RED for visual IoT automation
⏱️ Setup Time: 15-20 minutes | 📚 Prerequisites: Node-RED installed, LINK485 gateway configured
Overview
Node-RED is a visual programming tool for IoT. This guide shows how to connect your LINK485 gateway to Node-RED using HTTP webhooks, enabling you to create powerful automation workflows with drag-and-drop simplicity. Link485 devices POST JSON data directly to your Node-RED endpoint.
Step 1: Set Up HTTP Webhook in Node-RED
- Open Node-RED (http://localhost:1880/)
- Drag an "http in" node to the canvas
- Double-click and configure:
- Method: POST
- URL: /link485/data
- Add a "http response" node to send acknowledgment
- Add a "debug" node to see incoming data
- Connect: http in → debug → http response
- Click "Deploy"
💡 Your webhook URL: http://node-red-ip:1880/link485/data
Step 2: Configure LINK485 via Mobile App
For Link485 Air (WiFi)
- Power on your Link485 Air device
- Download Link485 App (Android/iOS)
- Open App and Add Device: Tap "Add New Device"
- Enter WiFi Credentials
- Choose Integration Type: Select "HTTP/Custom"
- Configure HTTP Settings:
- Server URL: http://node-red-ip:1880/link485/data
- Method: POST
- Content-Type: application/json
- Post Interval: 30 seconds (or as needed)
- Tap "Connect" - Device will start POSTing data
For Link485 4G (Cellular)
- Power on your Link485 4G device with SIM card
- Download Link485 App (same as above)
- Optional: Enter WiFi credentials for backup
- Choose Integration Type: Select "HTTP/Custom"
- Configure HTTP Settings (same as above)
- Tap "Connect" - Device uses 4G for primary connection
⚠️ Network Access: If using Link485 4G with cellular connection, ensure Node-RED has a public IP or use a service like ngrok for testing.
Step 3: Process Incoming Data
LINK485 POSTs JSON data in the request body. Access it with msg.payload:
- Data is automatically parsed as JSON by Node-RED
- Add a "function" node to extract specific values
- Use
msg.payload.slaves[0].registers.powerto access power reading - Route data to dashboard, database, or logic nodes
const power = msg.payload.slaves[0].registers.power;
msg.payload = power;
return msg;
Step 4: Send Commands Back to Device
You can send commands to Link485 by returning JSON in the HTTP response:
- Modify the "http response" node flow
- Add a "function" node before http response
- Set response body with commands
msg.payload = {
"command": "read_holding_registers",
"slave_id": 1,
"start_address": 0,
"count": 10
};
return msg;
The device will receive this command and execute it on the next connection.
Example Flows
1. Energy Monitoring Dashboard
Create a real-time energy dashboard using the "UI Dashboard" nodes. Display power, voltage, and current readings with gauges and charts.
2. Alert System
Use a "Switch" node to trigger alerts when values exceed thresholds. Send email or SMS notifications using appropriate nodes.
3. Data Logging
Store data to InfluxDB or PostgreSQL using database nodes. Create historical analytics and reports.