We use cookies to optimize site functionality and provide the best possible experience.
View our new Privacy and Protection of Personal Data here.
Accept Settings
INDEX

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways with 2 x 10/100Base-T(x) Ports, 1 x RS232 and 1 x RS485 Serial Ports and/or BPL (Broadband Power Line Link) User Manual

1. About LKM Series Electricity Meter Protocol to Modbus Protocol Gateways

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways are designed for industrial-grade communication with Energy Meters and particularly for facilities of rugged industry and infrastructure. LKM Series Electricity Meter Protocol to Modbus Protocol Gateways are tailored to perform various features such as wide temperature range, wide power input range and several connectivity ports. Thus, LKM Series Electricity Meter Protocol to Modbus Protocol Gateways are the best choice for all applications that require reading IEC62056-21 Meters and convert its data to Modbus Protocol.

REDZ Broadband Power Line (BPL) link allows device to communicate with full transparent TCP/IP standard over Low Voltage power lines and allows easy connection between TCP/IP based terminals without use of extra cables.

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can read IEC62056-21 Energy Meters and convert its data to Modbus Registers so that field devices or remote applications can meter data via Modbus TCP. Meter data can also be sent to MQTT Server simultaneously. OBIS  codes of read meters are fully definable by end user. Typical applications: Automated Meter reading, Telemetry, Energy Management…

1.1 LoRaWAN Meter Reader Models

 

 

LKM Series 868MHz LoRaWAN Meter Reader with Electricity Meter Protocol to Modbus Protocol Gateways can read IEC62056-21 Energy Meters and convert its data to Modbus Registers so that field devices or remote applications can meter data via Modbus TCP. Meter data will be sent to LoRaWAN Server through LoRaWAN Gateway in user defined periods. Meter data can also be sent to MQTT Server simultaneously. OBIS  codes of read meters are fully definable by end user.
Typical applications: Automated Meter reading, Telemetry, Energy Management…

2. Hardware Features

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways have the versions with and without BPL (Broadband Power Line) Link.

2.1 Features

  • Supports 2 x 10/100Base-T(X) ports
  • Supports Full/Half-Duplex, auto MDI/MDI-X on each port
  • DHCP Server Capability
  • Supports 1 x RS232 and 1 x RS485 Serial Connection up to 115200 Baud
  • Embedded web interface for ease of use
  • 2 different Gateway Operating Modes:     
    Serial IEC Meter to Modbus TCP Gateway with MQTT Publisher
    TCP/IP IEC Meter to Modbus RTU Gateway with MQTT Publisher
  • Up to 20 IEC Meter reading and conversion of their data to Modbus TCP or RTU conversion 
  • Reading up to 48 OBIS Registers and all user configurable from web interface
  • MQTT Publisher with different data transfer options
    OBIS Values as Data Objects
    OBIS Values as Modbus Frame
  • Easy to follow Meter Reading and Modbus Communication status from web interface
  • Easy to follow OBIS to Modbus mapping status from web interface
  • Easy to follow Meter Read Out Data from web interface 
  • White List or Black List based TCP/IP connection filter up to 20 IP Addresses 
  • Firmware Upgrade over Web
  • 2 firmware storage capability on same device (1 active only)
  • AC or DC wide range power options
  • Wide operating temperature range from -25 to 70 °C AC and -40 to 85 °C DC power input versions
  • Rugged Metal IP-40 housing design
  • DIN-Rail mounting

2.2 Extra Features for Models with LoRaWAN Meter Reader

  • Radio Band Options:
    868MHz
    EU 868 MHz – Europe, LoRaWAN RF Communication
  • LoRaWAN data send interval configurableWide
  • Built in LoRaWAN Duty Cycle Check
  • Built in LoRaWAN payload size check. User can read data in any interval
    LKM will automatically split based on Maximum Payload Size allowed and Duty Cycle Block Times
  • Activation Over Air (OTAA) or Activation by Personalization (ABP) Selectable
  • User defined LoRAWAN Port
  • Adaptive Data Rate functionality
  • Selectable Uplink Data Rate
  • Selectable Power Level
  • LoRaWAN Class C and Class A support
  • Easy to follow Device Status on web interface
  • Easy to follow LoRaWAN packages on web interface 

2.3 Extra Features for Models with BPL

  • Supports 2 x 10/100Base-T(X) ports + 1 x BPL link
  • Wide range 3 phase AC input
  • Supports up to 30Mbps PHY rate on BPL with Up to 10 hops and 1000 nodes
  • Up to 432 sub-carriers from 2 to 28MHz analog bandwidth
  • Support LDPC-C FEC with 128-bit AES core
  • Plug and play with Master/Slave selection via web interface

3. Installation

Each device has a Din-Rail kit on rear panel. The Din-Rail kit helps device to fix on the Din-Rail. Slant the switch and mount the metal spring to Din-Rail.

Then Push the switch toward the Din-Rail until you heard a “click” sound.

 

4. Front Panel Description

4.1 LKM154 & LKM254

 

  1. Micro USB or USB Type-C Console port for LOG in 115200 baud
    Console Tx and Rx Blinks when data transmission occurs
  2. Device Status LEDs
    STATUS: Blinks based on device operation
    - When TCP line used blinks during no connection and keeps ON after TCP connection
    - When Serial line used keeps ON
    Device Tx and Rx Blinks when data transmission occurs
    SERVER: Keeps ON after selecting Server from Server-Client Operating Modes. Keeps OFF if Client operating Mode selected
  3. ETHERNET Activity LEDs for port 1, 2 and LKM device itself. Blinks during ethernet activity
  4. 5 pin Terminal Block
    RS232: Tx, Rx and GND pins
    RS485: A, B and GND pins
    Can be activated over web interface and baud rate/data type configurable
  5. 10/100Base-T(X) Ethernet ports

 

4.2 LKM655

 

  1. Micro USB or USB Type-C Console port for LOG in 115200 baud
    Console Tx and Rx Blinks when data transmission occurs
  2. Device Status LEDs
    STATUS: Blinks based on device operation
    -When TCP line used blinks during no connection and keeps ON after TCP connection
    -When Serial line used keeps ON
    Device Tx and Rx Blinks when data transmission occurs
    SERVER: Keeps ON after selecting Server from Server-Client Operating Modes. Keeps OFF if Client operating Mode selected
  3. ETHERNET Activity LEDs for port 1, 2 and LKM device itself. Blinks during ethernet activity
  4. 5 pin Terminal Block for Serial Line
    RS232: Tx, Rx and GND pins
    RS485: A, B and GND pins
    Can be activated over web interface and baud rate/data type configurable
  5. BPL Status LED
    ACTIVITY: Blinks during BPL Ethernet activity
    LINK: LED Turns ON if the link can be established over BPL
    MASTER INDICATION: LED Turns ON if the device is configured and powered as “BPL Master” device
  6. 10/100Base-T(X) Ethernet ports

4.3 LKM354 & LKM454

 

  1. Standard SMA Antenna interface, 50 ohm
  2. Micro USB or USB Type-C Console port for LOG in 115200 baud
    Console Tx and Rx Blinks when data transmission occurs
  3. Device Status LEDs
    STATUS: Blinks based on device operation
    - When TCP line used blinks during no connection and keeps ON after TCP connection
    - When Serial line used keeps ON
    Device Tx and Rx Blinks when data transmission occurs
    SERVER: Keeps ON after selecting Server from Server-Client Operating Modes. Keeps OFF if Client operating Mode selected
  4. ETHERNET Activity LEDs for port 1, 2 and LKM device itself. Blinks during ethernet activity
  5. 5 pin Terminal Block
    RS232: Tx, Rx and GND pins
    RS485: A, B and GND pins
    Can be activated over web interface and baud rate/data type configurable
  6. 10/100Base-T(X) Ethernet ports

4.4 LKM755

  1. Standard SMA female Antenna interface, 50 ohm
  2. Micro USB or USB Type-C Console port for LOG in 115200 baud
    Console Tx and Rx Blinks when data transmission occurs
  3. Device Status LEDs
    STATUS: Blinks based on device operation
    -When TCP line used blinks during no connection and keeps ON after TCP connection
    -When Serial line used keeps ON
    Device Tx and Rx Blinks when data transmission occurs
    SERVER: Keeps ON after selecting Server from Server-Client Operating Modes. Keeps OFF if Client operating Mode selected
  4. ETHERNET Activity LEDs for port 1, 2 and LKM device itself. Blinks during ethernet activity
  5. 5 pin Terminal Block for Serial Line
    RS232: Tx, Rx and GND pins
    RS485: A, B and GND pins
    Can be activated over web interface and baud rate/data type configurable
  6. BPL Status LED
    ACTIVITY: Blinks during BPL Ethernet activity
    LINK: LED Turns ON if the link can be established over BPL
    MASTER INDICATION: LED Turns ON if the device is configured and powered as “BPL Master” device
  7. 10/100Base-T(X) Ethernet ports

 

5. Top Panel Description

5.1 LKM154 & LKM354

  1. Power Input DC: 5-48V DC (max. 60V). Polarity protected so that the power input can be connected in any direction
  2. Power LED: Turns ON when there is power in device
  3. Reset Buttons
    RESET TO SERVER: Resets the device to factory setting as Server from Server-Client Operating Modes
    RESET TO CLIENT: Resets the device to factory setting as Client from Server-Client Operating Modes
    Reset can be done at any time by pushing any of the buttons for more than 5 seconds.

5.2 LKM254 & LKM454

  1. Power Input AC: 100 - 240V AC (120 – 370V DC), 50Hz to 60Hz AC input
  2. Power LED: Turns ON when there is power in device
  3. Reset Buttons
    RESET TO SERVER: Resets the device to factory setting as Server from Server-Client Operating Modes
    RESET TO CLIENT: Resets the device to factory setting as Client from Server-Client Operating Modes
    Reset can be done at any time by pushing any of the buttons for more than 5 seconds.

 

5.3 LKM655 & LKM755

  1. Power Input AC: 3 phase input, 110V–240V/50-60Hz. It is also ok to connect only single phase to the device such as L1-N connection only.
    AC Power supply use L1-N only. Phase 2-3 connections are used to BPL signal transmission.
  2. Power LED: Turns ON when there is power in device
  3. Reset Buttons
    RESET TO SERVER: Resets the device to factory setting as Server from Server-Client Operating Modes
    RESET TO CLIENT: Resets the device to factory setting as Client from Server-Client Operating Modes
    Reset can be done at any time by pushing any of the buttons for more than 5 seconds.

 

NOTE1 :  BPL Model can be purchased in 2 versions:

1. P-N Model: Phase to neutral model (Standart Model). That version gets power from terminal pins 1 and 2 from phase and neutral. It can also transmit data from that pins and other pins usage is optionAl (Ex: Master can be connected to all phases and slaves can be connected to relevant phases)

2. P-P Model: Phase to phase model. That version also gets power from terminal pins 1 and 2 from phase and neutral. Data transmission only done through terminal pins 3 and 4. Phase to phase connection can be done to data transmission pins for better performance.
If not used then phase and neutral can still be connected for data transmission for terminal pins 3 and 4.

 

NOTE2:  BPL Model can be purchased in DC model as well:

