Skip to main content

EDL21 Electricity Meter Bridge (LoRaWAN)

Lobaro EDL21 over LoRaWAN bridge

The EDL21 over LoRaWAN bridge is a device that can be used to read out modern utility meters with a standardized infrared "INFO" interface.

These types of meters are called "EDL21"-compatible in Germany — hence the name. The meter outputs a serial protocol conforming to the Smart Message Language Protocol 1.04 (SML) over its infrared "INFO" interface. This interface is intended to be used by end-users and not for billing purposes of the electricity supplier. The read information normally contains the current consumption values of the meter and gets interpreted and forwarded by the EDL21 bridge via a LoRaWAN network to web-based applications interested in further processing this data.

Top Features

  • LoRaWAN 1.0.x and 1.1 network servers supported
  • LoRaWAN time synchronisation
  • Configuration via USB or remotely via LoRaWAN downlink
  • Compatible with many electrical utility meters
  • Configure up to 25 OBIS codes to be read
  • RGB status LED
  • Variant with external power supply available on request
  • Separation of infrared readout head and LoRaWAN antenna possible

Compatible Utility Meters

Any meter that adheres to the standard can be read. The following list contains meters that we have successfully tested.

Electricity meterManufacturer
DTZ541-ZEBAHolley
LK13 seriesLogarex
OpenWay® 3.HZiTron
SGM-C4 seriesefr
SGM-D seriesefr
eHZ-K seriesEMH
mMe4.0 seriesEMH
ED300 seriesEMH
eBZD seriesEMH
E320Landis+Gyr
MT681ISKRA

Product Variants

EDL21-LoRaWAN Bridge (universal head, XH battery connector, int. Ant.), order number: 8000091.

EDL21 front view
EDL21 detail view next to an electricity meter

Quickstart

  1. Connect to the device with the Lobaro Maintenance Tool using the Lobaro Config Adapter.

  2. Under Configuration click "Reload Config" and change the fields ReadCron and ObisCode as needed, followed by clicking "Write to Device". An example configuration is shown below.

    EDL21 configuration in the Lobaro Maintenance Tool
  3. Register the device in your LoRaWAN network.

  4. Connect an ER34614 3.6 V D-cell battery via the XH connector, or connect an external power supply.

  5. If not connected to anything, the red LED will start blinking as long as no data is received; after 1 minute it will sleep for 15 seconds after every 5 retries.

  6. Tighten the screws and install the bridge beside your electric meter.

  7. Place the EDL21 opto head on the "INFO" interface.

  8. As soon as the EDL21 receives data, its green LED will light up for 5 seconds; when connected to a LoRaWAN network, its blue LED will light up for 5 seconds.

  9. Check the sent data (port 3). If the payload is zero, the EDL21 was not able to read data — recheck the proper alignment.

Configuration

The configuration is done using the Lobaro Maintenance Tool and the Lobaro USB PC adapter.

Available firmware versions and release notes are listed on the Firmware & Changelog page.

LoRaWAN

The connection to the LoRaWAN network is defined by multiple configuration parameters. These need to be set according to your LoRaWAN network and the way your device is supposed to be attached to it, or the device will not be able to send any data.

NameDescriptionTypeValues
OTAAActivation: OTAA or ABPbooltrue = use OTAA, false = use ABP
DevEUIDevEUI used to identify the devicebyte[8]e.g. 0123456789abcdef
JoinEUIUsed for OTAA (called AppEUI in v1.0)byte[8]e.g. 0123456789abcdef
AppKeyKey used for OTAA (v1.0 and v1.1)byte[16]
NwkKeyKey used for OTAA (v1.1 only)byte[16]
SFInitial / maximum spreading factorint7-12
ADRUse Adaptive Data Ratebooltrue = use ADR, false = don't
TimeSyncDays after which to sync timeintdays, 0 = don't sync time
RndDelayRandom delay before sendingintmax seconds
RemoteConfNot supported by this firmwareboolfalse = deactivate
LostRebootDays without downlink before reboot (triggers downlinks)intdays, 0 = don't reboot

Operation

Configuration values defining the behaviour of the device.

NameDescriptionExample value
ReadCronCron expression defining when to read0 0/15 * * * * for every 15 minutes
ObisCodeComma-separated list of OBIS codes to select a subset of the available information1-0:1.7.255*255 = Leistung (Momentan)
PayloadFormatFormat used for data upload (include timestamps or not)1 = no timestamp, 2 = include timestamp

See also our Introduction to CRON expressions and our Introduction to OBIS codes.

LED Blinking Patterns

The following patterns are explained in the order in which they appear after the initial power-on / reset of the device.

