Real-World Integration Scenarios
opcgw enables seamless integration of LoRaWAN IoT sensor networks into existing industrial systems. Here are detailed use cases showing how the gateway solves real problems.
π± Smart Agriculture: Precision Field Monitoring
The Challenge
A large agricultural cooperative manages 50+ farms across multiple regions. Each farm has soil, weather, and equipment sensors distributed across 100+ hectares. Previously:
- Manual sensor checks β inconsistent data
- Paper/spreadsheet records β slow decision-making
- No real-time alerts β late response to irrigation needs
- Siloed data β no cross-farm insights
The Solution with opcgw
Architecture:
[Soil/Weather Sensors] β LoRaWAN Network β ChirpStack β opcgw β Farm Management System (Ignition)
(Wireless) (Coverage) (Aggregation) (Bridge) (Visualization & Logic)
Implementation:
- Deploy 300 LoRaWAN soil sensors across farms
- Soil moisture (%)
- Temperature (Β°C)
- EC/Conductivity (mS/cm)
- ChirpStack aggregates sensor data
- opcgw gateway bridges to existing FMS running Ignition
- Ignition dashboard displays real-time field map
- Automated alerts trigger when soil moisture < 30%
Configuration:
[[application]]
application_name = "Farm Network"
application_id = "farm-network"
[[application.device]]
device_name = "Field A - North Block"
device_id = "soil_sensor_001"
[[application.device.read_metric]]
metric_name = "Soil Moisture"
chirpstack_metric_name = "soil_moisture_pct"
metric_type = "Float"
metric_unit = "%"
[[application.device.read_metric]]
metric_name = "Soil Temperature"
chirpstack_metric_name = "temp_celsius"
metric_type = "Float"
metric_unit = "Β°C"
[[application.device.read_metric]]
metric_name = "Soil EC"
chirpstack_metric_name = "ec_ms_per_cm"
metric_type = "Float"
metric_unit = "mS/cm"
# ... repeat for 300 devices across all farms
Results:
- β 30% reduction in water usage (precise irrigation)
- β 20% increase in crop yield (optimal growing conditions)
- β Real-time visibility β faster decision-making
- β Historical data for trend analysis and planning
ROI: Sensor network + gateway cost recouped in first season through water/fertilizer savings.
π‘ Note: The TOML above illustrates the data model. In v2.x you normally configure all this from the web UI β
config.tomlis only a one-time bootstrap seed; the live configuration lives in SQLite and is portable via export/import.
π§ Precision Irrigation: Valve Actuation from SCADA
The Challenge
An orchard operator wants to open and close field irrigation valves directly from the control room, not just read sensors. Previously:
- Valves opened manually in the field β wasted trips and water
- No closed-loop control β irrigation tied to schedules, not conditions
- No confirmation the valve actually moved β silent failures
The Solution with opcgw
opcgw is not read-only: an OPC UA write to a command node becomes a LoRaWAN downlink to the device.
Architecture:
[SCADA / Fuxa] β OPC UA write β opcgw β ChirpStack Enqueue β LoRaWAN β [Tonhe Valve]
β β
command status β ack / txack events β uplink (StreamDeviceEvents)
Flow:
- Operator (or automation logic) writes
1 = Open/0 = Closeto the valveβs OPC UA command node - opcgw maps it through the
command_class = "valve"device-class binding and enqueues a downlink via ChirpStackEnqueue - The command moves through Pending β Sent β Confirmed as
ack/txackevents arrive on the device stream - The valveβs reported state streams back as a raw last-known value (no aggregation), visible alongside the command status
Results:
- β Valves driven straight from the SCADA HMI β no field trips to actuate
- β Closed-loop irrigation: soil-moisture readings can trigger valve commands
- β Delivery confirmation (Pending β Sent β Confirmed) instead of fire-and-forget
- β Model-agnostic: the same class-aware path extends to other actuators, not just valves
Controlling irrigation valves from SCADA is opcgwβs origin story β the Tonhe E20 valve was its first proven control driver.
π Smart Factory: Real-Time Equipment Monitoring
The Challenge
A mid-size manufacturing facility has 20 CNC machines spread across the shop floor. Current issues:
- Manual rounds to check machine status β labor intensive
- No early warning for maintenance β unexpected downtime
- Disconnected data β no production optimization
- Temperature/vibration not monitored β tool wear surprises
The Solution with opcgw
Architecture:
[Machine Sensors] β LoRaWAN β ChirpStack β opcgw β MES/ERP
(Vibration, Temp) (Wireless) (Bridge)
Sensors Deployed:
- Vibration sensors on spindles
- Temperature sensors on bearings
- Power draw monitors (via wireless meters)
- Door/status sensors (open/closed)
Implementation:
[[application]]
application_name = "Production Floor"
application_id = "production"
[[application.device]]
device_name = "CNC Machine 1"
device_id = "cnc001"
[[application.device.read_metric]]
metric_name = "Vibration Level"
chirpstack_metric_name = "vibration_g"
metric_type = "Float"
metric_unit = "G"
[[application.device.read_metric]]
metric_name = "Bearing Temperature"
chirpstack_metric_name = "bearing_temp"
metric_type = "Float"
metric_unit = "Β°C"
[[application.device.read_metric]]
metric_name = "Running"
chirpstack_metric_name = "machine_running"
metric_type = "Bool"
π‘ Note: This TOML shows the data model for clarity. In practice you configure devices and metrics from the web UI (with ChirpStack auto-discovery pickers);
config.tomlis just a bootstrap seed and the live config lives in SQLite, portable via export/import.
Integration with MES:
- MES subscribes to OPC UA variables
- High vibration β trigger predictive maintenance alert
- Temperature spike β reduce spindle speed automatically
- Machine stops β log idle time for efficiency tracking
Results:
- β 40% reduction in unexpected downtime
- β Preventive maintenance before failures
- β Energy consumption visibility
- β Production metrics tied to equipment health
π Environmental Monitoring: Urban Air Quality Network
The Challenge
A city health department wants to monitor air quality across neighborhoods. Goals:
- Real-time public health alerts
- Identify pollution hotspots
- Track improvement over time
- Publish open data for residents
The Solution with opcgw
Deployment:
- 100+ air quality sensors distributed across city
- LoRaWAN coverage via community network
- Real-time data pipeline to city data system
- Public-facing dashboard
Metrics Tracked:
PM2.5, PM10, NOβ, Oβ, CO, Temperature, Humidity, Air Pressure
Integration:
[Air Quality Sensor Network]
β
[ChirpStack Aggregation]
β
[opcgw Bridge]
β
[Analytics Platform] β [Public Dashboard]
β
[Alert System] β [Public Notifications]
Data Pipeline:
- Sensors report every 5 minutes
- opcgw exposes via OPC UA
- Analytics system subscribes to live data
- Trends detected β historical database
- Public API serves open data to residents
Results:
- β Real-time air quality data for all neighborhoods
- β Health alerts when PM2.5 exceeds limits
- β Environmental justice: identify polluted areas
- β Accountability: track improvement initiatives
- β Resident engagement: transparency & public health
π’ Building Automation: Energy Management at Scale
The Challenge
A 20-building commercial campus has:
- HVAC zones across 200,000 mΒ²
- Occupancy varies dramatically (20-100%)
- Energy consumption: $5M/year
- Limited visibility into actual vs. scheduled consumption
The Solution with opcgw
Wireless Sensor Deployment (eliminate wiring costs):
- 500+ room occupancy sensors
- 1000+ temperature/humidity sensors
- 50+ water/gas meters
- All wirelessly reporting via LoRaWAN
Integration with BMS:
[Sensors] β LoRaWAN β ChirpStack β opcgw β Building Management System
β
[Demand-Controlled HVAC]
[Energy Optimization]
[Fault Detection]
Automated Logic:
If room unoccupied for 15 min:
β Set HVAC to standby
β Dim lighting to 10%
β Close blinds if temps allow
If temperature differential > 3Β°C for 10 min:
β Alert maintenance team
β Check for air leaks
Results:
- β 25% reduction in HVAC energy (occupancy-based)
- β 15% reduction in lighting energy (sensor-based)
- β Early fault detection (unexpected temperature variance)
- β Tenant comfort: maintain setpoints while saving energy
- β No wiring disruption to tenants
Payback: Energy savings exceed sensor + gateway cost in year 2.
β‘ Renewable Energy: Microgrid Optimization
The Challenge
A community solar cooperative with:
- 50 rooftop solar installations
- 10 battery storage units
- Grid-tied + island mode capability
- Complex energy balance requirements
The Solution with opcgw
Real-Time Microgrid Control:
[Solar Inverters] β LoRaWAN β ChirpStack β opcgw β Energy Management System
[Battery Units] β
[Grid Meters] [Optimization Engine]
Monitored Parameters:
- Solar generation (kW) per building
- Battery state of charge (%)
- Grid import/export (kW)
- Load consumption (kW)
Optimization Logic:
- Solar peak hours: Charge batteries, power loads, export excess
- Cloudy periods: Use battery, minimize imports
- Night time: Use battery first, then import
- Grid stress: Support grid with battery discharge
- Faults: Disconnect from grid, island mode
Results:
- β 90% solar self-consumption (not exported at low rates)
- β Reduced grid imports 40%
- β Revenue: participate in grid services markets
- β Resilience: island mode during grid outages
- β Sustainability: maximize renewable usage
π Logistics: Asset Tracking & Condition Monitoring
The Challenge
A logistics company moves temperature-sensitive goods (pharmaceuticals, food). Issues:
- Need to track goods location in real-time
- Monitor temperature during transport
- Prove compliance with cold chain requirements
- Detect tampering or handling issues
The Solution with opcgw
Wireless Sensor Packages:
- LoRaWAN GPS trackers on shipments
- Tamper-evident sensors
- Temperature/humidity data loggers
- Shock detectors
Real-Time Visibility:
[Shipment Sensors] β LoRaWAN β ChirpStack β opcgw β Logistics Platform
Integration:
- Real-time location feeds GPS map
- Temperature alerts if exceeds range
- Tamper alert β automatic quarantine in system
- Proof of compliance: automated certificate generation
Results:
- β Full supply chain visibility
- β Compliance verification (audit-ready)
- β Early warning: act on cold chain violations
- β Liability protection: documented conditions
- β Efficiency: optimized routes based on real data
Common Success Patterns
Across all use cases, opcgw provides:
- Wireless First: LoRaWAN eliminates wiring costs/disruption
- Real-Time Integration: Live data in existing systems
- Standards-Based: OPC UA works with any SCADA/MES/analytics
- Low TCO: Simple architecture = easy to maintain
- Scalable: Hundreds of devices, minutes to add more
Getting Started With Your Use Case
- Identify Sensors: What data do you need?
- Plan LoRaWAN: Existing network or new deployment?
- Map to OPC UA: Which systems will consume data?
- Configure opcgw: Define applications β devices β metrics
- Integrate Target System: Wire OPC UA into SCADA/MES/Analytics
- Monitor & Optimize: Tune polling intervals, validate data quality
Ready to build? Start with the Quick Start Guide.
Have a specific use case? Open an issue or start a discussion.