This model will be same as "P-P Model"( Phase to phase model) on data connection and gets 12V DC power from terminal pins 1 and 2. Data transmission only done through terminal pins 3 and 4.

 

6. Ethernet Cables

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways have standard Ethernet ports. According to the link type, the switches use CAT 3, 4, 5, 5e UTP cables to connect to any other network device (PCs, servers, switches, routers, or hubs).

6.1 Cable Type and Specifications

Cable Type Max. Length Connector
10BASE-T Cat. 3, 4, 5 100-ohm UTP 100 m (328 ft) RJ-45
100BASE-TX Cat. 5 100-ohm UTP UTP 100 m (328 ft) RJ-45

6.2 ETH Cable Pin Assignments

With 100BASE-TX/10BASE-T cable, pins 1 - 2 are used for transmitting data and pins 3 - 6 are used for receiving data.

Pin Number Description
1 TD+
2 TD-
3 RD+
4 Not Used
5 Not Used
6 RD-
7 Not Used
8 Not Used

7. System Comparison Between CAT5 and BPL Links

  CAT5 Based System BPL Link Based System
Media CAT5 Power Line
Bandwidth 100Mbps Up to 30Mbps
Re-Wire Yes No, Using existing Power Line
Span <100m <600m
Multiple Nodes N/A Up to 10 hops/1000 nodes
Encryption Yes, but difficult to configure Yes, Plug & Play
Installment Difficult Easy, simply user power line
Installment Cost High Low
Total Cost High Low

 

NOTE1 :  BPL Model can be purchased in 2 versions:

1. P-N Model: Phase to neutral model (Standart Model). That version gets power from terminal pins 1 and 2 from phase and neutral. It can also transmit data from that pins and other pins usage is optionAl (Ex: Master can be connected to all phases and slaves can be connected to relevant phases)

2. P-P Model: Phase to phase model. That version also gets power from terminal pins 1 and 2 from phase and neutral. Data transmission only done through terminal pins 3 and 4. Phase to phase connection can be done to data transmission pins for better performance.
If not used then phase and neutral can still be connected for data transmission for terminal pins 3 and 4.

 

NOTE2:  BPL Model can be purchased in DC model as well:

This model will be same as "P-P Model"( Phase to phase model) on data connection and gets 12V DC power from terminal pins 1 and 2. Data transmission only done through terminal pins 3 and 4.

 

8. Serial Cables

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways have 1 x RS232 and 1 xRS485 port. Serial line can be connected energy meters directly or over REDZ KMK114- RS485 Optical Probe.

8.1 RS232 Cable Pin Assignments

1. Terminal connector for 3 wire Tx-Rx-GND RS232 data transmission

Pin Number Description
1 GND
2 Rx
3 Tx

8.2 RS485 Cable Pin Assignments

1. Terminal Connector for 2 wire RS485 connection and GND (if needed)

Pin Number Description
1 A
2 B
3 GND (Suggested to use)

 

9. Usage Scenarios and Connection Diagrams

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can be used in different scenarios. Usages are not limited to that examples and user may create their own usage scenario.

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways support up to 20 meters reading on RS485 Bus and RS232 and converts up to 48 OBIS codes to Modbus registers for each meter in reading list.

LKM Series 868MHz LoRaWAN Meter Reader with Electricity Meter Protocol to Modbus Protocol Gateway version can also send meter data to LoRaWAN Server.

9.1 LKM Connected to Meter via Direct Cable and Remote Server reads data over TCP/IP

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can be connected to RS485 or RS232 of meter and read IEC62056-21 Protocol. Remote or local Data Acquisition Server can read meter data via Modbus TCP.

 

9.2 LKM Connected to Meter via Optical Probe and Remote Server reads data over TCP/IP

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can be connected to optical interface of meter and read IEC62056-21 Protocol with auto baud change. Remote or local Data Acquisition Server can read meter data via Modbus TCP.

 

9.3 LKM Connected to TCP Meter via LAN/WAN and Local Device reads data over Modbus RTU

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can also be connected to TCP/IP meters and read IEC62056-21 Protocol. Remote or local Data Acquisition Servers or field devices can read meter data via Modbus RTU in this case over serial lines.

 

9.4 LKM Connected to Meter and Read Data Send to MQTT Server

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can be connected to energy meters and read IEC62056-21 Protocol. All read data can be sent to MQTT server for web based applications.

 

 

NOTE:  LKM can read energy meters, convert their data to Modbus TCP and send their data to MQTT Server simultaneously.

Thus, same LKM can be used for reading meter data over Modbus TCP and getting meter data from MQTT Server.

 

9.5 LKM Connected to Meter and Read Data Send to LoRaWAN Server

LKM Series 868MHz LoRaWAN Meter Reader wit Electricity Meter Protocol to Modbus Protocol Gateways can be connected to energy meters and read IEC62056-21 Protocol. All read data can be sent to LoRaWAN server for web based applications through a LoRaWAN Gateway.

 

 

NOTE:  Sending data to LoRaWAN applies only for LoRaWAN Meter Reader models.

LKM can read energy meters, convert their data to Modbus TCP and send their data to MQTT Server and send data to LoRaWAN Server simultaneously.

Thus, same LKM can be used for reading meter data over Modbus TCP and getting meter data from MQTT Server and sending data to LoRaWAN Server.

 

10. Configuration via WEB Interface

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can be configured over web interface.
Device will get IP from DHCP client when connected to a network. User can use discovery tool to see IP of the device.

Once the IP of the device is set, user may login the device by simply typing the Ip address of device.

NOTE 1: LKM default firmware runs with DHCP off and expects an IP lease. If user need static IP or prefers DHCP on during start up, additional firmware is available.

 

NOTE 2:  If there is no DHCP server in LAN, REDZ device will get default 192.168.1.1 IP if it is set as Server Mode. It will get default 192.168.1.100 IP if it is set as Client mode.

 

10.1 Connecting Web Interface

Simply write IP of the device to the http client. Google Chrome is suggested to use. Login screen will pop up.
Default user name: admin
Default password: admin


Main screen of device will appear with following information:

Firmware Info, MAC details and Device Name on top

Menu Items on left

Menu Item details in center

 

 

 

10.2 MENU: Operating Mode

From this menu user may select the operating mode of the device and enter meter reading details.

There are 2 different Gateway Operating Modes:     

     Serial IEC Meter to Modbus TCP Gateway with MQTT Publisher

     TCP/IP IEC Meter to Modbus RTU Gateway with MQTT Publisher

  • Set “Server Configuration” and select Device Function "Serial IEC Meter to Modbus TCP Gateway with MQTT Publisher" to read IEC62056-21 Meters from RS232 and/or RS485 and convert data to Modbus TCP and/or send meter data to MQTT Server.
  • Set “Client Configuration” and select Device Function "TCP/IP IEC Meter to Modbus RTU Gateway with MQTT Publisher" to read IEC62056-21 Meters from TCP/IP Network and convert data to Modbus RTU and/or send meter data to MQTT Server.

“Device Name” field is used to identify device.

When LKM is set to “Server Configuration” and Device Function "Serial IEC Meter to Modbus TCP Gateway with MQTT Publisher" is selected, Scheduler Settings will show a list to enter details regarding meter reading

There are up to 20 rows in this list, means LKM can read up to 20 meters.

"Serial Interface": Select serial interface from which the meter be connected to LKM.

"Start Baud Rate": IEC 62056-21 Mode C Communication start baud rate should be selected. LKM will switch over target baud rate automatically based on meter response.

"Meter Address": IEC 62056-21 Mode C Communication meter address. Must be entered if there are more than 1 meters on RS485 bus, otherwise the data can mix between meters.

"Reading Table Code": IEC 62056-21 Mode C Communication request message contains information regarding read out table. User can change this table number to read other tables such as Service Table.

"Send Init String": This is option to send initial string to send meter before IEC 62056-21 Mode C Communication. This is usually used to "wake up" meter. This number indicates how many times the initial string will be sent to meter.

"Init String (in ASCII)": Maximum 16 character long, initializationstring in ASCII notation. Device will add <CR> and <LF> characters at end of this string automatically. String can be letters, numbers and characters '/', '.'.

"Query Interval (In Seconds)": Minimum time interval to read the defined meter. LKM can read meter only after reading the other meters in defined list. So reading interval may change based on actual meter quantity in RS485 bus and data available in read out list of meter in query.

"Time Out (In Seconds)": Maximum time to wait until meter responses to initial request message.

"Enable": Enables row and adds this details for meter reading queue.

When LKM is set to “Client Configuration” and Device Function "TCP/IP IEC Meter to Modbus RTU Gateway with MQTT Publisher" is selected, Scheduler Settings will show another list to enter details regarding meter reading

There are 2 different settings here, different than "Server Configuration"

"TCP IP": TCP/IP address of the meter be connected and read by LKM.

"TCP Port": TCP/IP port of the meter be connected and read by LKM.

Rest settings are same and as decribed above in "Server Configuration" part.

 

When all settings done, click "Save Configuration" to save settings.

 After clicking button system will tell if the settings applied successfully or not.

 

 

 

NOTE 1: LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can keep configuration of 2 different modes in its memory and once the configuration enabled, its already saved settings will be applied. Device can act as Server or Client at a time.

 

NOTE 2: Settings will be applied once the device is rebooted from web interface or repowered manually.

10.3 MENU: Network Settings - Server

From this menu user may change the network settings of the device.

  • User can change NTP Server address that used in MQTT data transmission.
  • User can activate MQTT Publisher mode and change settings for MQTT data tranmission.
  • User can change TCP Listening port for field devices.
  • User can select maximum number of clients allowed to connect device.
  • User can activate DHCP server.
  • User can force device to a static IP.

  

"NTP Server": NTP Server address that used in MQTT data transmission.

"Enable MQTT Publisher for Enabled Obis Codes": Click to enable MQTT Publisher. LKM will send data read from meters for enabled OBIS codes ( there are up to 48 available) to MQTT Server

If "Enable MQTT Publisher for Enabled Obis Codes" is checked, following settings will be shown.

"MQTT Broker IP": TCP IP of the MQTT Server. User must enter IP value
Ex: 75.2.83.130 is for "https://tago.io/" web address

"MQTT Broker Port": TCP Port of the MQTT Server.
Ex: 1883 is for "https://tago.io/" web address

"Client ID": MQTT Publisher client ID. Default is MQTT_LKM_Client.
Maximum length for this field is 32.

"User Name": MQTT Publisher user name. This must be entered based on MQTT server settings.
Maximum length for this field is 64.

"Password": MQTT Publisher password. This must be entered based on MQTT server settings.
Maximum length for this field is 48.

"Publish Topic": MQTT Publisher topic value. Default is MQTT_LKM_Publish_topic.
Maximum length for this field is 32.

"Subscribe Topic": MQTT Publisher subscribe topic value. Default is MQTT_LKM_Subscribe_topic.
Maximum length for this field is 32.

"Minimum Send Interval for a Parsed Data (in seconds)": Minimum value to send meter data to MQTT Server. This time may be longer due to meter quantity in reading queue.

