LoRaWAN IoT Module
Complete Module Documentation
Everything you need to connect LoRaWAN sensors to Ignition and build powerful IoT dashboards.
Overview
The LoRaWAN IoT Module transforms Ignition into a complete IoT platform by connecting LoRaWAN sensors and devices. This documentation covers network server integration, device management, payload decoding, and building IoT dashboards.
Installation
System Requirements
Before installing the LoRaWAN IoT Module:
- Ignition Version: 8.0 or higher
- LoRaWAN Network Server: TTN, Chirpstack, Actility, or compatible
- LoRaWAN Gateway: Coverage at your sensor locations
- MQTT Broker: Built into most network servers
- Ignition MQTT Module: Required for MQTT connectivity
LoRaWAN Network Setup
Set up your LoRaWAN infrastructure before module installation:
Option 1: Public Network (The Things Network) 1. Create account at thethingsnetwork.org 2. Register your application 3. Add your devices (OTAA or ABP activation) 4. Note MQTT credentials from application settings
Option 2: Private Network (Chirpstack) 1. Deploy Chirpstack network server 2. Configure your LoRaWAN gateway 3. Create application and register devices 4. Configure MQTT integration
Installing the Module
Install the LoRaWAN IoT Module in Ignition:
- Prerequisites: Ensure MQTT Transmission module is installed
- Download the LoRaWAN module (
.modl) from your OperaMetrix account - Navigate to Config > System > Modules
- Click Install or Upgrade a Module
- Select the downloaded file and accept the license
- Restart the gateway if prompted
Configuration
MQTT Connection Setup
Configure the MQTT connection to your network server:
- Go to Config > MQTT Transmission > Settings
- Create a new MQTT server connection:
- Test the connection before proceeding
Server: eu1.cloud.thethings.network
Port: 8883 (TLS)
Username: your-app-id@ttn
Password: NNSXS.your-api-key...LoRaWAN Module Configuration
Configure the LoRaWAN module settings:
- Navigate to Config > LoRaWAN > Settings
- Configure the following:
Device Profiles
Create device profiles for automatic tag configuration:
- Go to Config > LoRaWAN > Device Profiles
- Click Add Profile
- Configure:
Device profiles ensure consistent tag structures across similar devices.
Payload Decoders
Configure payload decoders to convert raw LoRaWAN data:
- Dragino (LHT65, LSE01, LDDS75, etc.)
- Milesight (EM300, AM107, VS121, etc.)
- Elsys (ERS, ELT, EMS series)
- Sensecap (S2100, S2101, S2102)
Custom Decoders: Write JavaScript for custom sensors
// Custom decoder for generic temperature sensor
function decode(bytes, port) {
var decoded = {};
if (port === 1) {
// Temperature: 2 bytes, signed, 0.1°C resolution
var temp = (bytes[0] << 8) | bytes[1];
if (temp > 32767) temp -= 65536;
decoded.temperature = temp / 10.0;
// Humidity: 1 byte, 0.5% resolution
decoded.humidity = bytes[2] / 2.0;
// Battery: 1 byte, mV
decoded.battery = ((bytes[3] << 8) | bytes[4]);
}
return decoded;
}Usage
Understanding Tag Structure
The module creates a hierarchical tag structure for each device:
``
[LoRaWAN]
├── [DeviceEUI]
│ ├── temperature (FLOAT)
│ ├── humidity (FLOAT)
│ ├── battery (INT)
│ ├── rssi (INT)
│ ├── snr (FLOAT)
│ ├── lastSeen (DATETIME)
│ └── [_meta]
│ ├── deviceName (STRING)
│ ├── applicationId (STRING)
│ └── frameCount (INT)
``
Tags are automatically created based on the decoded payload fields.
Setting Up Alarms
Configure alarms on LoRaWAN sensor data:
- In Designer, navigate to the LoRaWAN tag folder
- Select the tag you want to alarm (e.g., temperature)
- Right-click > Configure Alarming
- Add alarm conditions:
# Check for devices that haven't reported in 1 hour
def checkOfflineDevices():
devices = system.tag.browse("[LoRaWAN]")
offline = []
threshold = system.date.addHours(system.date.now(), -1)
for device in devices:
lastSeen = system.tag.read(device.path + "/lastSeen").value
if lastSeen < threshold:
offline.append(device.name)
return offlineBuilding IoT Dashboards
Create Perspective dashboards for IoT visualization:
- IoT Device Map: Show sensor locations on a map
- Sensor Status Grid: Overview of all devices
- Time Series Charts: Historical data visualization
- Battery Status Widget: Monitor device batteries
- Device Overview Dashboard
- Environmental Monitoring
- Asset Tracking Map
- Alert Summary
Historical Data Storage
Store IoT data using Ignition Historian:
- Configure history on LoRaWAN tags:
- Storage Considerations:
Troubleshooting
No Data from Sensors
Problem: Sensors are registered but no data appears in Ignition
Solutions: 1. Verify MQTT connection is established (check MQTT module status) 2. Check sensor is transmitting (verify in network server console) 3. Confirm gateway is receiving packets (check gateway traffic) 4. Verify topic subscription matches network server format 5. Check decoder is correctly parsing payload 6. Review Ignition gateway logs for errors
Decoder Errors
Problem: Decoder returns errors or incorrect values
Solutions: 1. Verify the raw payload format in network server logs 2. Check byte order (big-endian vs little-endian) 3. Confirm data types match sensor specifications 4. Test decoder with known payload values 5. Add logging to decoder for debugging:
function decode(bytes, port) {
console.log("Port: " + port);
console.log("Bytes: " + bytes.map(b => b.toString(16)).join(' '));
// Your decoding logic here
var decoded = {};
// ...
console.log("Decoded: " + JSON.stringify(decoded));
return decoded;
}Coverage and Connectivity
Problem: Intermittent data or poor signal quality
Solutions: 1. Check RSSI values: should be > -120 dBm 2. Check SNR values: should be > -20 dB for reliable communication 3. Review gateway placement and antenna orientation 4. Consider adding additional gateways for coverage 5. Adjust sensor ADR (Adaptive Data Rate) settings 6. For indoor sensors, ensure gateway has line of sight potential
Scaling to Many Devices
Problem: Performance issues with thousands of devices
Solutions: 1. Enable tag compression in Ignition 2. Use appropriate polling rates for historical storage 3. Consider multiple tag providers for large deployments 4. Optimize Perspective bindings (avoid subscribing to all tags) 5. Use indirect bindings for dynamic device selection 6. Implement data aggregation for overview dashboards
API Reference
Scripting API
The LoRaWAN module provides scripting functions for programmatic access:
# Get list of all registered devices
devices = system.lorawan.getDevices()
# Get device info by EUI
device = system.lorawan.getDevice("0018B20000012345")
print(device.name, device.lastSeen)
# Send downlink message to device
system.lorawan.sendDownlink(
deviceEui="0018B20000012345",
port=1,
payload=[0x01, 0x02, 0x03],
confirmed=True
)
# Manually trigger payload decode
decoded = system.lorawan.decode(
profileName="Dragino LHT65",
payload=[0x0C, 0x90, 0x01, 0xF4, 0x00, 0x64],
port=2
)Ready to Get Started?
Download the LoRaWAN IoT Module and transform Ignition into your IoT platform.