ColorDurationDescription
red/green/blue300 ms eachInitial pattern after reset
red/green1 sNew in 0.3.2: single readout success/failure before OTAA join
redshort, blinkingTrying to receive meter optical data for the first time after OTAA join
green5 secondsSuccessfully received meter optical data
blue5 secondsLoRaWAN network join
blueshortSending LoRaWAN data uplink
offLow-power mode until the next send-out cycle

As you can see from this, the device will start the LoRaWAN join only after receiving optical data at least once.

Payload

Status Packet (Port 1)

Once per day a status packet is sent. It contains basic information about the device. The battery voltage is transmitted in 1/1000 V and the temperature in 1/10 °C. Both are in big-endian byte order.

Version MajorVersion MinorVersion PatchFlagsBattery VoltageTemperature
1 byte1 byte1 byte1 byte2 byte2 byte
unsignedunsignedunsignedunsignedunsignedsigned

Payload Format 1 (default, Port 3, with exponent)

This format is used when the configuration parameter PayloadFormat is set to 1 (which is the default value).

The payload consists of multiple entries, one entry per OBIS code given in the configuration. Each entry follows this structure:

OBIS code (hex)length of value (n)valueexponent
6 bytes1 byten bytes, LSB first1 byte (signed)

Example packet: 01 00 01 08 00 FE 08 FF 01 00 00 00 00 00 00 ff 01 00 01 08 00 FE 08 FF 02 00 00 00 00 00 00 02

Entry 1:

OBIS code (hex)length of value (n)valueexponent
01 00 01 08 00 FE08FF 01 00 00 00 00 00 00ff
1-0:1.8.0*2548511-1

Value = 511 × 10⁻¹ = 51.1

Entry 2:

OBIS code (hex)length of value (n)valueexponent
01 00 01 08 00 FE08FF 02 00 00 00 00 00 0002
1-0:1.8.0*25487672

Value = 767 × 10² = 76700

Multiple messages

The bridge puts as many values in a single data message as possible (respecting the current spreading factor). When it cannot fit all values in a single message, it will send multiple data messages until all values are uploaded. It will never split a single value. Since every value is prefixed with the OBIS code, the parser can easily assign values to OBIS codes.

Payload Format 2 (extended, Port 4, with timestamp)

This format is used when the configuration parameter PayloadFormat is set to 2.