"Data Format": Options for how data is shared by LKM with MQTT server. There are 2 options:

     OBIS Values as Data Objects

     OBIS Values as Modbus Frame

When selected as "OBIS Values as Data Objects", LKM will share data as follows

Device Name, Meter Adress, Meter Number in Reading List, Data itself in pairs OBIS Code and Matched Value in ASCII readable format

Here is an example:

20:55:38:
[MQTT] Device publish
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"F.F\":\"-\",\"0.9.1\":\"225418\",\"0.9.2\":\"401231\",\"1.8.0\":\"3\",\"1.8.1\":\"3\",\"1.8.2\":\"0\",\"1.8.3\":\"0\",\"2.8.0\":\"0\",\"2.8.1\":\"0\",\"2.8.2\":\"0\",\"2.8.3\":\"0\",\"5.8.0\":\"0\",\"6.8.0\":\"0\",\"7.8.0\":\"0\",\"8.8.0\":\"0\",\"1.6.0\":\"0\",\"2.6.0\":\"0\",\"32.7.0\":\"-\",\"52.7.0\":\"-\",\"72.7.0\":\"-\",\"31.7.0\":\"-\",\"51.7.0\":\"-\",\"71.7.0\":\"-\",\"C.1.0\":\"-\",\"0.8.0\":\"-\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"F.F\":\"-\",\"0.9.1\":\"225418\",\"0.9.2\":\"401231\",\"1.8.0\":\"3\",\"1.8.1\":\"3\",\"1.8.2\":\"0\",\"1.8.3\":\"0\",\"2.8.0\":\"0\",\"2.8.1\":\"0\",\"2.8.2\":\"0\",\"2.8.3\":\"0\",\"5.8.0\":\"0\",\"6.8.0\":\"0\",\"7.8.0\":\"0\",\"8.8.0\":\"0\",\"1.6.0\":\"0\",\"2.6.0\":\"0\",\"32.7.0\":\"-\",\"52.7.0\":\"-\",\"72.7.0\":\"-\",\"31.7.0\":\"-\",\"51.7.0\":\"-\",\"71.7.0\":\"-\",\"C.1.0\":\"-\",\"0.8.0\":\"-\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }

"F.F" OBIS code is the first one and not read, which is shown as "-"
Next is "0.9.1" OBIS code which is "225418"
Next values can be seen in same manner.

When selected as "OBIS Values as Modbus Frame", LKM will share data as follows

Device Name, Meter Adress, Meter Number in Reading List, Data itself in hexadecimal format just like a Modbus query response. First byte will show data bytes count and rest is the data itself. For 48 OBIS Codes, there will be 192 bytes.

Here is an example:

21:00:40:
[MQTT] Device publish
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"ModFr\":\"C0000000000003728700061F4F000000030000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"ModFr\":\"C0000000000003728700061F4F000000030000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }

C0 in beginning is hexadecimal equivalent for 192 data bytes count
Next is "F.F" OBIS code is not read as shown above which is "0000000"
Next is "0.9.1" OBIS code which is "00037287" which is 225927 in decimal.
Next values can be seen in same manner.

Following parameters and static IP settings available for “Server Network Settings” part.

"Listening Port": TCP Port that LKM uses for incoming connections. Remote devices can use LKM IP and this port to connect to LKM for Modbus TCP query.

"Maximum Number of Clients": Maximum numbers of incoming connections accepted. LKM can accept up to 10 simultaneous connection and all devices can query Modbus TCP. 

"Use Static Address for Device": Set a static TCP IP for LKM from this part. Enable and enter network settings and LKM will be available to connect from this static IP locally or remotely (gateway must be set properly for remote WAN connection).

Following parameters available if “DHCP Server” setting is enabled. This is used if DHCP server is needed in network. LKM can distribute IP to field devices connected to it in this way.


Also if the device has Broadband Power Line (BPL) option:

User can select operating mode of BPL either MASTER or NODE.

NOTE: Standard firmware of REDZ BPL supports up to 10 hops and 1000 nodes. Only 1 device can be MASTER in same network.

 
Once the setting has been changed, “Save Configuration” button will be enabled.



After clicking button system will tell if the settings applied successfully or not.

 

NOTE 1: LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can keep configuration of 2 different modes in its memory and once the configuration enabled, its already saved settings will be applied. Device can act as Server or Client at a time.

 

NOTE 2: Settings will be applied once the device is rebooted from web interface or repowered manually.

 

10.4 MENU: Network Settings - Client

From this menu user may change the network settings of the device.

  • User can change NTP Server address that used in MQTT data transmission.
  • User can activate MQTT Publisher mode and chnage settings for MQTT data tranmission.
  • User can force device to a static IP.

  

"NTP settings", "MQTT Settings" and "Client Network Settings" are done in same way like in "Network Settings" for "Server Configuration" explained in item 10.3.


Also if the device has Broadband Power Line (BPL) option:

User can select operating mode of BPL either MASTER or NODE.

 

NOTE: Standard firmware of REDZ BPL supports up to 10 hops and 1000 nodes. Only 1 device can be MASTER in same network. If the device is in client mode, it is suggested to use “NODE” as setting.

Once the setting has been changed, “Save Configuration” button will be enabled.



After clicking button system will tell if the settings applied successfully or not.

 

 

NOTE 1: LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can keep configuration of 2 different modes in its memory and once the configuration enabled, its already saved settings will be applied. Device can act as Server or Client at a time.

 

NOTE 2: Settings will be applied once the device is rebooted from web interface or repowered manually.



10.5 MENU: Serial Settings - Client Only

This menu is shown only if LKM is set “Client Configuration” and Device Function "TCP/IP IEC Meter to Modbus RTU Gateway with MQTT Publisher" is selected to read IEC62056-21 Meters from TCP/IP Network and convert data to Modbus RTU and/or send meter data to MQTT Server.

From this menu user may select RS232 or RS485 connection for Modbus RTU communication.

  • User can select RS232 line and can set baud rate and data type for serial line.
  • User can select RS485 line and can set baud rate and data type for serial line.

"Baud rate": Serial communication baud rate selection.

"Line Control": Serial communication data type selection in form of Data bits-Parity-Stop bits. Available options are:
8_NONE_1
9_NONE_1
8_EVEN_1
8_EVEN_2
8_ODD_1
8_ODD_2
8_NONE_2
9_NONE_2

Once the setting has been changed, “Save Configuration” button will be enabled.



After clicking button system will tell if the settings applied successfully or not.

 

NOTE 1: Settings will be applied once the device is rebooted from web interface or repowered manually.

 

NOTE 2: This page is only available for Client Operating mode.

 

10.6 MENU: Device Status

From this menu user may monitor device status and statistics based on operating mode of device. The page also helps users to check meter reading and modbus communication status.

In "Device Status" part:

"IP Address": TCP/IP address of LKM itself.

"App Status": It shows current status of LKM application. "SERVING CONNECTIONS" means device is ready for normal operation.

"Log Status": It is only available when "Log" is enabled from "Management" menu and shows current status of LKM logging. "LOG_STATE_TRYWRITELOG" means normal operation.

"Log Counter": It is only available when "Log" is enabled from "Management" menu and shows how many log lines has been transfered till now.

"MQTT Sent Messages": It is only available when "MQTT" is enabled from "Network Settings" menu and shows how many MQTT messages has been transfered till now.

"MQTT Status": It is only available when "MQTT" is enabled from "Network Settings" menu and shows current status of LKM MQTT Publisher. "APP_MQTT_STATE_SUBSCRIBED" means MQTT publisher is ready for normal operation.

"N. of TCP Output Full Errors": Number of TCP output full errors during trying to send data to TCP client. Device will enter "Reboot State" if this number is above 5.

"N. of TCP Disconnections": Number of TCP disconnections from LKM.

"N. of Modbus Messages Received Correctly": Number of Modbus messages received by LKM.

"N. of Modbus Messages Sent Correctly": Number of Modbus messages sent by LKM.

"N. of Serial UART Errors": Number of Serial side uart errors both on RS232 and RS485. Device will enter "Reboot State" if this number is above 20.

"N. of Serial UART Input Overflow Errors": Number of Serial side input overflow errors both on RS232 and RS485.

"N. of Meter Messages Received Correctly": Number of Serial data packages received from meters both on RS232 and RS485 lines.

"N. of Meter Messages Sent Correctly": Number of Serial data packages sent to meters both on RS232 and RS485 lines.

In "Meter Communication Status" part:

"Meter Address": Is the configured meter address, shown for ease of monitoring.

"Connection": Is the configured serial line used to read meter, shown for ease of monitoring.

"Table Code": Is the configured meter table code to read, shown for ease of monitoring.

"Last Query Time": Is the last time this meter is tried to read. Time is shown starting from device repower/reset.

"Last Serial Package": Is the last response from this meter to request message sent by LKM.

"Status": Is the status of meter reading.

In "Modbus Communication Status" part:

"Ip Address": Is the TCP IP address of client connected to LKM.

"Port Number": Is the TCP Port number of client connected to LKM.

"Last Query Time": Is the last time this client queried LKM with a Modbus TCP message. Time is shown starting from device repower/reset.

"Last Modbus Received Package": Is the last Modbus TCP query message from this client received by LKM.

"Last Modbus Sent Package": Is the last Modbus TCP response message for this client sent by LKM.

After clicking “Refresh Status” button, system will reload data only and will not reload page. Button will be disabled during reload for an instance. If timeout occurs during the reload, the button will be enabled again with warning of timeout. In normal operation reload of status data will be done immediately. "Reset Logs" button will reset device status parameres.

 

NOTE 1:  LKM Series 868MHz LoRaWAN Meter Reader with Electricity Meter Protocol to Modbus Protocol Gateways have slightly different menu and will have following extra items:

"N. of Module UART Input Overflow Errors": Number of module input overflow errors.

"N. of Module UART Errors": Number of module uart errors. Device will enter "Reboot State" if this number is above 20.

"N. of Incorrect LoRa Characters Received": Number of Incorrect characters received during getting LoRa packages.

"N. of CRC Errors on LoRa Input Messages": Number of CRC errors during getting LoRa packages.

"N. of LoRa Messages Sent Correctly": Number of LoRa packages sent to LoRaWAN Network successfully.

"N. of LoRa Messages Received Correctly": Number of LoRa packages received successfully over the LoRaWAN Network.

"N. of LoRa Messages Lost": Number of LoRaWAN messages lost (and failed to transmit to LoRaWAN Server) due to too much data in memory queue. User can try reduce data query interval from field device in that case.

"N. of LoRaWAN Messages Pending": Number of LoRaWAN messages pending in the memory of device.

NOTE 2:  Device can store 1 message for each meter defined in device and data will not be renewed untill it is sent to LoRaWAN Server.

"Last LoRaWAN Message Duty Cycle Block Time (s)": Duty Cycle Block Time shows how much device will wait after last message sent to LoRaWAN Server due to Duty Cycle Limitations.

 

NOTE 3:  "Modbus Communication Status" will list based on "Maximum Number of Clients" set in "Network Settings" menu.

 

NOTE 4:  "Client Operation Mode" has similar status menu. In client configuration LKM will read remote TCP IP meters and convert data to Modbus RTU.

 

