Simulation Server
The TwinEdge Simulation Server is a free OPC UA server that generates realistic industrial data for testing, development, and demos.
Download
| Platform | Download | Requirements |
|---|---|---|
| Windows | Download (.msi) | Windows 10+ |
| macOS | Download (.dmg) | macOS 11+ |
| Docker | docker pull twinedge/simulation-server | Docker 20+ |
Features
- Realistic simulations: Industrial equipment models
- Multiple asset types: Pumps, motors, HVAC, sensors
- Configurable scenarios: Normal operation, faults, maintenance
- Standard OPC UA: Full UA specification support
- No hardware needed: Perfect for development and testing
Getting Started
Installation
Windows/macOS:
- Download the installer
- Run and follow prompts
- Launch Simulation Server
Linux:
chmod +x TwinEdge-SimServer.AppImage
./TwinEdge-SimServer.AppImage
Docker:
docker run -d -p 4840:4840 twinedge/simulation-server
Starting the Server
- Launch the Simulation Server
- Server starts on
opc.tcp://localhost:4840 - Connect with any OPC UA client
Quick Test
Using the TwinEdge OPC UA Client:
- Open OPC UA Client
- Connect to
opc.tcp://localhost:4840 - Browse to Objects → Simulation
- View simulated values updating
Simulated Assets
Centrifugal Pump
Realistic pump simulation with:
| Variable | Type | Range | Unit |
|---|---|---|---|
Vibration_X | Float | 0-10 | mm/s |
Vibration_Y | Float | 0-10 | mm/s |
Vibration_Z | Float | 0-10 | mm/s |
Motor_Temperature | Float | 20-120 | °C |
Bearing_Temperature | Float | 20-100 | °C |
Discharge_Pressure | Float | 0-20 | bar |
Suction_Pressure | Float | 0-5 | bar |
Flow_Rate | Float | 0-500 | L/min |
Motor_Current | Float | 0-100 | A |
Motor_Speed | Int | 0-3600 | RPM |
Run_Status | Bool | On/Off | - |
Electric Motor
Motor simulation variables:
| Variable | Type | Range | Unit |
|---|---|---|---|
Stator_Temperature | Float | 20-150 | °C |
Rotor_Temperature | Float | 20-120 | °C |
Voltage_L1 | Float | 380-420 | V |
Voltage_L2 | Float | 380-420 | V |
Voltage_L3 | Float | 380-420 | V |
Current_L1 | Float | 0-100 | A |
Current_L2 | Float | 0-100 | A |
Current_L3 | Float | 0-100 | A |
Power_Factor | Float | 0.8-1.0 | - |
Active_Power | Float | 0-75 | kW |
Speed | Int | 0-1800 | RPM |
HVAC Unit
HVAC system simulation:
| Variable | Type | Range | Unit |
|---|---|---|---|
Supply_Temperature | Float | 10-30 | °C |
Return_Temperature | Float | 15-35 | °C |
Humidity | Float | 30-80 | % |
CO2_Level | Float | 400-2000 | ppm |
Fan_Speed | Int | 0-100 | % |
Compressor_Status | Bool | On/Off | - |
Filter_Status | Int | 0-100 | % |
Generic Sensors
Configurable sensor simulation:
| Sensor Type | Variables |
|---|---|
| Temperature | Value, Unit, Status |
| Pressure | Value, Unit, Status |
| Level | Value, Unit, Status |
| Flow | Value, Unit, Status |
| Vibration | X, Y, Z, RMS |
Simulation Scenarios
Normal Operation
Default scenario with stable, realistic values:
- Minor random fluctuations
- Day/night cycles
- Gradual drift
Fault Conditions
Simulate equipment faults:
Bearing Failure:
Enable: Scenarios → Pump → Bearing Failure
Effect: Vibration increases over time, temperature rises
Cavitation:
Enable: Scenarios → Pump → Cavitation
Effect: Pressure fluctuations, flow instability
Motor Overload:
Enable: Scenarios → Motor → Overload
Effect: Current spikes, temperature increase
Maintenance Events
Simulate maintenance activities:
- Scheduled shutdown
- Parameter changes
- Recovery patterns
Configuration
Server Configuration
Edit config.yaml:
server:
port: 4840
security:
mode: None # None, Sign, SignAndEncrypt
policy: Basic256Sha256
max_sessions: 10
max_subscriptions: 100
Asset Configuration
Configure simulated assets:
assets:
- id: Pump_001
type: centrifugal_pump
enabled: true
update_rate_ms: 1000
initial_state: running
- id: Motor_001
type: electric_motor
enabled: true
update_rate_ms: 500
linked_to: Pump_001
Custom Variables
Add custom variables:
custom_variables:
- name: CustomSensor
node_id: ns=2;s=CustomSensor
data_type: Float
initial_value: 50.0
simulation:
type: sine
amplitude: 10
period_seconds: 60
Simulation Patterns
Available Patterns
| Pattern | Description | Parameters |
|---|---|---|
constant | Fixed value | value |
random | Random within range | min, max |
sine | Sinusoidal wave | amplitude, period, offset |
ramp | Linear increase | start, end, duration |
step | Step changes | values[], interval |
noise | Gaussian noise | mean, stddev |
replay | Replay CSV data | file, loop |
Pattern Examples
Random with drift:
simulation:
type: random
min: 60
max: 80
drift: 0.1 # Gradual drift per minute
Sine wave:
simulation:
type: sine
amplitude: 5
period_seconds: 3600 # 1 hour cycle
offset: 65
CSV Replay:
simulation:
type: replay
file: historical_data.csv
timestamp_column: time
value_column: temperature
loop: true
API Control
REST API
Control the simulation via REST:
# Get server status
GET http://localhost:8080/api/status
# Start/stop simulation
POST http://localhost:8080/api/simulation/start
POST http://localhost:8080/api/simulation/stop
# Trigger scenario
POST http://localhost:8080/api/scenarios/bearing_failure/enable
# Set variable value
POST http://localhost:8080/api/variables/Pump_001/Temperature
Content-Type: application/json
{"value": 85.0}
Command Line
Control via CLI:
# Start server
simserver start --port 4840
# Load configuration
simserver config load myconfig.yaml
# Trigger scenario
simserver scenario enable bearing_failure
# Stop server
simserver stop
Docker Usage
Basic Usage
docker run -d \
--name twinedge-sim \
-p 4840:4840 \
-p 8080:8080 \
twinedge/simulation-server
With Custom Config
docker run -d \
--name twinedge-sim \
-p 4840:4840 \
-v $(pwd)/config.yaml:/app/config.yaml \
twinedge/simulation-server
Docker Compose
version: '3.8'
services:
simulation-server:
image: twinedge/simulation-server:latest
ports:
- "4840:4840"
- "8080:8080"
volumes:
- ./config:/app/config
environment:
- LOG_LEVEL=info
Use Cases
Development Testing
Test your OPC UA client code:
- Start simulation server
- Connect your application
- Test read/write/subscribe operations
- Verify error handling
Integration Testing
Automated testing scenarios:
# pytest example
def test_alarm_on_high_temperature():
# Enable high temperature scenario
requests.post('http://localhost:8080/api/scenarios/high_temp/enable')
# Wait for alarm
time.sleep(5)
# Verify alarm triggered
alarms = client.get_active_alarms()
assert any(a.name == 'High Temperature' for a in alarms)
Demos and Training
Demonstrate TwinEdge features:
- Dashboard creation
- Alert configuration
- ML model training
- Report generation
Load Testing
Stress test your infrastructure:
# Start multiple instances
for i in {1..10}; do
docker run -d -p $((4840+i)):4840 twinedge/simulation-server
done
Troubleshooting
Server Won't Start
Port in use:
# Check if port is in use
netstat -an | grep 4840
# Use different port
simserver start --port 4841
Permission denied (Linux):
# Run with sudo or change port > 1024
sudo ./simserver start
# Or
./simserver start --port 14840
Connection Issues
Cannot connect:
- Verify server is running
- Check firewall rules
- Ensure correct endpoint URL
Security errors:
- Use
security.mode: Nonefor testing - Or configure certificates properly
Performance Issues
High CPU:
- Reduce update rate
- Disable unused assets
- Limit subscription count
Support
- Source Code: github.com/twinedge/simulation-server
- Issues: GitHub Issues
- Community: discord.gg/twinedge
License
The TwinEdge Simulation Server is open source under the MIT License.
Next Steps
- OPC UA Client - Connect to the simulation
- Data Sources - Add to TwinEdge platform
- Installation - Deploy TwinEdge Edge