The OBIS codes and data values are transmitted as in Payload Format 1, but each uploaded LoRaWAN message with data is prefixed with a 5-byte timestamp, indicating when the values were requested from the attached meter. This allows for more precise timing information than using the time of reception, as the upload can be delayed quite heavily due to our random delay feature and potentially due to duty cycle restrictions. The timestamp also makes it easy to reassociate values from multiple uplinks to a single reading when multiple uplinks must be used to upload all values. If a readout is split over multiple uplinks (because of LoRaWAN's length restrictions), every uplink from that reading will have the same timestamp (which is the time of requesting the values from the meter).

The timestamp is sent as a UNIX timestamp encoded as a big-endian signed 40-bit number.

Payload Format 0 (legacy, Port 2, without exponent)

warning

This payload was used by previous versions of the firmware and is not supported in the current version.

The payload consists of multiple entries, one entry per OBIS code given in the configuration. Each entry follows this structure:

OBIS code (hex)length of value (n)value
6 bytes1 byten bytes, LSB first

Example packet: 01 00 01 08 00 FE 08 FF 01 00 00 00 00 00 00 01 00 01 08 00 FE 08 FF 02 00 00 00 00 00 00

Entry 1:

OBIS code (hex)length of value (n)value
01 00 01 08 00 FE08FF 01 00 00 00 00 00 00
1-0:1.8.0*2548511

Entry 2:

OBIS code (hex)length of value (n)value
01 00 01 08 00 FE08FF 02 00 00 00 00 00 00
1-0:1.8.0*2548767

Reference Decoder

This is a decoder written in JavaScript that can be used to parse the device's LoRaWAN messages. It can be used as is in The Things Network.

EDL21 payload decoder
function readName(bytes, i) {
return bytes.slice(i, i + 6);
}

function readValue(len, bytes, i) {
if (len <= 0) {
return [];
}
return bytes.slice(i, i + len);
}

function toHexString(byteArray) {
var s = '';
byteArray.forEach(function (byte) {
s += ('0' + (byte & 0xFF).toString(16)).slice(-2);
});
return s;
}

function signed(val, bits) {
if ((val & 1 << (bits - 1)) > 0) { // value is negative (16bit 2's complement)
var mask = Math.pow(2, bits) - 1;
val = (~val & mask) + 1; // invert all bits & add 1 => now positive value
val = val * -1;
}
return val;
}

function uint40_BE(bytes, idx) {
bytes = bytes.slice(idx || 0);
return bytes[0] << 32 |
bytes[1] << 24 | bytes[2] << 16 | bytes[3] << 8 | bytes[4] << 0;
}

function uint16_BE(bytes, idx) {
bytes = bytes.slice(idx || 0);
return bytes[0] << 8 | bytes[1] << 0;
}

function int40_BE(bytes, idx) {return signed(uint40_BE(bytes, idx), 40);}
function int16_BE(bytes, idx) {return signed(uint16_BE(bytes, idx), 16);}
function int8(bytes, idx) {return signed(bytes[idx || 0], 8);}

function toNumber(bytes) {
var res = 0;

for (var i = bytes.length-1; i >= 0 ; i--) {
res *= 256;
res += bytes[i];
}

return res;
}

function readVersion(bytes) {
if (bytes.length<3) {
return null;
}
return "v" + bytes[0] + "." + bytes[1] + "." + bytes[2];
}

function decodeStatus(bytes) {
var decoded = {
"version":readVersion(bytes),
"flags": bytes[3],
"vBat": uint16_BE(bytes, 4) / 1000,
"temp": int16_BE(bytes, 6) / 10,
};

return decoded;
}

function decodeSmlValuesV1(bytes) {
var decoded = {
values: [],
};

if (bytes.length === 1) {
// No Data! Read error?
return decoded;
}

var pos = 0;
while (pos < bytes.length) {
var name = readName(bytes, pos);
pos += 6;
var len = bytes[pos];
pos += 1;
var value = readValue(len, bytes, pos);
pos += len;

var val = {
nameHex: toHexString(name),
len: len,
value: toNumber(value),
valueHex: toHexString(value)
};

decoded.values.push(val);
}

return decoded;
}

function decodeSmlValuesV2(bytes) {
var decoded = {
values: [],
};

if (bytes.length === 1) {
// No Data! Read error?
return decoded;
}

var pos = 0;
while (pos < bytes.length) {
var name = readName(bytes, pos);
pos += 6;
var len = bytes[pos];
pos += 1;
var value = readValue(len, bytes, pos);
pos += len;
if (len > 0) {
var exponent = int8(bytes, pos);
pos += 1;
}
var val;
if (len > 0) {
val = {
nameHex: toHexString(name),
len: len,
value: toNumber(value) * Math.pow(10, exponent),
valueHex: toHexString(value),
}
} else {
val = {
nameHex: toHexString(name),
len: len,
value: toNumber(value),
valueHex: toHexString(value),
}
}

decoded.values.push(val);
}

return decoded;
}

function decodeSmlValuesV3(bytes) {
// Like V2, but with 5B timestamp as prefix:
var decoded = decodeSmlValuesV2(bytes.slice(5));
decoded.time = int40_BE(bytes, 0) * 1000;
return decoded;
}

function Decoder(bytes, port) {
// Decode an uplink message from a buffer
// (array) of bytes to an object of fields.
switch (port) {
case 1:
return decodeStatus(bytes);
case 2:
return decodeSmlValuesV1(bytes);
case 3:
return decodeSmlValuesV2(bytes);
case 4:
return decodeSmlValuesV3(bytes);
}
}

Example Parser Result

Test input (Port 3): 01 00 01 08 00 FE 08 FF 01 00 00 00 00 00 00 FF

Example parser result
{
"values": [
{
"len": 8,
"nameHex": "0100010800fe",
"value": 51.1,
"valueHex": "ff01000000000000"
}
]
}

Appendices

Technical Characteristics

Product

PropertyValue
Type nameLOB-S-EDL21-LW
DescriptionElectricity meter over LoRaWAN bridge

RF transceiver

PropertyValue
TypeSemtech SX1272
Frequency863 MHz to 870 MHz
Max. TX powermax. +14 dBm
Typical RF range≤ 2 km
Ideal RF range≤ 10 km (free line of sight)

LoRa communication

PropertyValue
ProtocolClass A LoRaWAN 1.0.1 EU868
Activation methodOver-the-air activation (OTAA), Activation by personalization (ABP)
EncryptionAES128

Environmental requirements

PropertyValue
Operating temperature-20 °C – 55 °C
Max. installation height2 m

Standards

CE and WEEE conformity symbols

Disposal / WEEE / Entsorgung

Dispose of the device and its batteries according to the applicable local requirements for electronic equipment. Please refer to: https://www.lobaro.com/entsorgung-weee-rohs/.

CE Declaration of Conformity

Download the CE Declaration of Conformity (PDF).