Thus in client version the serial status will show data for Modbus RTU and TCP status will show data for meter in query.

 

10.7 MENU: Gateway Settings

From this menu user may change LKM gateway parameters.

  • Modbus Address of LKM can be changed
  • Read OBIS codes can be changed one by one to fit read out list of meter
  • Read OBIS codes can be enabled to read for meter reading list. There are up to 48 OBIS codes available to be enabled and read from meter.

"Gateway Modbus Adress": Is the Modbus address of LKM.

"Obis Code": OBIS code itself. User may change one by one based on read out list of meter in query.

NOTE:  An easy way to change OBIS codes based on read ot list is to open 2 webpages side by side for same LKM. First will show "Gateway Settings" and second will show "Meter Reading Status", so that user can see the read out data and change OBIS code needed easily.

"Enable": If any of OBIS code is enabled, that will be searched for during meter reading and will be mapped in Mdobus registers.

After clicking “Refresh Status” button, system will reload data only and will not reload page. Button will be disabled during reload for an instance. If timeout occurs during the reload, the button will be enabled again with warning of timeout. In normal operation reload of status data will be done immediately.

Once the setting has been changed, “Save Configuration” button will be enabled.



After clicking button system will tell if the settings applied successfully or not.

 

10.8 MENU: LoRa Settings

From this menu user may change LoRaWAN parameters.

  • Select Activation method
    End-Device Activation Over the Air (OTAA)
    End-Device Activation by Personalization (ABP)
  • Enter Device Address, Network Session Key and Application Session Key if ABP selected
  • Enter Application EUI and Application Key if OTAA selected (device already have unique Device EUI)
  • Change LoRaWAN port
  • Activate or Deactivate Adaptive Data Rate
  • Select Uplink Data Rate
  • Select Tx Power Level (EIRP)
  • Select LoRaWAN Class A or Class C (only unicast messages supported)
  • Select LoRaWAN Data Transmission Method as with or without Acknowledgement message.
  • Minimum Send Interval for a Parsed Data (in seconds)
  • Data send format
  • Enable or Disable Send OBIS Code Details as Status Message At Start

LKM uses Semtech’s LoRa proprietary spread spectrum modulation technique. This modulation, in contrast to conventional modulation techniques, permits an increase in link budget and increased immunity to in-band interference. It achieves sensitivities 8 dB better than FSK modulation.

LoRa also provides significant advantages in both blocking and selectivity, solving the traditional design compromise between range, interference immunity and energy consumption.

Tx Power Level EIGRP is calculated as following:

Max. EIRP = MIN (Max. allowed EIRP, Max. RF Power + RF Gain + 2.15dB)

If ABP is selected, following settings will be available:

  • Device Address: A unique 32-Bit device-address, used for radio communication within a LoRaWAN network.
  • Network Session Key: A device-specific 128-Bit network session key used for MIC calculation and verification.
  • Application Session Key: A device-specific 128-Bit application session key used to encrypt and decrypt the payload field of application specific messages.

 

LKM Series 868MHz LoRaWAN Meter Reader with Electricity Meter Protocol to Modbus Protocol Gateways can send data to LoRaWAN Server in user defined periods.

"Minimum Send Interval for a Parsed Data (in seconds)": Minimum value to send meter data to MQTT Server. This time may be longer due to meter quantity in reading queue.

"Data Format": Options for how data is shared by LKM with LoRaWAN server. There is 1 option for now:

     Parsed Data as Modbus Frame

"Send OBIS Code Details as Status Message At Start": If enabled, LKM will send status message for enabled/configured OBIS codes in system to LoRaWAN Server. If not needed, it can be disabled. 

 

The details of how data sent to LoRaWAN Server and payload formatting is described in Chapter 13 "LoRaWAN Communication Example" with example application.

NOTE 1: There are 2 Status Messages available, 1 sent in every connection to LoRaWAN Server, the other is optional.

Status Message - Device Status

Message sent to LoRaWAN Port number 1 in every connection to LoRaWAN Server

4 Bytes: LKM unique Device Id

1 Byte: Frame Type (Lower 4 bits) and Package Number (Upper 4 bits). If Package Number is 1 or more that means the package splitted.

0x00 : means status package for device status and package is the first package

1 Byte: Number of Meters configured to be read

1 Byte: Number of OBIS Codes configured  to be read

1 Byte: LoRaWAN Port of the response package

4 Bytes: RTC Time

3 Bytes: LKM Device firmware version

N Bytes (maximum 22): LKM Device name configured by user

 

Status Message - OBIS Details

Message sent to LoRaWAN Port number 1 in every connection to LoRaWAN Server if enabled by user.

4 Bytes: LKM unique Device Id

1 Byte: Frame Type (Lower 4 bits) and Package Number (Upper 4 bits). If Package Number is 1 or more that means the package splitted.

0x01 : means status package for OBIS details and package is the first package

OBIS Frames are shared 1 by 1 in following format, qty is given in Device Status message

1 Byte: OBIS Code Number in same sequence configured from web interface

1 Byte: Hexadecminal character 0x1F as seperator character

N Bytes (maximum 15): Configured OBIS Code itself like "1.8.0", each character in ASCII format

1 Byte: Hexadecminal character 0x1F as seperator character

....Next Obis Frame that maximum payload size allows.

 

NOTE 2:  Data sent to LoRaWAN Server only if meter data is read and minimum data send interval has passed. Here is data format:

Meter Data Message - Parsed from Meter Reading

Message sent to LoRaWAN configured Port (default is 3) and minimum send interval can be configured by user

4 Bytes: LKM unique Device Id

1 Byte: Frame Type (Lower 4 bits) and Package Number (Upper 4 bits). If Package Number is 1 or more that means the package splitted.

0x02: means meter data package and package is the first package

1 Byte: Read Meter number in same sequence configured from web interface

1 Byte: Data Starting OBIS Code Number in same sequence configured from web interface

1 Byte: Total Data Size in Payload

Meter Data Frames are shared 1 by 1 in following format, each data is 4 bytes

4 Bytes: Meter Data

....Next data that maximum payload size allows

 

Once the setting has been changed, “Save Configuration” button will be enabled.

After clicking button system will tell if the settings applied successfully or not.

 

NOTE 1: LKM Series LoRaWAN EndNode Modems can keep configuration of 2 different modes in its memory and once the configuration enabled, its already saved settings will be applied. Device can act as Server or Client at a time. This way different LoRa settings can be stored in 2 different operating modes.

 

NOTE 2: Settings will be applied once the device is rebooted from web interface or repowered manually.

 

NOTE 3: This page has same settings both for Server and Client operating modes.

 

10.9 MENU: Gateway Status

From this menu user may monitor gateway status and statistics. The page also helps users to check meter OBIS codes to Modbus registers mapping.

"Meter Read Counter": Number of total successfull reading of meters in list..

"Last Read Meter": The number of meter in list which is last read.

"Last Identification Message": Last Identification message received from the meter in query.

"Latest Received Message": Last data package received from the meter in query.

In "Show OBIS Values For" part:

"Show OBIS Values For": Default value is "Last Read Meter". That means when user clicks "Refresh Gateway Status", LKM will show latest OBIS codes and found values for last read meter.

If read out values of specific meter is needed, user may select the meter number in list and click "Set Show Meter Value". LKM will confirm this change with following pop up screen.

Then, "Reading OBIS Details" part will show values for selected meter in list whenever "Refresh Gateway Status" clicked.

In "Reading OBIS Details" part:

"Obis Code": Is the configured OBIS code for look for in reading, shown for ease of monitoring.

"Found Value": Is the value found for this specific OBIS code in meter read out list.

NOTE:  If OBIS code not enabled, it will show N.A.

If not found it will show "-".

"Found In Message": Is the IEC62056-21 data line that the OBIS code is found during reading this specific meter. 

 

After clicking “Refresh Status” button, system will reload data only and will not reload page. Button will be disabled during reload for an instance. If timeout occurs during the reload, the button will be enabled again with warning of timeout. In normal operation reload of status data will be done immediately.

10.10 MENU: LoRa Status

From this menu user may monitor LoRa status and package details. Package from gateway side comes from either TCP/IP or RS232/RS485 serial line based on operating mode of device. The page also helps users to diagnose LoRaWAN connection status.

The page has several parts. 

LoRaWAN Network/Activation Status: 

"Network Status": That part shows if the LKM is Active in LoRaWAN Network or not. Following Options are available:
Active (ABP)
Active (OTAA)
Joining (OTAA)
If the devices goes to "Active" status, the other LoRaWAN network information will be available as well.

"Data Rate": Shows current data rate used to send data packets in the next uplink.

"LoRaWAN Port Number": Shows the LoRaWAN Port Number used for sending data packets in the next uplink.

"Maximum Payload Size": Shows maximum payload size allowed in LoRaWAN Network.

"Device Address": Shows unique 32-Bit device address that is used for sending data packets in LoRaWAN Network.

"Power Level (EIRP)": Shows current configured transmit power level.

Latest Sent and Received LoRaWan Data Message Details:

"Device Time": Shows the system time when latest LoRaWAN message sent.

"Data Rate": Shows the data rate of latest LoRaWAN message sent.

"Channel": Shows the channel of latest LoRaWAN message sent.

"Nu. Of Transmitted Packages": Shows the number of radio packages used for latest LoRaWAN message sent.

"Transmit Power Level (dBm)": Shows the transmit power level in dBm of latest LoRaWAN message sent.

"RF Msg. Air Time (ms)": Shows the airtime in miliseconds of latest LoRaWAN message sent.

"No Data Received Counter": Shows the numbe rof LoRaWAN messages received without any data.

"Device Time": Shows the system time when latest LoRaWAN message received.

"Data Rate": Shows the data rate of latest LoRaWAN message received.

"Channel": Shows the channel of latest LoRaWAN message received.

"RSSI (dBm)": Shows the RSSI value in dBm of latest LoRaWAN message received.

"SNR (dB)": Shows the SNR value in dB of latest LoRaWAN message received.

"RxSlot": Shows the Rx Slot value of latest LoRaWAN message received.

Latest LoRaWan and Gateway Side Message Details: 

Gateway side is TCP/IP or Serial side based on user settings.

"Device Time": Shows the system time when latest LoRaWAN message received.

"Message Type": That part shows latest received LoRaWAN message type. Following Options are available:
GET_NWK_STATUS_RSP
RECV_CDATA_IND
RECV_UDATA_IND
RECV_NO_DATA_IND
SEND_CDATA_TX_IND
SEND_CDATA_RSP
SEND_UDATA_TX_IND
SEND_UDATA_RSP
JOIN_NETWORK_IND
JOIN_NETWORK_TX_IND
OTAA_JOIN_NETWORK_RSP
OTAA_SET_JOIN_PARAM_RSP
ABB_ACTIVATE_DEVICE_RSP

"Payload in Hex": Shows latest LoRaWAN message received payload in Hexadecimal format.

"Payload As ASCII": Shows latest LoRaWAN message received payload in ASCII format.

"Device Time": Shows the system time when latest Gateway side message received.

"Payload in Hex": Shows latest Gateway side message received payload in Hexadecimal format.

"Payload As ASCII": Shows latest Gateway side message received payload in ASCII format.

 

NOTE: This page has same options both for Server and Client operating modes.

10.11 MENU: Meter Reading Status

From this menu user may monitor instantaneous meter reading status. It is helpful to check meter reading data and OBIS code settings.

 

After clicking “Refresh Status” button, system will reload data only and will not reload page. Button will be disabled during reload for an instance. If timeout occurs during the reload, the button will be enabled again with warning of timeout. In normal operation reload of status data will be done immediately.

 

10.12 MENU: Security Settings - Server Only

This menu is available only in Server Operating mode since it filters TCP/IP connections based on IP of the devices.
From this menu user may activate TCP IP filter based on White list (accepted packages from IP Address) or Black list ( rejected packages from IP Address). 

  • User can select to activate White List and CKL device will accept data packages only from the devices with addresses stated in the list.
  • User can select to activate Black List and CKL device will accept all data packages except from the devices with addresses stated in the list.

  

Up to 20 IPs to be filtered are available for any of the list.

Once the setting has been changed, “Save Configuration” button will be enabled.



After clicking button system will tell if the settings applied successfully or not.

 

NOTE 1: Settings will be applied once the device is rebooted from web interface or repowered manually.

 

NOTE 2: This page is only available for Server Operating mode.

 

10.13 MENU: Management

From this menu user may change parameters or send command to device 

  • User can change system time for models with LoRaWAN Connectivity. There is no battery inside the device so clock will be lost after a power down and will set to default.

The device restarts itself every 86400 seconds (which means every 24 hours). There are also timeout restart routines in Server mode during listening clients and in Client Mode trying to connect to the server. ( both preset to 10 minutes which means device will restart system if fails to connect a server in Client mode or a client do not connect in preset time in Server mode)

  • User can change firmware of device. LKM Series Electricity Meter Protocol to Modbus Protocol Gateways has easy to use firmware capability and system can store 2 firmware at memory. After a firmware change, user can restore back old firmware anytime needed.

After a firmware change old configuration will be used for minor changes. If a major change occurs system will restore to factory default configuration.

  • User can change the login information.

  • User can change the debug level of the device. LKM Series Electricity Meter Protocol to Modbus Protocol Gateways has micro USB or USB Type-C and gives log in 115200 - 8N1 format.
    Any terminal program can be used to listen the LOG over USB type-C or micro USB port of the device which is recognized as Virtual COM port in PC.
    LOG to remote UDP server is also available. If set to UDP server, then LKM will send LOG data to remote UDP server device.

  • User can restore to factory settings and force device to reboot. Factory settings restored for Client if the device in Client mode and factory settings are restored for Server if the device in Server mode.

In "Live Firmware Update" part:

Firmware upgrade is possible only with files that REDZ supplied. Once the file selected, TLM shows selected file:



Then “Upload Firmware” button must be clicked. LKM will start to upload file and show status on pop up screen.

Click "Close" when finished. If somehow LKM fails to upload, refresh webpage and try again please.

After successful upload, LKM will show "Alternative Firmware Date" and "Alternative Firmware Version" data.

Click "Reboot Alternative Firmware" and LKM will reboot with new firmware and show status on screen.

This will take 5 seconds only. Please wait .

Check firmware details from upper part of main screen please if the update firmware procedure finalized properly.

 

NOTE 1:  User must refresh cache of their browser by clicking CTRL+F5 after a succesfull firmware change so that it will force browser to reload web interface (with latest updates/changes). 

 

NOTE 2:  In major updates user must also reset device to factory settings.

In "Download / Upload Configuration" part:

User download current configuration of the device to a file or restore a previously defined configuration to device from file.

"Download Current Configuration": Downloads the configuration to a file. It uses "Device Name" for file name and the extensions will be "*.zcfg".
"Download Configuration File": Uploads the configuration from "*.zcfg" file.

 

In "Log" part:

User may activate Logging and see details of operation. There are different levels of Log with different amount of data. 

"None": Logging is closed
"Error": Only errors in systems will be logged
"Info": General info and errors will be logged
"Debug": All details regarding device operation will be logged

If "Console" is selected as output of Log, then micro USB or USB Type-C port of device will be used for logging. Proper cable must be connected and a teminal should be used to receive Log data. As an example "RealTerm" tool can be used.

Simply select COM port and set baud rate 115200 and data type 8N1 and then click open. Device will send log data.

If "UDP Server" is selected as output of Log, then proper tool must be used to get log data. User must set "UDP Server IP" and "UDP Server Port". Device will send Log to that address. As an example "Package Sender" tool can be used.

Click "File" and then "Settings". Enable "UDP Server" and set the port. Device will send Log data to UDP server.

Here is a video example to enable UDP log and receive data via UDP Server software. Video is created with CKL series but applies to all series.

 

NOTE: This page has same settings both for Server and Client operating modes.

 

 

 

11. Modbus Communication Example

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways reads IEC62056-21 Mode C energy meters via direct RS232 or RS485 connection or connection over optical probe or over TCP/IP.  Field devices or applications can get meter data mapped to Modbus registers via Modbus TCP ( or Modbsu RTU).

11.1 Modbus Data Registers Table: Default OBIS Codes

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways read the data table of IEC62056-21 meters and maps the following OBIS code data to following Modbus Registers:

 

NOTE:  User can define and enable up to 48 OBIS codes that will be looked for in meter read out list. 24 of them enabled in default list and user can enable base on application needs.

User can edit any OBIS codes that will be looked for in meter read out list and change based on application needs.

 

Register Number OBIS Code Search String Register Name Modbus Address (Dec) Modbus Address (Hex) Data Type
1 F.F “F.F” Error Code 1 0x01 Long Int (Int32)
2 0.9.1 “0.9.1” Time 3 0x03 Long Int (Int32)
3 0.9.2 “0.9.2” Date 5 0x05 Long Int (Int32)
4 1.8.0 "1.8.0" Total active energy import A+ 7 0x07 Long Int (Int32)
5 1.8.1 "1.8.1" Total active energy import A+, Tariff 1 9 0x09 Long Int (Int32)
6 1.8.2 "1.8.2" Total active energy import A+, Tariff 2 11 0x0B Long Int (Int32)
7 1.8.3 "1.8.3" Total active energy import A+, Tariff 3 13 0x0D Long Int (Int32)
8 2.8.0 "2.8.0" Total active energy export A- 15 0x0F Long Int (Int32)
9 2.8.1 "2.8.1" Total active energy export A-, Tariff 1 16 0x11 Long Int (Int32)
10 2.8.2 "2.8.2" Total active energy export A-, Tariff 2 19 0x13 Long Int (Int32)
11 2.8.3 "2.8.3" Total active energy export A-, Tariff 3 21 0x15 Long Int (Int32)
12 5.8.0 "5.8.0" Total reactive inductive energy import (Ri+) Q1 23 0x17 Long Int (Int32)
13 6.8.0 "6.8.0" Total reactive capacitive energy import (Rc+) Q2 25 0x19 Long Int (Int32)
14 7.8.0 "7.8.0" Total reactive inductive energy export (Ri-) Q3 27 0x1B Long Int (Int32)
15 8.8.0 "8.8.0" Total reactive capacitive energy export (Rc-)  Q4 29 0x1D Long Int (Int32)
16 1.6.0 "1.6.0" Total maximal average import power P+max 31 0x1F Long Int (Int32)
17 2.6.0 "2.6.0" Total maximal average export power P-max 33 0x21 Long Int (Int32)
18 32.7.0 “32.7.0” L1 Voltage; instantaneous value 35 0x23 Long Int (Int32)
19 52.7.0 “52.7.0” L2 Voltage; instantaneous value 37 0x25 Long Int (Int32)
20 72.7.0 “72.7.0” L3 Voltage; instantaneous value 39 0x27 Long Int (Int32)
21 31.7.0 “31.7.0” L1 Current ; instantaneous value 41 0x29 Long Int (Int32)
22 51.7.0 “51.7.0” L2 Current ; instantaneous value 43 0x2B Long Int (Int32)
23 71.7.0 “71.7.0” L3 Current ; instantaneous value 45 0x2D Long Int (Int32)
24 C.1.0 “C.1.0” Meter number / meter ID 47 0x2F Long Int (Int32)

User can edit any OBIS codes that will be looked for in meter read out list and change based on application needs freely from web interface. Here is screenshot for relevant menu

11.2 Modbus Data Registers Table: Reading with Modbus Commands

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways meter data can be read by Holding Register command (Function Code 3). Values can be queried individually or as array.

 

Read Holding Registers (Function Code=3)

Request

This command is requesting the content of meter data holding registers # 40006 to 40013 from the LKM Series Electricity Meter Protocol to Modbus Protocol Gateways with address 1.

0001 0000 0006 01 03 0005 0008

0001:  Modbus TCP - Transaction Identifier

0000:  Modbus TCP - Protocol Identifier

0006:  Modbus TCP - Message Length (6 bytes to follow)

01:  The Slave Address (01 hex = address 1 )

03:  The Function Code 3 (read IEC62056-21 read-out mapped data)

0005:  The Data Address of the first register requested. 

(0005 hex = 5 , + 40001 offset = input #40006 )

 

NOTE:  This example shows reading of 1 meter in RS485 bus. If there are more then 1 meter in bus ( LKM can read up to 20 meters in same RS485 bus) then address will be simply incremented by decimal 256

same data address example for other meters:

2nd meter : 0x0105

3th meter : 0x0205

....

10th meter: 0x0905

11th meter: 0x0A05

....

20th meter: 0x1305

All meters can be read by field Modbus TCP master devices simultaneoulsy over different registers.

 

0008:  The total number of registers requested. (read 8 registers for 4 values since each value is 4 bytes, 40005 to 40013)  

540D:  The CRC (cyclic redundancy check) for error checking.

Response

0001 0000 0013 01 03 10 0000 0000 0000 0000 0000 0000 0000 0000

0001:  Modbus TCP - Transaction Identifier

0000:  Modbus TCP - Protocol Identifier

0013:  Modbus TCP - Message Length (19 bytes to follow)

01:  The Slave Address (01 hex = address 1)

03:  The Function Code 3 (read IEC62056-21 read-out mapped data)

10:  The number of data bytes to follow (4 registers x 4 bytes each = 16 bytes)

0000 0000:  The contents of register #40006

0000 0000: The contents of register #40008

0000 0000: The contents of register #40010

0000 0000: The contents of register #40012

 

Example 1

if read-out data has following line

1.8.0(128.579*MWh)

Read out value is stored at address 0x05 as per Modbus Address Table:

1.8.0 "1.8.0" Total active energy import A+ 5 0x05 Unsigned Long (UInt32)

The read data will be “128579” and user should implement the coefficient to show value properly with or without comma.

Example 2

if read-out data has following line

5.8.0(17.260*MVarh)

Read out value is stored at address 0x0D as per Modbus Address Table:

5.8.0 "5.8.0" Total reactive inductive energy import (Ri+) Q1 13 0x0D Unsigned Long (UInt32)

The read data will be “17260” and user should implement the coefficient to show value properly with or without comma.

User can cross check those values from "Gateway Status" menu.

 

NOTE:  Data can be negative (with "-" sign). User must interprete that data on their Modbus application accordingly.

 

11.2 Modbus Data Registers Table: Reading Example

Enter the readout list based on field application. In our example we have 3 meters

Meter 1: Connected via optical interface of meter and start baud rate is 300baud. There is no meter number

Meter 2: Connected directly from RS485 interface of meter and start baud rate is 19200baud with meter number 5061905.

Meter 3: Connected  via optical interface of meter and start baud rate is 300baud with meter number ELM82733811.

After entering all details, we also click "Enable" to put that row in to meter read queue.

NOTE:  When all meters are connected over RS485, meter number is a must to enter.

In our example we have different implementation so that we can still not enter the meter number of first meter.

Once all settings are entered, click "Save Configuration" and save settings and then click "Reboot Device" under "Management Menu" to restart device with new settings.

NOTE:  If the device is busy with meter reading, saving data may delay few seconds for finishing reading meter.

Go to "Device Status" and check if meters are responding by checking "Last Serial Package" data in "Meter Communication Status" list.

We can also check instantaneous reading result on "Meter Reading Status" menu item.

Go to "Gateway Settings" and open another web page for same LKM. Check reading values and adapt OBIS codes based on actual reading values of meter read out list. 

Once changing of OBIS codes complete, click "Save Configuration" to look for new defined OBIS codes.

Go to "Gateway Status" menu and check all data is there as per application's need.

Now LKM is ready to be read via Modbus TCP device or application. We will use "Modbus Poll" software in this application. Open application and connect LKM based on defined TCP/IP and port (or IP released from DHCP server).

In our application we have 3 meters and 24 OBIS codes enabled for each. 

Click "New" and enter Modbus reading details for Meter 1:

Modbus start address will be 0x0000 ( decimal 0) for Meter 1.

Click "New" again and enter Modbus reading details for Meter 2:

Modbus start address will be 0x0100 ( decimal 256) for Meter 2.

Click "New" again for last time and enter Modbus reading details for Meter 3:

Modbus start address will be 0x0200 ( decimal 512) for Meter 3.

Software will read data based on "Display" settings as follows:

User again cross check data with "Gateway Status" menu.

 

12. MQTT Communication Example

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways read IEC62056-21 Mode C energy meters via direct RS232 or RS485 connection or connection over optical probe or over TCP/IP.  Field devices or applications can get meter data mapped to Modbus registers via Modbus TCP ( or Modbsu RTU). Simultaneously all meter data can be sent to MQTT Server.

12.1 MQTT Data Transmission: Example

Enter meter reading details to LKM and make sure all readings are ok.

Please follow details regarding settings and put into operation of LKM is explained in chapter "11.2 Modbus Data Registers Table: Reading Example" for adding meter details and reading meter data.

Then go to "Network Settings" menu and "Enable MQTT Publisher for Enabled Obis Codes" part.

In our example we will use "https://tago.io/" as MQTT Server.

Go to MQTT server panel and click "Add Device" to add LKM to MQTT Server. We will also get password after adding device.

Select "Custom MQTT".

Then enter "Device name" in pop up screen and click "Create My Device".

Click "Finish" when all done.

Once the device is created, click "Copy Token" button. This will copy password value.

Then go back to LKM and enter that value as password and click "Save Configuration" button.

"MQTT Broker IP": TCP IP of the MQTT Server. User must enter IP value
75.2.83.130 is IP of "https://tago.io/" web address.

"MQTT Broker Port": TCP Port of the MQTT Server.
1883 is TCP Port of "https://tago.io/" web address.

"Client ID": MQTT Publisher client id. Default is MQTT_LKM_Client.
Maximum length for this field is 32.

"User Name": MQTT Publisher user name. This must be entered based on MQTT server settings.
Maximum length for this field is 64.

"Password": MQTT Publisher password. This must be entered based on MQTT server settings.
Maximum length for this field is 48.

"Publish Topic": MQTT Publisher topic value. Default is MQTT_LKM_Publish_topic.
Maximum length for this field is 32.

"Subscribe Topic": MQTT Publisher subscribe topic value. Default is MQTT_LKM_Subscribe_topic.
Maximum length for this field is 32.

"Minimum Send Interval for a Parsed Data (in seconds)": Minimum value to send meter data to MQTT Server. This time may be longer due to meter quantity in reading queue.

"Data Format": Options for how data is shared by LKM with MQTT server. There are 2 options:

     OBIS Values as Data Objects

     OBIS Values as Modbus Frame

When selected as "OBIS Values as Data Objects", LKM will share data as follows

Device Name, Meter Adress, Meter Number in Reading List, Data itself in pairs OBIS Code and Matched Value in ASCII readable format

Here is an example:

20:55:38:
[MQTT] Device publish
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"F.F\":\"-\",\"0.9.1\":\"225418\",\"0.9.2\":\"401231\",\"1.8.0\":\"3\",\"1.8.1\":\"3\",\"1.8.2\":\"0\",\"1.8.3\":\"0\",\"2.8.0\":\"0\",\"2.8.1\":\"0\",\"2.8.2\":\"0\",\"2.8.3\":\"0\",\"5.8.0\":\"0\",\"6.8.0\":\"0\",\"7.8.0\":\"0\",\"8.8.0\":\"0\",\"1.6.0\":\"0\",\"2.6.0\":\"0\",\"32.7.0\":\"-\",\"52.7.0\":\"-\",\"72.7.0\":\"-\",\"31.7.0\":\"-\",\"51.7.0\":\"-\",\"71.7.0\":\"-\",\"C.1.0\":\"-\",\"0.8.0\":\"-\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"F.F\":\"-\",\"0.9.1\":\"225418\",\"0.9.2\":\"401231\",\"1.8.0\":\"3\",\"1.8.1\":\"3\",\"1.8.2\":\"0\",\"1.8.3\":\"0\",\"2.8.0\":\"0\",\"2.8.1\":\"0\",\"2.8.2\":\"0\",\"2.8.3\":\"0\",\"5.8.0\":\"0\",\"6.8.0\":\"0\",\"7.8.0\":\"0\",\"8.8.0\":\"0\",\"1.6.0\":\"0\",\"2.6.0\":\"0\",\"32.7.0\":\"-\",\"52.7.0\":\"-\",\"72.7.0\":\"-\",\"31.7.0\":\"-\",\"51.7.0\":\"-\",\"71.7.0\":\"-\",\"C.1.0\":\"-\",\"0.8.0\":\"-\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }

"F.F" OBIS code is the first one and not read, which is shown as "-"
Next is "0.9.1" OBIS code which is "225418"
Next values can be seen in same manner.

When selected as "OBIS Values as Modbus Frame", LKM will share data as follows

Device Name, Meter Adress, Meter Number in Reading List, Data itself in hexadecimal format just like a Modbus query response. First byte will show data bytes count and rest is the data itself. For 48 OBIS Codes, there will be 192 bytes.

Here is an example:

21:00:40:
[MQTT] Device publish
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"ModFr\":\"C0000000000003728700061F4F000000030000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }
{ "topic": "MQTT_LKM_Publish_topic", "payload": "{\"LKMNme\":\"LKM_SERVER\",\"MtrAdr\":\"5061905\",\"MtrNmr\":\"2\",\"Data\":{\"ModFr\":\"C0000000000003728700061F4F000000030000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}}", "qos": 0, "isHex": false, "bucket": "64e90b10e44dde000f7149fa", "messageId": 0 }

C0 in beginning is hexadecimal equivalent for 192 data bytes count
Next is "F.F" OBIS code is not read as shown above which is "0000000"
Next is "0.9.1" OBIS code which is "00037287" which is 225927 in decimal.
Next values can be seen in same manner.

When all settings are done click "Save Configuration".

Go back to "https://tago.io/" panel and click "Live Inspector" for the LKM and click "Play button".

Data will be shown in real time.

User has to parse and use that parsed data for visualization (for graphs for example) for their application. That is beyond scope of LKM usage.

 

13. LoRaWAN Communication Example

LKM Series 868MHz LoRaWAN Meter Reader with Electricity Meter Protocol to Modbus Protocol Gateways read IEC62056-21 Mode C energy meters via direct RS232 or RS485 connection or connection over optical probe or over TCP/IP.  All read meter data can be send to LoRaWAN Server. Simultaneously field devices or applications can get meter data mapped to Modbus registers via Modbus TCP (or Modbus RTU) and all meter data can also be sent to MQTT Server.

We used The "Things Network" as LoRaWAN Server in this application.

13.1 Define LoRaWAN Settings

Enter meter reading details to LKM and make sure all readings are ok.

Please follow details regarding settings and put into operation of LKM is explained in chapter "11.2 Modbus Data Registers Table: Reading Example" for adding meter details and reading meter data.

Then go to "LoRa Settings" menu.

Next step will be configuring the settings for LoRaWAN server.

Activation Method: We selected End-Device Activation Over-the-Air (OTAA) method for this example. Activation by Personalization (ABP) can also be selected if needed.

Also, device is defined in The Things Network LoRaWAN Server with this specific Device EUI 70-B3-D5-8F-F1-01-85-B7

Application Key and Aplication EUI: Values entered based on values in The Things Network LoRaWAN Server.

LoRaWAN Port: Port is selected for this Application.

Port 1 is used by LKM Device Status info
Port 2 is used by OBIS Status info
Port 3 is used to send Meter Read data as default however any number between 3 and 255 can be entered here based on Application needs.

Data Rate and Other Settings: We selected SF7 data rate so that LKM can send with fastest Uplink Data Rate to LoRaWAN server side. Other settings are available based on Application needs. In this example LoRaWAN Class C is used.

"Minimum Send Interval for a Parsed Data (in seconds)": Minimum value to send meter data to MQTT Server. This time may be longer than selected value due to meter quantity in reading queue. We prefered 60seconds in this example..

"Data Format": Options for how data is shared by LKM with LoRaWAN server. There is 1 option for now:

     Parsed Data as Modbus Frame

"Send OBIS Code Details as Status Message At Start": If enabled, LKM will send status message for enabled/configured OBIS codes in system to LoRaWAN Server. If not needed, it can be disabled. We enabled for this example.

Click Save Configuration when all settings are done and Restart device with command under Management menu.

13.2 Add End Device to LoRaWAN Server - Manual Method

In The Things Network LoRaWAN Server website, click "+ Register end device" and select "Enter end device specifics manually" and select following options:

Specify Join EUI and click confirm. This must be unique number for joining LoRaWAN Server.

Then enter the Device EUI 70-B3-D5-8F-F1-01-85-B7 in this example and generate AppKey.

Click "Register end device" once finished.

Created device will be shown on screen.

LKM now can send data to LoRaWAN Server.

13.3 Add End Device to LoRaWAN Server - Select From Device List

In The Things Network LoRaWAN Server website, click "+ Register end device" and select "Select the end device in the LoRaWAN Device Repository". Then search for REDZ brand and select it as follows.

Select the model, hardware version, firmware version, profile and frequency plan:

Specify Join EUI and click confirm. This must be unique number for joining LoRaWAN Server.

Then enter the Device EUI 70-B3-D5-8F-F1-01-85-B7 in this example and generate AppKey.

Click "Register end device" once finished.

 

Created device will be shown on screen.

LKM now can send data to LoRaWAN Server.

13.4 Check Status of LoRaWAN Activation

LoRaWAN device activation can be monitored from LKM LoRa Status page.

 

Once the device is Active, it will start reading energy meters and send data to LoRaWAN Server.

If Activation takes longer than expected, user can also activate device LOG and try check details over console or UDP server log.

The Things Network LoRaWAN Server website "Live Data" can also be checked if LKM is sending data.

13.5 Monitor Read Meter Data

Go to "Device Status" and check if meters are responding by checking "Last Serial Package" data in "Meter Communication Status" list.

We can also check instantaneous reading result on "Meter Reading Status" menu item.

Go to "Gateway Status" menu and check all data is there as per application's need. If OBIS needs to be changed then please change OBIS codes and recheck reading status. Now the data is ready to be sent to LoRaWAN Server.

13.6 How Data Are Sent to LoRaWAN Server

There are 2 Status Messages available, 1 sent in every connection to LoRaWAN Server, the other is optional.

Status Message - Device Status

Message sent to LoRaWAN Port number 1 in every connection to LoRaWAN Server

4 Bytes: LKM unique Device Id

1 Byte: Frame Type (Lower 4 bits) and Package Number (Upper 4 bits). If Package Number is 1 or more that means the package splitted.

0x00 : means status package for device status and package is the first package

1 Byte: Number of Meters configured to be read

1 Byte: Number of OBIS Codes configured  to be read

1 Byte: LoRaWAN Port of the response package

4 Bytes: RTC Time

3 Bytes: LKM Device firmware version

N Bytes (maximum 22): LKM Device name configured by user

Here is an example byte can be received by Server side:

00036FB8 00 01 18 03 63CF4624 020301 4C4B4D5F4C575F534552564552

 

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x0X: Frame counter, this is first frame

00
3 1 Byte Number of Meters Configured to be read

1 Meter is being read by LKM

01
4 1 Byte Number of OBIS Codes configured  to be read

LKM will look for total 24 OBIS codes

18
5 1 Byte Target Port LoraWan Port that will be used to send meter data 03
6 4 Bytes Device Date Time

Device date time, sampel function to parse this data is given in Payload Formatter part.


It is "2024-4-30 15:24:36"

63CF4624
7 3 Bytes Firmware Version

Firmware version of LKM used

It is "02.03.01"

020301 
8 Remaining Bytes (max 15) Device Name

TLM Device Name that is shown on Operating Mode page

It is "LKM_LW_SERVER"

4C4B4D5F4C575F534552564552

Here is example screen from The Things Network LoRaWAn Server website:

Status Message - OBIS Details

Message sent to LoRaWAN Port number 1 in every connection to LoRaWAN Server if enabled by user.

4 Bytes: LKM unique Device Id

1 Byte: Frame Type (Lower 4 bits) and Package Number (Upper 4 bits). If Package Number is 1 or more that means the package splitted.

0x01 : means status package for OBIS details and package is the first package

OBIS Frames are shared 1 by 1 in following format, qty is given in Device Status message

1 Byte: OBIS Code Number in same sequence configured from web interface

1 Byte: Hexadecminal character 0x1F as seperator character

N Bytes (maximum 15): Configured OBIS Code itself like "1.8.0", each character in ASCII format

1 Byte: Hexadecminal character 0x1F as seperator character

....Next Obis Frame that maximum payload size allows.

Here is an example byte can be received by Server side:

00036FB8 01 011F462E462A1F021F302E392E312A1F031F302E392E322A1F041F312E382E302A1F051F312E382E312A1F061F312E382E322A1F071F312E382E332A1F081F322E382E302A1F091F322E382E312A1F0A1F322E382E322A1F0B1F322E382E332A1F0C1F352E382E302A1F0D1F362E382E302A1F0E1F372E382E302A1F0F1F382E382E302A1F101F312E362E302A1F111F322E362E302A1F121F33322E372E302A1F131F35322E372E302A1F141F37322E372E302A1F151F33312E372E302A1F161F35312E372E302A1F171F37312E372E302A1F181F432E312E302A1F

 

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x0X: Frame counter, this is first frame

01
3 1 Byte OBIS Code Number

it is "1"

01
4 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
5 N Bytes (maximum 15) OBIS Code it is ASCII "F.F*" 462E462A
6 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
7 1 Byte OBIS Code Number

it is "2"

02
8 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
9 N Bytes (maximum 15) OBIS Code

it is ASCII "0.9.1*"

302E392E312A
10 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
....... ....... .......

Every OBIS Package parsed in same way

.......
95 1 Byte OBIS Code Number

it is "24"

18
96 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
97 N Bytes (maximum 15) OBIS Code

it is ASCII "C.1.0*"

432E312E302A
98 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F

Here is example screen from The Things Network LoRaWAn Server website:

Meter Data Message - Parsed from Meter Reading

Message sent to LoRaWAN configured Port (default is 3) and minimum send interval can be configured by user

4 Bytes: LKM unique Device Id

1 Byte: Frame Type (Lower 4 bits) and Package Number (Upper 4 bits). If Package Number is 1 or more that means the package splitted.

0x02: means meter data package and package is the first package

1 Byte: Read Meter number in same sequence configured from web interface

1 Byte: Data Starting OBIS Code Number in same sequence configured from web interface

1 Byte: Total Data Size in Payload

Meter Data Frames are shared 1 by 1 in following format, each data is 4 bytes

4 Bytes: Meter Data

....Next data that maximum payload size allows

Here is an example byte can be received by Server side:

00036FB8 02 01 01 60 000000000001E01F0003AAC200162CDA00162CDA000000000000000000008996000089960000000000000000000000000000000000000000000000000000000000000000000009470000000000000000000000000000000000000000040CE165

 

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x0X: Frame counter, this is first frame

02
3 1 Byte Read Meter Number

Meter number that the reading belongs to.

it is "1"

01
4 1 Byte Data Starting OBIS Code Number

OBIS code number for data frame first data and the next ones continues as defined in LKM consequently

it is "1"

01
5 1 Byte Total Data Size

total data bytes count

It is "96" in this example. Each data is 4 bytes so there are 24 data available.

60
6 4 Bytes Meter Data: 1 it is ASCII "0" 00000000
7 4 Bytes Meter Data: 2

it is ASCII "122911"

0001E01F
....... ....... .......

Every Meter data parsed in same way

.......
29 4 Bytes Meter Data: 24

it is ASCII "67952997"

040CE165

Here is example screen from The Things Network LoRaWAn Server website:

13.7 How Data Are Sent to LoRaWAN Server When Package Size is more than Maximum Payload Size 

LKM Series 868MHz LoRaWAN Meter Reader with Electricity Meter Protocol to Modbus Protocol Gateways has unique feature to resize frames for LoRaWAN and also unique feature to calculate duty cycles based on LoRaWAN duty cycle limitations. Users do not need to worry on query interval or response size, LKM Series 868MHz LoRaWAN Meter Reader with Electricity Meter Protocol to Modbus Protocol Gateways automatically splits and send read data.

Here is example Status Message - OBIS Details

00036FB801011F462E462A1F021F302E392E312A1F031F302E392E322A1F041F312E382E302A1F051F312E382E312A1F061F312E382E322A1F071F312E382E332A1F081F322E382E302A1F091F322E382E312A1F0A1F322E382E322A1F0B1F322E382E332A1F0C1F352E382E302A1F0D1F362E382E302A1F0E1F372E382E302A1F0F1F382E382E302A1F101F312E362E302A1F111F322E362E302A1F121F33322E372E302A1F131F35322E372E302A1F141F37322E372E302A1F151F33312E372E302A1F161F35312E372E302A1F171F37312E372E302A1F181F432E312E302A1F

Maximum Payload size can be seen in LoRa Status page which is 51 bytes in this example:

LKM automatically divides data and send to LoRaWAN Server split messages and wait to send next part until duty cycle is available.

Device console LOG will show details for the long frame and information regarding package split and duty cycle wait.

Here is how data is splitted:

Message 1: 00036FB8 01 01 1F462E462A1F021F302E392E312A1F031F302E392E322A1F041F312E382E302A1F051F312E382E312A1F

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x0X: Frame counter, this is first frame

01
3 1 Byte OBIS Code Number

it is "1"

01
4 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
5 N Bytes (maximum 15) OBIS Code it is ASCII "F.F*" 462E462A
6 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
....... ....... .......

Every OBIS Package parsed in same way

.......
19 1 Byte OBIS Code Number

it is "5"

05
20 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
21 N Bytes (maximum 15) OBIS Code

it is ASCII "1.8.1*"

312E382E312A
22 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F

Here is example screen from The Things Network LoRaWAn Server website:

Message 2:

00036FB8 11 06 1F312E382E322A1F071F312E382E332A1F081F322E382E302A1F091F322E382E312A1F0A1F322E382E322A1F

 

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x1X: Frame counter, this is second frame

11
3 1 Byte OBIS Code Number

it is "6"

06
4 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
5 N Bytes (maximum 15) OBIS Code it is ASCII "1.8.2*" 312E382E322A
6 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
....... ....... .......

Every OBIS Package parsed in same way

.......
19 1 Byte OBIS Code Number

it is "10"

0A
20 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F
21 N Bytes (maximum 15) OBIS Code

it is ASCII "2.8.2*"

322E382E322A
22 1 Byte Seperator Character

It is Hexadecimal 0x1F

1F

Here is example screen from The Things Network LoRaWAn Server website:

Message 3:

00036FB8 21 0B 1F322E382E332A1F0C1F352E382E302A1F0D1F362E382E302A1F0E1F372E382E302A1F0F1F382E382E302A1F

Parsing is similar like message 1 and 2

Here is example screen from The Things Network LoRaWAn Server website:

Message 4:

00036FB8 31 10 1F312E362E302A1F111F322E362E302A1F121F33322E372E302A1F131F35322E372E302A1F

Parsing is similar like message 1 and 2

Here is example screen from The Things Network LoRaWAn Server website:

Message 5:

00036FB8 41 14 1F37322E372E302A1F151F33312E372E302A1F161F35312E372E302A1F171F37312E372E302A1F

Parsing is similar like message 1 and 2

Here is example screen from The Things Network LoRaWAn Server website:

Message 6:

00036FB8 51 18 1F432E312E302A1F

Parsing is similar like message 1 and 2

Here is example screen from The Things Network LoRaWAn Server website:

 

Here is example Meter Response Message

00036FB802010160000000000001E01F0003AAC200162CDA00162CDA000000000000000000008996000089960000000000000000000000000000000000000000000000000000000000000000000009470000000000000000000000000000000000000000040CE165

Here is how data is splitted:

Message 1: 

00036FB8 02 01 01 28 000000000001E01F0003AAC200162CDA00162CDA0000000000000000000089960000899600000000

 

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x0X: Frame counter, this is first frame

02
3 1 Byte Read Meter Number

Meter number that the reading belongs to.

it is "1"

01
4 1 Byte Data Starting OBIS Code Number

OBIS code number for data frame first data and the next ones continues as defined in LKM consequently

it is "1"

01
5 1 Byte Total Data Size

total data bytes count

It is "40" in this example. Each data is 4 bytes so there are 10 data available.

28
6 4 Bytes Meter Data: 1 it is ASCII "0" 00000000
....... ....... .......

Every Meter data parsed in same way

.......
15 4 Bytes Meter Data: 10

it is ASCII "0"

00000000

Here is example screen from The Things Network LoRaWAn Server website:

Message 2: 

00036FB8 12 01 0B 28 00000000000000000000000000000000000000000000000000000000000009470000000000000000

 

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x1X: Frame counter, this is second frame

12
3 1 Byte Read Meter Number

Meter number that the reading belongs to.

it is "1"

01
4 1 Byte Data Starting OBIS Code Number

OBIS code number for data frame first data and the next ones continues as defined in LKM consequently

it is "11"

0B
5 1 Byte Total Data Size

total data bytes count

It is "40" in this example. Each data is 4 bytes so there are 10 data available.

28
6 4 Bytes Meter Data: 11 it is ASCII "0" 00000000
....... ....... .......

Every Meter data parsed in same way

.......
15 4 Bytes Meter Data: 20

it is ASCII "0"

00000000

Here is example screen from The Things Network LoRaWAn Server website:

Message 3: 

00036FB8 22 01 15 10 000000000000000000000000040CE165

 

Number

Byte Count Data Explanation Example (Hex)
1 4 Bytes Device ID

Unique ID of the device that is shown on Operating Mode page

00036FB8 
2 1 Byte Frame Details

Gives detail of frame and frame counter


0xX0: Status Frame - Device Status
0xX1: Status Frame - OBIS Details
0xX2: Meter Response Frame

0x2X: Frame counter, this is third frame

22
3 1 Byte Read Meter Number

Meter number that the reading belongs to.

it is "1"

01
4 1 Byte Data Starting OBIS Code Number

OBIS code number for data frame first data and the next ones continues as defined in LKM consequently

it is "11"

15
5 1 Byte Total Data Size

total data bytes count

It is "16" in this example. Each data is 4 bytes so there are 4 data available.

10
6 4 Bytes Meter Data: 21 it is ASCII "0" 00000000
....... ....... .......

Every Meter data parsed in same way

.......
9 4 Bytes Meter Data: 24

it is ASCII "67952997"

040CE165

Here is example screen from The Things Network LoRaWAn Server website:

13.8 Payload Formatter Example

Here is code for payload formatter used in The Things Network:

 

###############Code Start###############

function decodeUplink(input) {

  switch (input.fPort) {

    case 1:

      return {

        // Decoded data

        data: {

          deviceID: ((input.bytes[0] << 24) + (input.bytes[1] << 16) + (input.bytes[2] << 8) + (input.bytes[3])),

          frameType: getFrameType(input.bytes[4] & 0x0F),

          frameCounter: ((input.bytes[4] >> 4) & 0x0F),

          meterQty: input.bytes[5],

          obisQty: input.bytes[6],

          targetPort: input.bytes[7],

          deviceTime: get_status_time((input.bytes[8] << 24) + (input.bytes[9] << 16) + (input.bytes[10] << 8) + (input.bytes[11])),

          firmwareVersion: `${input.bytes[12]}` +'.' + `${input.bytes[13]}` +'.' + `${input.bytes[14]}`,

          deviceName: getDeviceName(input.bytes)

        },

      };

    case 2:

      return {

        // Decoded data

        data: {

          deviceID: ((input.bytes[0] << 24) + (input.bytes[1] << 16) + (input.bytes[2] << 8) + (input.bytes[3])),

          frameType: getFrameType(input.bytes[4] & 0x0F),

          frameCounter: ((input.bytes[4] >> 4) & 0x0F),

          obisList: getObisList(input.bytes)

        },

      };

    case 3:

      return {

        // Decoded data

        data: {

          deviceID: ((input.bytes[0] << 24) + (input.bytes[1] << 16) + (input.bytes[2] << 8) + (input.bytes[3])),

          frameType: getFrameType(input.bytes[4] & 0x0F),

          frameCounter: ((input.bytes[4] >> 4) & 0x0F),

          meterNumber: input.bytes[5],

          obisStartNumber: input.bytes[6],

          dataLength: input.bytes[7],

          dataList: getDataList(input.bytes)

        },

      };

    default:

      return {

        errors: ['unknown FPort'],

      };

  }

}

 

function getFrameType(byte) {

  var frameTypes = ['Status Message - Device', 'Status Message - OBIS', "Meter Response Message"];

  if(byte >=0 && byte <=2)

    return frameTypes[byte];

  else

    return 'Unknown Frame';

}

 

function getDeviceName(bytes) {

  var deviceNameS="";

  for(var i=15;i<bytes.length;i++)

    deviceNameS = deviceNameS + String.fromCharCode(bytes[i]);

 

  return deviceNameS;

}

 

function get_status_time(hex){

  var hour= (((hex) >> 16) & 0x1F);

var min=  (((hex) >> 6) & 0x3F);

  var sec = ((hex) & 0x3F);

  var year= ((((hex) >> 26) & 0x3F) + 2000);

  var mon= (((hex) >> 12) & 0x0F);

  var day= (((hex) >> 21) & 0x1F);

  var time =  year +'-'+ mon +'-'+ day +' '+ hour +':'+ min +':'+ sec;

  return time;

}

 

function getObisList(bytes) {

  var obisLst = [];

  var ObisName='';

  var obisNumber=0;

  var sCounter=0;

  for(var i=5;i<bytes.length;i++)
  {

    if(bytes[i]=== 0x1F)
    {

      sCounter++;

    }

    if(sCounter === 0)

      obisNumber = bytes[i];

    else if(sCounter === 1 && bytes[i] != 0x1F)

      ObisName = ObisName + String.fromCharCode(bytes[i]);

    else if(sCounter === 2)

    {

      sCounter = 0;

      obisLst.push([obisNumber, ObisName]);

      ObisName = '';

      obisNumber = bytes[i];

    }

  }

  return obisLst;

}

 

function getDataList(bytes) {

  var dataLst = [];

  var data=0;

  var byteCounter=0;

  for(var i=8;i<bytes.length;i++)
  {

    byteCounter++;

    data = data + (bytes[i] << (8 * (4-byteCounter)));

 

    if(byteCounter === 4)

    {

      dataLst.push([data]);

      byteCounter = 0;

      data=0;

    }

  }

  return dataLst;

}

 

###############Code End###############

This code can be used as custom payload formatter in The Things Network LoRaWAn Server website.

 

14. Read IEC62056-21 Meters, Convert data to Modbus, send to MQTT Server and send to LoRaWAN Server Applications - Video Examples

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways support up to 20 meters reading on RS485 Bus and RS232 and converts up to 48 OBIS codes to Modbus registers for each meter in reading list. In this example we will read 1 meter via direct cable connection over RS485 and other meter over KMK114- RS485 optical interface.

14.1 LKM Connection to Meter via Direct Cable 

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can be connected to RS485 or RS232 of meter and read IEC62056-21 Protocol. Remote or local Data Acquisition Server can read meter data via Modbus TCP.

 

14.2 LKM Connection to Meter via Optical Probe

LKM Series Electricity Meter Protocol to Modbus Protocol Gateways can be connected to optical interface of meter and read IEC62056-21 Protocol with auto baud change. Remote or local Data Acquisition Server can read meter data via Modbus TCP.

 

14.3  Setting Up LKM, Reading Meters and Convert to Modbus TCP Data

Here is an example video taken from PC screen

Here is an example video physical application

14.4  Setting Up LKM LoRaWAN Versions, Reading Meters and send data to LoRaWAN Server

Here is an example video taken from PC screen

Here is an example video physical application

 

15. Ordering Information

LKM154: MODBUS to IEC62056-21 Protocol Meter Gateway, 2 x 10/100 T(x) ETH ports, 1 x RS232 & 1 x RS485, 5-48V (max. 60V) DC Power Input

LKM254: MODBUS to IEC62056-21 Protocol Meter Gateway, 2 x 10/100 T(x) ETH ports, 1 x RS232 & 1 x RS485, 100 - 240V AC (120 – 370V DC), 50Hz to 60Hz AC Power Input

LKM655: MODBUS to IEC62056-21 Protocol Meter Gateway, 2 x 10/100 T(x) ETH ports + 1 x BPL (Broadband Power Line) Link, 1 x RS232 & 1 x RS485, 3 Phase AC Power Input, 110V–240V/50-60Hz

LKM354: 868MHZ LoRaWAN Meter Reader with MODBUS to IEC62056-21 Protocol Meter Gateway, 2 x 10/100 T(x) ETH ports, 1 x RS232 & 1 x RS485, 5-48V (max. 60V) DC Power Input

LKM454: 868MHZ LoRaWAN Meter Reader with MODBUS to IEC62056-21 Protocol Meter Gateway, 2 x 10/100 T(x) ETH ports, 1 x RS232 & 1 x RS485, 100 - 240V AC (120 – 370V DC), 50Hz to 60Hz AC Power Input

LKM755: 868MHZ LoRaWAN Meter Reader with MODBUS to IEC62056-21 Protocol Meter Gateway, 2 x 10/100 T(x) ETH ports + 1 x BPL (Broadband Power Line) Link, 1 x RS232 & 1 x RS485, 3 Phase AC Power Input, 110V–240V/50-60Hz

 

NOTE:  LKM series has also Modbus RTU versions:

LKM111, LKM114, LKM124, LKM141, LKM144 and LKM614

check those models please if Modbus RTU version is needed in the project.

 

16. Product Selection

Model 868MHz LoRaWAN Meter Reader 5-48V (max. 60V) DC Power Input 100 - 240V AC (120 – 370V DC), 50Hz to 60Hz AC Power Input 3 Phase AC Power input, 110 V – 240 V / 50 – 60 Hz AC Power Input Read Meters and Convert Data to Modbus and/or send to MQTT Server OBIS Codes to look for can be changed by user Web Interface for monitoring meter reading status and much more BPL (Broadband Power Line) Link
LKM154   X
    X
X X  
LKM254     X     X X X  
LKM655       X
 X X X X
LKM354
X
X      X
X
X
 
LKM454
X   X
   X
X
X
 
LKM755
X     X
 X
X
X
X
LKM Series Electricity Meter Protocol to Modbus Protocol Gateways
LKM Series Electricity Meter Protocol to Modbus Protocol Gateways
STG Series WMBus (Wireless MBus) - Modbus TCP/RTU Gateway
STG Series WMBus (Wireless MBus) - Modbus TCP/RTU Gateway
TLM Series LoRa and LoRaWAN Modems
TLM Series LoRa and LoRaWAN Modems
CKL Series Modbus, Serial to Ethernet Gateway
CKL Series Modbus, Serial to Ethernet Gateway
BSB Series Industrial Unmanaged Ethernet Switch
BSB Series Industrial Unmanaged Ethernet Switch
REDZ Software Solutions
HUR Series Modbus TCP and RTU Remote I/O Devices
MBC Series IEC62056-21 Protocol Auto Baud Changer
MBC Series IEC62056-21 Protocol Auto Baud Changer
KMK Series Optical Probes for Energy Meters
REDZ Software Solutions