Utilizamos cookies para optimizar el funcionamiento del sitio y ofrecerle la mejor experiencia posible.
Consulte aquí nuestra nueva Privacidad y Protección de Datos Personales.
top
bottom
INDEX

Bluetooth Optical Probe User Manual

Quick Start

To read meters with meter reading software, this page is all you need. The steps use the Bluetooth serial port (SPP) on a Windows PC; Bluetooth Low Energy is in Chapter 3.2. Each step links to the chapter that explains it; the table at the end shows which chapters to read if you want to do more.

Choose your product

Your product: KMK118, KMK138, KMK119, KMK139.

KMK118 - read a meter in five steps

KMK118 quick start in five steps (charge, switch on, pair, set the function, read); the same steps are listed below the picture

KMK118 - read a meter in five steps

  1. Charge - Charge over USB until the LED with the battery symbol goes off (Chapter 11.1).
  2. Switch on - Press POWER. The LED with the power symbol lights (Chapter 2.1.2).
  3. Pair - Windows: pair "KMK118 xxxxxx", the Bluetooth serial port (SPP) entry. In More Bluetooth settings > COM Ports, use the port marked Outgoing. Android phone: ZRobo (Chapter 3.1, Chapter 13).
  4. Set the function - KMK118 leaves the factory in command mode, for your own software. Do this once: on the Settings page of abcZ or ZRobo, set Device function to IEC Auto (IEC 62056-21 meters) or DLMS Auto (DLMS/COSEM meters) and press Write and verify. The probe restarts and keeps it (Chapter 4.1, Chapter 12.2.2, Chapter 13.3.1).
  5. Read - Put the optical head on the meter and open that COM port in your meter reading software. The LED with the Bluetooth symbol lights while it is open (Chapter 3.4).

A KMK118 on the optical port of an IEC meter

A KMK118 on the optical port of an IEC meter

KMK138 - read a meter in four steps

KMK138 quick start in four steps (charge, switch on, pair, read); the same steps are listed below the picture

KMK138 - read a meter in four steps

  1. Charge - Charge over USB until the LED with the battery symbol goes off (Chapter 11.1).
  2. Switch on - Press POWER. The LED with the power symbol lights (Chapter 2.1.2).
  3. Pair - Windows: pair "KMK138 xxxxxx", the Bluetooth serial port (SPP) entry. In More Bluetooth settings > COM Ports, use the port marked Outgoing (Chapter 3.1).
  4. Read - KMK138 leaves the factory in fixed 9600 8N1 (ANSI C12.18 meters and other fixed-speed lines). Put the optical head on the meter and open that COM port in your ANSI meter reading software. The LED with the Bluetooth symbol lights while it is open (Chapter 4.1, Chapter 3.4).

A KMK138 on the optical port of an ANSI meter

A KMK138 on the optical port of an ANSI meter

KMK119 - read a meter in five steps

KMK119 quick start in five steps (charge, set the switch, switch on, pair, read); the same steps are listed below the picture

KMK119 - read a meter in five steps

  1. Charge - Charge over USB until the CHARGE LED goes off (Chapter 11.1).
  2. Set the switch - With the probe off: OFF OFF = position 1, IEC auto (IEC 62056-21 meters); ON OFF = position 2, DLMS auto (DLMS/COSEM meters) (Chapter 4.2).
  3. Switch on - Press the button. The probe reads the switches now: the IEC AUTO or DLMS AUTO LED lights (Chapter 2.1.1).
  4. Pair - Windows: pair "KMK119 xxxxxx", the Bluetooth serial port (SPP) entry. In More Bluetooth settings > COM Ports, use the port marked Outgoing. Android phone: ZRobo (Chapter 3.1, Chapter 13).
  5. Read - Put the optical head on the meter and open that COM port in your meter reading software. BT LINK lights while it is open (Chapter 3.4).

A KMK119 on the optical port of an IEC meter

A KMK119 on the optical port of an IEC meter

KMK139 - read a meter in five steps

KMK139 quick start in five steps (charge, set the switch, switch on, pair, read); the same steps are listed below the picture

KMK139 - read a meter in five steps

  1. Charge - Charge over USB until the CHARGE LED goes off (Chapter 11.1).
  2. Set the switch - With the probe off: ON OFF = position 2, Fixed line at 9600 8N1 (ANSI C12.18 meters and other fixed-speed lines) (Chapter 4.2).
  3. Switch on - Press the button. The probe reads the switches now: the MODE 2 LED lights (Chapter 2.1.1).
  4. Pair - Windows: pair "KMK139 xxxxxx", the Bluetooth serial port (SPP) entry. In More Bluetooth settings > COM Ports, use the port marked Outgoing (Chapter 3.1).
  5. Read - Put the optical head on the meter and open that COM port in your ANSI meter reading software. BT LINK lights while it is open (Chapter 3.4).

A KMK139 on the optical port of an ANSI meter

A KMK139 on the optical port of an ANSI meter

Which chapters you need

You want toRead
read meters with meter reading softwarethis page; Chapter 3 connecting, Chapter 4 working modes, Chapter 11 battery, Chapter 10 firmware updates, Chapter 15 troubleshooting; our software: Chapter 12 abcZ for Windows, Chapter 13 ZRobo for Android
write your own softwareChapter 6 integration, Chapter 7 every command, Chapter 8 status and identity, Chapter 9 stored settings, Appendix A replies and refusals

1. Introduction

The probes of this manual connect the optical port of a meter to your software over Bluetooth - the Bluetooth serial port (SPP) and Bluetooth Low Energy (BLE). In the automatic modes the probe handles the optical line by itself, so meter reading software that works with a cable probe can use it as it is; in command mode your software sets the line and can ask the probe about itself (Chapter 4).

How the probe connects a meter to your software: meter, optical line, KMK118, KMK138, KMK119, KMK139, Bluetooth link to Windows PC or Android phone

Figure 1.1 - From the meter to your software

1.1 The products

ProductOptical headBoardWorking mode chosen with
KMK118KMK118 optical head: IEC 62056-21, with the torch
IEC 62056-21
torch, no mode switch0xD5
KMK138KMK138 optical head: ANSI C12.18 Type 2, with the torch
ANSI C12.18 Type 2
torch, no mode switch0xD5
KMK119KMK119 optical head: IEC 62056-21
IEC 62056-21
mode switch and mode LEDsthe mode switch
KMK139KMK139 optical head: ANSI C12.18 Type 2
ANSI C12.18 Type 2
mode switch and mode LEDsthe mode switch

KMK118 and KMK119 are the IEC versions, KMK138 and KMK139 the ANSI versions of the same two boards. The hardware is shown in Chapter 2; how each product works as it leaves the factory is in Chapter 4. Firmware for a particular meter or protocol is available as a project-specific variant (Chapter 10.5).

1.2 This manual

To read a meter right away, follow the Quick Start - a few steps for each product.

This manual describes firmware v6.4 290926 and our software abcZ 4.2.0 for Windows (Chapter 12) and ZRobo 3.0.0 for Android (Chapter 13). A probe with firmware v5.x behaves differently in places; Chapter 14 lists the differences.

2. Hardware Overview

The Bluetooth probes come on two boards. KMK119 and KMK139 have a mode switch and mode LEDs; KMK118 and KMK138 have no switch and a built-in torch. KMK118 and KMK119 have an IEC 62056-21 optical head, KMK138 and KMK139 an ANSI C12.18 Type 2 optical head (2.2.2). The working modes are in Chapter 4.

2.1 Front panels

2.1.1 KMK119 and KMK139

KMK119 front: power button, charge, Bluetooth activity and speed LEDsKMK139 front: power button, charge, Bluetooth activity and speed LEDs
Figure 2.1 - KMK119 frontFigure 2.2 - KMK139 front
  • The button switches the probe on; press it again to switch it off.
  • CHARGE: VIN GOOD is on while a charger with a good voltage is connected; CHARGE is on while the battery charges and goes off when it is full (Chapter 11.1); CHARGE turns red in the cases of 2.3.
  • BT ACTIVITY: BT POW. is on while the probe is on. BT LINK is on while a client is connected - for example while software has the probe's COM port open - and off otherwise. TX and RX flash when data goes to and comes from the meter.
  • SPEED: shows the switch position - labelled IEC AUTO, DLMS AUTO, MODE 3 and MODE 4 on a KMK119, MODE 1 - MODE 4 on a KMK139 (2.2.1).

2.1.2 KMK118 and KMK138

KMK118 front: torch and power buttons, charge, power, Bluetooth, TX and RX LEDsKMK138 front: torch and power buttons, charge, power, Bluetooth, TX and RX LEDs
Figure 2.3 - KMK118 frontFigure 2.4 - KMK138 front
  • POWER switches the probe on and off; TORCH switches the built-in torch on and off, to light up the display of a meter.
  • The LED with the battery symbol is on while the battery charges and goes off when it is full (Chapter 11.1); it turns red in the cases of 2.3.
  • The LED with the power symbol is on while the probe is on.
  • The LED with the Bluetooth symbol is on while a client is connected and off otherwise. TX and RX flash when data goes to and comes from the meter.
  • There is no mode switch: the working function is chosen with 0xD5 (Chapter 4).

2.2 Mode switch, USB port and optical head

2.2.1 Mode switch and USB port (KMK119, KMK139)

KMK119 side view: USB port, mode switches and the switch table printed on the caseKMK139 side view: USB port, mode switches and the switch table printed on the case
Figure 2.5 - KMK119 sideFigure 2.6 - KMK139 side

On the side are the USB charging port - USB Type-C or Micro-USB, depending on the hardware version - and the two mode switches. The switch positions are printed on the case:

Switch 1Switch 2Switch position
OFFOFF1
ONOFF2
OFFON3
ONON4

The probe reads the switches only at power-on. After you change them, switch the probe off and on again. What each position does is in Chapter 4.

2.2.2 Optical head

KMK119 optical head: IEC 62056-21KMK139 optical head: ANSI C12.18 Type 2
Figure 2.7 - KMK119 optical head (IEC 62056-21)Figure 2.8 - KMK139 optical head (ANSI C12.18 Type 2)
KMK118 optical head: IEC 62056-21, with the torchKMK138 optical head: ANSI C12.18 Type 2, with the torch
Figure 2.9 - KMK118 optical head (IEC 62056-21)Figure 2.10 - KMK138 optical head (ANSI C12.18 Type 2)

KMK118 and KMK119 have an IEC 62056-21 optical head with a flat face that sits on the meter's optical port; KMK138 and KMK139 have an ANSI C12.18 Type 2 optical head with a cavity that fits over it. All probes hold on the meter with an N38 magnet. On KMK118 and KMK138 the head also carries the torch.

2.3 The red LED

The CHARGE LED (on KMK118 and KMK138 the LED with the battery symbol) turns red in three cases:

The LED isMeaning
On, redThe battery is low (below 3000 mV) - charge the probe (Chapter 11.2).
Blinking slowly, about once a secondThe probe is checking the settings of its wireless module, for example after a module factory reset - wait until it stops.
Blinking fastThe bootloader is at work: a firmware update is being applied, or the probe waits for a firmware load (Chapter 10).

3. Getting Started - Connecting over Bluetooth

The probe offers two Bluetooth links. The Bluetooth serial port (SPP, classic Bluetooth) appears on a PC as a COM port; abcZ, meter reading software and most PC programs use it. Bluetooth Low Energy (BLE) is for phones and your own apps. A probe with firmware v6.x has both links on as it leaves the factory.

3.1 Pair the probe with a Windows PC

  1. Switch the probe on.
  2. Open the Bluetooth settings of the PC - Windows 11: Settings > Bluetooth & devices; Windows 10: Settings > Devices > Bluetooth & other devices - and check that Bluetooth is on (Figure 3.1).
  3. Windows 11 only: open Devices on the same page and, if it is not set yet, choose Advanced for Bluetooth devices discovery (Figure 3.2). With Default, Windows offers only common accessories when you add a device; Advanced shows all types.
  4. Add a Bluetooth device (Windows 11: Add device > Bluetooth; Windows 10: Add Bluetooth or other device > Bluetooth, Figure 3.3).
  5. The probe is listed twice under its production name, for example "KMK119 736e5e" (Figure 3.4): one entry is the Bluetooth serial port, the other BLE. Select one. The serial port entry pairs without a PIN (Figure 3.5) and gives the probe its COM ports; if Windows asks for a PIN, or no COM port appears in the next step, remove that pairing and select the other entry.
  6. Find the COM port: open the Bluetooth Settings dialog (Windows 10: More Bluetooth options, Figure 3.1; Windows 11: More Bluetooth settings) and its COM Ports tab. The probe has two COM ports: use the one marked Outgoing with the probe's name (Figure 3.6). The number says nothing - here the right port is COM20, the higher of the two.
  7. Use that COM port in your software. abcZ lists it by the probe's name (Chapter 12). On Windows the first open of a Bluetooth COM port can fail with a timeout; open it again (Chapter 6.5).

Windows 10 Settings, Bluetooth and other devices: Bluetooth is on; Add Bluetooth or other device starts pairing; More Bluetooth options opens the COM ports list

Figure 3.1 - Windows 10, Bluetooth and other devices

Windows 11 Settings, Bluetooth and devices, Devices: Bluetooth devices discovery - choose Advanced

Figure 3.2 - Windows 11, Devices: Bluetooth devices discovery set to Advanced

Windows 10 Add a device: choose Bluetooth to find the probeWindows 10 Add a device, Bluetooth: the probe appears TWICE with the same production name (KMK119 736e5e here) - one entry is the Bluetooth serial port, the other Bluetooth Low Energy
Figure 3.3 - Add a device: choose BluetoothFigure 3.4 - The probe is listed twice
Windows 10 Add a device: the probe is paired (no PIN asked) - Windows now creates its Bluetooth COM portsWindows 10 Bluetooth Settings, COM Ports tab: each paired probe gets two COM ports - use the Outgoing one (COM20 for KMK119 736e5e here); the lower number is not always the right one
Figure 3.5 - Paired, no PIN askedFigure 3.6 - COM Ports: use the Outgoing port

3.2 Bluetooth Low Energy

Nothing has to be switched on. To see BLE at work, scan with ZRobo on an Android phone: the probe then offers BT BLE next to BT SPP (Figure 3.7, Chapter 13). If you write your own app, the service and characteristic UUIDs, the write size and the connection interval are in Chapter 6.5.

ZRobo Devices after Scan: the KMK119 now also offers BT BLE (v6.x probes have BLE on by default)

Figure 3.7 - ZRobo after Scan: the probe offers BT SPP and BT BLE

A probe that still runs firmware v5.x left the factory with its BLE data link off: it shows up in a Bluetooth LE scan, but it does not answer over BLE. Updating it to firmware v6.x (Chapter 10) turns the BLE data link on.

3.3 Try the command channel

A terminal program that sends bytes given in hex is enough - for example RealTerm. Open the probe's COM port and send:

FE FE 42 4C 55 45 30 38 4E 31 A1 FF

The probe answers with its battery voltage in millivolts as ASCII text, followed by 00 - for example 3287 (0xA1). The LINK LED is on while the port is open. With firmware v6.x this works in every working mode (Chapter 6.1.1). The frame is explained in Chapter 6.1.2; the same test in Python and C# is in Chapter 6.6.

3.4 Read a meter

Put the optical head on the meter and select the probe's outgoing COM port in your meter reading software - for example our ZR meter reading software. Choose the working mode that suits the meter and the software first (Chapter 4). On an Android phone use ZRobo (Chapter 13).

4. Operating Modes

The working mode decides what the probe does on the optical line: follow an IEC 62056-21 or DLMS/COSEM session by itself, pass data at a fixed speed, or take commands from your software (command mode). The command frames of Chapter 7 are answered in every mode; only the line commands need command mode.

The four working modes and how to select each one on KMK119, KMK139 and KMK118, KMK138

Figure 4.1 - The working modes and how each product selects them

4.1 KMK118 and KMK138 - function selected by command

These probes have no mode switch. The function is stored in the probe and changed with 0xD5; the probe then restarts in the new function.

0xD5 valueFunctionWhat the optical line doesShipped on
0Command modeTakes commands from your software. The line starts with the stored settings (factory 300 baud 7E1).KMK118
1IEC autoStarts at 300 baud 7E1 and follows the IEC 62056-21 baud change-over by itself (mode C or E: 0xD3).-
2Fixed 9600 8N1Passes data both ways at 9600 baud 8N1, for example for ANSI C12.18 meters.KMK138
3DLMS autoStarts at 300 baud 7E1 with the IEC opening and changes to DLMS/COSEM by itself (start framing: 0xD4).-

Send 0xD5 alone to read the active function. 0xD5 with 0xFF returns to the default of the loaded firmware. KMK138 is shipped in fixed 9600 8N1 for ANSI C12.18 meters; the other functions are one command away.

4.2 KMK119 and KMK139 - mode selected by the switch

The 4-position switch selects the working mode, and the mode LEDs show the position. The switch is read only at power-on: switch the probe off, move the switch, switch it on again. Commands 0xD1 - 0xD4 restart the probe, so the switch is read after them too.

KMK119 - the standard firmware variant:

PositionLEDWorking modeWhat the optical line doesOptions
1IEC AUTOIEC autoStarts at 300 baud 7E1 and follows the IEC 62056-21 baud change-over (for example Elster, EMH and Landis+Gyr meters).Mode C or E: 0xD3
2DLMS AUTODLMS autoStarts at 300 baud 7E1 with the IEC opening and changes to DLMS/COSEM (for example Itron and Landis+Gyr meters).Start framing 7E1 or 8N1: 0xD4
3MODE 3Fixed linePasses data both ways at a fixed speed: 9600 8N1 unless changed.9600 8N1, 9600 8E1, 19200 8N1, 28800 8N1, 1200 8N1: 0xD2
4MODE 4Command modeTakes commands from your software. The line starts with the stored settings (factory 300 baud 7E1).Line: 0x30 - 0x38, 0x40 - 0x44; store with 0xE0

KMK139 - the ANSI2 firmware variant, as shipped:

PositionLEDWorking modeWhat the optical line doesOptions
1MODE 1Fixed linePasses data both ways at 4800 baud 8N1.none
2MODE 2Fixed linePasses data both ways at 9600 baud 8N1.none
3MODE 3Fixed linePasses data both ways at 19200 baud 8N1.none
4MODE 4Command modeTakes commands from your software. The line starts with the stored settings (factory 300 baud 7E1).Line: 0x30 - 0x38, 0x40 - 0x44; store with 0xE0

KMK139 is the KMK119 with the ANSI (recessed) optical head. It leaves the factory with the ANSI2 firmware variant: switch positions 1 - 3 are fixed lines for ANSI C12.18 meters (4800 8N1 / 9600 8N1 / 19200 8N1), position 4 is command mode. 0xD2, 0xD3 and 0xD4 are settings of the standard variant (position 3, IEC auto, DLMS auto); a KMK139 stores them, but its line does not change.

The variant is stored in the probe and changed with 0xD1; a variant set with 0xD1 stays when a different firmware image is loaded. A probe whose variant was never set uses the variant of the loaded image, so update a KMK139 with its ANSI2 file (Chapter 10.1.1). Other variants are project-specific.

4.3 Reaching command mode

ProductHow
KMK118As shipped. Otherwise send 0xD5 with 0; the probe restarts in command mode.
KMK138Send 0xD5 with 0; the probe restarts in command mode. Send 0xD5 with 2 (or 0xFF) to go back to fixed 9600 8N1.
KMK119 / KMK139Switch position 4, then switch the probe on.

To check the mode from your software read 0xDA: field 3 is the working mode and field 9 the switch position (field list). The stored choices are kept by a factory reset and by firmware updates over the air - Chapter 9.

5. Line Settings and Optical Limits

The line is the optical connection between the probe and the meter. In the automatic and fixed modes the probe sets the line itself; in command mode your software sets it.

5.1 The line in each working mode

Working modeLine at the startChanged byData you receive
IEC auto300 baud 7E1the probe, following the meter7-bit characters: the parity bit is removed
DLMS auto300 baud 7E1 (8N1 with 0xD4 = 1)the probe, following the meter7-bit characters during the IEC opening; after the change-over 8N1 bytes, unchanged
Fixed line9600 baud 8N1 on KMK118 / KMK138; switch position 3 of KMK119: set with 0xD2; switch positions 1 - 3 of KMK139: 4800 8N1 / 9600 8N1 / 19200 8N1nobody - it stays fixed8N1: bytes unchanged
Command modethe stored setting, factory 300 baud 7E1your software (5.2.1)7E1: 7-bit characters; 8N1, 8E1, 8O1, 8N2: bytes unchanged

In IEC auto and DLMS auto the probe passes nothing to the meter before the sign-on request that starts with /: bytes your software sends before it - for example NUL bytes meant to wake a battery-powered meter - are dropped.

5.2 Setting and keeping the line in command mode

5.2.1 The line commands

The command byte itself carries the value: 0x30 - 0x38 set the speed (300 - 38400 baud), 0x40 - 0x44 the data format (7E1, 8N1, 8E1, 8O1, 8N2), and 0x50 / 0x51 hold or release a break. They take effect at once and send no reply. Outside command mode they are refused with 15 (reason 10).

5.2.2 Keep your line settings

A line setting you send lives in RAM. In command mode the probe applies the STORED line settings again every time a new connection is made. If the connection drops and you reconnect, the line is back at the stored speed and format - a job that carries on without noticing reads garbage. For a long job, store the line settings with 0xE0 before you start.

In the IEC and DLMS auto modes a new connection restarts the automatic sequence at 300 baud.

5.3 Optical speed limits

IEC 62056-21 optical communication goes up to 19200 baud, and up to 19200 baud the probe was measured byte-exact in both directions. 28800 and 38400 baud are outside the standard. They can work with a given meter, but may need a higher optical sensitivity (0xD0), and bytes can be lost - in our measurements in the probe-to-meter direction. Use them only with a protocol that checks its own data (for example with a CRC), and test with your meter first.

6. Integration Guide

How your own software talks to the probe. The rules below are the same over the Bluetooth serial port (SPP) and Bluetooth Low Energy (BLE); transport notes are in 6.5 and working code in 6.6.

6.1 The command channel

6.1.1 Meter data and commands on one channel

Everything you send goes to the meter over the optical line, except a command frame: the probe recognises its 12-byte frame, answers it itself and does not pass it on. On firmware v6.x the frame is recognised in every working mode, so you can query the probe without stopping a reading session. On v5.x the frame was recognised in command mode and in the fixed-speed modes, not in the automatic IEC and DLMS modes; firmware without a command mode answered only 0xA0 - 0xA2.

6.1.2 The command frame

The 12 bytes of a command frame; only byte 11, the command code, changes

Figure 6.1 - The 12 bytes of a command frame

Byte1 - 23 - 101112
ValueFE FE42 4C 55 45 30 38 4E 31commandFF
Meaningstart"BLUE08N1" in ASCIIthe command codeend

Only byte 11 changes. Example - read the firmware name (0xA0):

FE FE 42 4C 55 45 30 38 4E 31 A0 FF

6.1.3 Replies

Most commands reply with ASCII text or a status byte, followed by 00. The status bytes are 06 (ACK, accepted), 15 (NACK, refused - 0xDC tells why) and 00 (end of the reply): Appendix A.2. These commands reply differently:

CommandsReply
0x30 - 0x38, 0x40 - 0x44, 0x50, 0x51none - the new setting applies at once
0xC2none - the probe switches off
0xBC, 0xBDa single 06, no 00 after it

6.2 Commands with a parameter

Byte exchange of a command with a parameter, Form A and Form B, with the 1 s parameter window

Figure 6.2 - Form A and Form B: the bytes and the 1 s parameter window

6.2.1 Form A - ACK first, then the parameter (0xC3, 0xD0)

The probe answers 06 00, waits up to 1 s for one parameter byte, and answers 06 00 again when the value is applied. Without a parameter it answers 15 00 after 1 s and nothing changes. Send the parameter in the same write as the frame.

Set the sensitivity to 30 (0x1E):
->  FE FE 42 4C 55 45 30 38 4E 31 D0 FF
<-  06 00           frame accepted
->  1E              the value - send it in the same write as the frame
<-  06 00           value applied

The same frame without the value:
->  FE FE 42 4C 55 45 30 38 4E 31 D0 FF
<-  06 00
    ... 1 s ...
<-  15 00           nothing changed; 0xDC then reads "208,7"

6.2.2 Form B - parameter after the frame, or a query (0xD1 - 0xD5)

After the frame the probe sends nothing and waits up to 1 s for one parameter byte. If it arrives, the probe answers 06 00, stores the value and restarts. Send the frame alone to read the value: after 1 s the probe answers 15 00 and then the value. The 15 00 is normal for a query - read on to the second 00.

Set switch position 3 to 19200 8N1 (0xD2 = 2):
->  FE FE 42 4C 55 45 30 38 4E 31 D2 FF
->  02              the value - within 1 s; nothing comes back before it
<-  06 00           stored; the probe restarts

Read the value:
->  FE FE 42 4C 55 45 30 38 4E 31 D2 FF
    ... 1 s ...
<-  15 00 32 00     "2" = 19200 8N1

Value out of range:
->  FE FE 42 4C 55 45 30 38 4E 31 D2 FF
->  09
<-  15 00           nothing changed; 0xDC then reads "210,9"

Back to the default of the firmware (v6.2 and later):
->  FE FE 42 4C 55 45 30 38 4E 31 D2 FF
->  FF
<-  06 00           stored value cleared; the probe restarts

6.2.3 Never send 0xFE as a parameter

0xFE always starts a new frame, so it is never taken as a parameter. After 0xC3 or 0xD0 the probe answers 15 00 (reason 8) and reads the 0xFE as the start of the next frame; this is why 254 cannot be sent to them. After 0xD1 - 0xD5 the 0xFE is not taken as a value either: the probe answers it like a query (15 00, the value, 00), and 0xDC does not record it. Send each frame and its parameter in one write, and do not start the next command before the parameter has gone.

6.3 Command mode and restarts

6.3.1 Commands that need command mode

The line commands and the factory reset (0x30 - 0x38, 0x40 - 0x44, 0x50, 0x51, 0xE1) work only in command mode, because changing the line in the middle of an automatic session would break it. In any other mode they are refused with 15 (reason 10). All other commands work in every mode.

6.3.2 Commands that restart the probe

0xD1 - 0xD5 store their value, answer 06 00 and restart the probe about 50 ms later, so the new setting is applied cleanly. A firmware update also ends with a restart. After a restart:

  • close the port and open it again before the next command - an old connection can look silent while the probe is running;
  • allow 1 - 2 s (sometimes more) before the port answers again;
  • send 0xA2 again if your job needs it (6.4).

6.4 A good session

  1. Open the connection (the Bluetooth COM port, or BLE).
  2. Read 0xA0: the product, the firmware and so which commands exist (Chapter 8).
  3. Read 0xDA: every setting in one reply.
  4. Work. Check every reply; after a 15, ask 0xDC why.
  5. If the job has pauses without a connection, send 0xA2: without a connection the probe sleeps after 60 s.
  6. Before you close the connection, let the probe finish sending to the meter: data still waiting when the connection closes is not sent. The probe sends at the line speed - about 960 bytes per second at 9600 baud, 30 at 300 baud - so wait for the meter's answer, or at least that long after your last write (measured with Bluetooth SPP on a BT v5.1 model, firmware v6.4: 900 bytes at 9600 baud were complete after 1.5 s).

Do not send commands while a meter transfer is running: no data is lost, but the reply is inserted into the meter data at that point, and your software may not find it.

6.5 Transport notes

Serial port (SPP): on Windows the first open of a Bluetooth COM port can fail with a timeout ("semaphore timeout"); open it again.

Bluetooth Low Energy: the probe is a serial port over GATT. Service 26cc3fc0-6241-f5b4-5347-63a3097f6764 holds one characteristic, bf8796f1-64f7-70b5-1e41-09bb46d79100 (read, notify, write, write without response) - the same on BT v4.1 and BT v5.1 models. Enable notifications on it to receive replies and meter data, and write commands and data to it. The service is not in the advertisement (only the Battery service 0x180F is): find the probe by its name, then look up the service after connecting.

The write size depends on the Bluetooth version of the probe (0xDA field 11): BT v4.1 models take 20-byte writes (MTU 23), BT v5.1 models up to 240 bytes after the MTU exchange (both measured). Use write without response: it works on both, while BT v4.1 models have refused write with response in some tests. Keep a frame and its parameter in one write where possible.

The BLE connection interval is chosen by the phone, not by the probe. On one Android phone the default was 48.75 ms; requestConnectionPriority(CONNECTION_PRIORITY_HIGH) brought it to 15 ms and made command and reply traffic much faster. iOS has no equivalent call.

In a BLE scan list only about the first 15 characters of the device name are shown. Production names are short - "KMK118 xxxxxx", where xxxxxx is the end of the Bluetooth address - so every probe is still unique.

6.6 Code examples

Both examples read the name, the battery and two settings, then set the sensitivity. The Python example was run unchanged on a KMK118 and a KMK119 with firmware v6.4 290926; the C# example was compiled and tested against a simulated probe. Adjust the COM port name.

6.6.1 Python (pyserial)

"""Talk to a Bluetooth optical probe from Python over its Bluetooth serial (SPP) port.

Needs pyserial:  pip install pyserial
"""
import time

import serial

FRAME = bytes.fromhex("FE FE 42 4C 55 45 30 38 4E 31")


def command(port, code, param=None, wait=1.3):
    """Send one command frame (and an optional parameter byte); return the raw reply."""
    port.reset_input_buffer()
    data = FRAME + bytes([code, 0xFF])
    if param is not None:
        data += bytes([param])              # the parameter goes in the same write
    port.write(data)
    reply = b""
    end = time.monotonic() + wait           # a query answers after its 1 s parameter window
    while time.monotonic() < end:
        reply += port.read(port.in_waiting or 1)
    return reply


def text(reply):
    """The ASCII text of a reply, without the 00 terminators."""
    return reply.replace(b"\x00", b"").decode("ascii", "replace")


def main(port_name="COM5"):
    # The probe's Bluetooth COM port. The baud rate value is not used by a Bluetooth port.
    with serial.Serial(port_name, 9600, timeout=0.1) as probe:
        print("name     :", text(command(probe, 0xA0)))
        print("battery  :", text(command(probe, 0xA1)), "mV")
        fields = text(command(probe, 0xDA)).split(",")
        print("mode     :", fields[2], "  switch position:", fields[8])
        print("0xD0 = 30:", command(probe, 0xD0, 30).hex(" "))   # 06 00 06 00 = applied


if __name__ == "__main__":
    main()

6.6.2 C# (.NET, System.IO.Ports)

// Talk to a Bluetooth optical probe from C# over its Bluetooth serial (SPP) port.
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Text;
using System.Threading;

static class ZtSerial
{
    static readonly byte[] Frame = { 0xFE, 0xFE, 0x42, 0x4C, 0x55, 0x45, 0x30, 0x38, 0x4E, 0x31 };

    // Send one command frame (and an optional parameter byte); return the raw reply.
    static byte[] Command(SerialPort port, byte code, int param = -1, int waitMs = 1300)
    {
        port.DiscardInBuffer();
        var data = new List<byte>(Frame);
        data.Add(code);
        data.Add(0xFF);
        if (param >= 0)
            data.Add((byte)param);              // the parameter goes in the same write
        port.Write(data.ToArray(), 0, data.Count);
        var reply = new List<byte>();
        var end = DateTime.UtcNow.AddMilliseconds(waitMs);   // a query answers after 1 s
        while (DateTime.UtcNow < end)
        {
            while (port.BytesToRead > 0)
                reply.Add((byte)port.ReadByte());
            Thread.Sleep(20);
        }
        return reply.ToArray();
    }

    // The ASCII text of a reply, without the 00 terminators.
    static string Text(byte[] reply)
    {
        return Encoding.ASCII.GetString(reply).Replace("\0", "");
    }

    static void Main()
    {
        // The probe's Bluetooth COM port. The baud rate value is not used by a Bluetooth port.
        using (var probe = new SerialPort("COM5", 9600))
        {
            probe.Open();
            Console.WriteLine("name     : " + Text(Command(probe, 0xA0)));
            Console.WriteLine("battery  : " + Text(Command(probe, 0xA1)) + " mV");
            string[] fields = Text(Command(probe, 0xDA)).Split(',');
            Console.WriteLine("mode     : " + fields[2] + "  switch position: " + fields[8]);
            Console.WriteLine("0xD0 = 30: " + BitConverter.ToString(Command(probe, 0xD0, 30)));
        }
    }
}

7. Command Reference

Every command is a 12-byte frame: FE FE 42 4C 55 45 30 38 4E 31, the command byte, then FF. Only the command byte changes. This chapter describes firmware v6.4; where older firmware behaves differently, the card says so in its "On v5.x" row. Refusal reasons and status bytes are in Appendix A; service commands are in Appendix B.

CodeCommandKMK118 / KMK138KMK119 / KMK139Since
0xA0Read the firmware nameYYv5.x
0x9ERead the image identityYYv6.2
0xDARead all settingsYYv6.0
0xDBRead the capabilitiesYYv6.0
0xDCWhy was it refused?YYv6.0
0x30 - 0x38Set the line speedCCv5.x
0x40 - 0x44Set the data formatCCv5.x
0x50 - 0x51Break on / offCCv5.x
0xA1Read the battery voltageYYv5.x
0xA9Read the battery chargeYYv6.0
0xA2Keep the probe awakeYYv5.x
0xC2Switch offYYv5.x
0xC3Set the auto power-off timeYYv5.x
0xD0Set the optical sensitivityYYv5.x
0xD5Select the working functionY-v6.0
0xD1Select the firmware variant-Yv6.0
0xD2Switch position 3 line settings(-)Yv6.0
0xD3IEC baud change-over modeYYv6.0
0xD4DLMS start framingYYv6.0
0xE0Store the settingsYYv5.x
0xE1Factory resetCCv5.x
0xBDRestart the wireless moduleYYv6.0
0xBCFactory-reset the wireless moduleYYv6.0

Y = works in every working mode. C = command mode only (refused with 15 in other modes). - = not on this product: no reply. (-) = accepted, but has no effect on this product.

7.1 Identity and status

0xA0 — Read the firmware name

Read the firmware name and version. Send it first: it tells you the product, the working mode and the firmware generation.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 A0 FF
ReplyASCII text, then 00. Example: "N23221133 v6.4 290926".
On v5.xAnswered in command mode and in the fixed-speed modes; the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15). Name format: free text up to v5.3; from v5.4 nine characters with c5 - c7 always 000.

The nine-character name code

CharPositionMeaningValuesFixed or live
c0position 1Optical sensorN = current sensor, O = older sensorfixed
c1position 2Product1 = KMK119 / KMK139, 2 = KMK118 / KMK138, 7 = KMK179fixed
c2position 3Working mode or variantKMK118 / KMK138: 1 command mode, 2 IEC auto, 3 fixed 9600 8N1, 4 DLMS auto. KMK119 / KMK179: 0 standard; KMK139: 6 ANSI2 (as shipped); other values are project-specific variantslive
c3position 4DLMS start framing1 = 8N1, 2 = 7E1live
c4position 5IEC change-over mode1 = mode E, 2 = mode Clive
c5position 6Bootloader0 = legacy, 1 = A/B (staged update possible)live
c6position 7Update capability0 = legacy only, 1 = staged and armed triggerfixed
c7position 8Generation3 = v6.x, 0 = v5.xfixed
c8position 9Wireless module3 = Bluetooth (BT v4.1 and BT v5.1 models), 4 = WiFi (KMK179); 1 and 2 on older unitsfixed

The live characters show what the probe is doing now, so they can differ from the code in the firmware file name - that is not a fault. Only the version and date (for example v6.4 290926) must match your firmware package.

0x9E — Read the image identity

Read the build identity of the running firmware image.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareFrom v6.2 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 9E FF
ReplyA number as ASCII decimal, then 00. Example: "1301".

NOTE:

Compare it for EQUALITY with the value published for your firmware package; it is not a version order.

0xDA — Read all settings

Read every setting in one reply.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 DA FF
ReplyThirty-two comma-separated fields, then 00. Field 11 is text, the others are ASCII decimal.

NOTE:

New firmware only ADDS fields at the end: read the fields you need by position and ignore fields you do not know.

Fields 1 - 11

FieldMeaningExample
1Line speed in use: code 48-56 = 0x30-0x3853 = 9600 baud
2Data format in use: code 64-68 = 0x40-0x4465 = 8N1
3Working mode: 0 IEC auto, 1 DLMS auto, 2 DLMS auto with a fixed 8N1 start, 3 fixed line 8N1, 4 command mode, 5 fixed line 8E1. Modes 3 and 5 do not tell the speed - read field 1.3
4Auto power-off time, s (255 = never)240
5Optical sensitivity30
6Sleep: 1 enabled, 0 disabled1
7Stored power-on line speed code48 = 300 baud
8Stored power-on data format code64 = 7E1
9Switch position: 1-4 on KMK119 / KMK139 / KMK179, 0 on KMK118 / KMK1383
10Out-of-production flag: 1 = the wireless module was factory-reset (0xBC) and not reconfigured since0
11Wireless module type as text: BT43H on BT v4.1 models, BT53B on BT v5.1 models, WF52 on the KMK179 (WiFi); 0 = not determined yetBT53B

Fields 12 - 32 are service diagnostics: Appendix B.1.1.

0xDB — Read the capabilities

Ask which features this firmware image has.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 DB FF
ReplyA number as ASCII decimal, then 00. Each bit is one feature - see the table below.

NOTE:

Test single bits - never compare the whole number with a constant. Read it as an unsigned 32-bit value. Firmware built before August 2026 does not answer.

Capability bits

Bit valueHexFeature
10x1Staged (A/B) firmware update
20x2Firmware update trigger at any time
40x4Module settings: write
80x8Module settings: read
160x10Module factory reset and restart (0xBC, 0xBD)
320x20Line options 0xD2 - 0xD4
640x40Settings dump (0xDA)
1280x80Diagnostic counters
2560x100Resume an interrupted update
5120x200Refusal reason (0xDC)
10240x400Variant selection (0xD1)
20480x800Function selection (0xD5)
40960x1000Module setting values are checked before writing
81920x2000Queries are answered during an update session
163840x4000Last module read can be fetched again
327680x8000Bluetooth Low Energy self-repair at module start
655360x10000Second diagnostic block
1310720x20000Image identity (0x9E)

0xDC — Why was it refused?

Ask why the last command was refused (NACK).

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 DC FF
ReplyCommand code and reason code as two ASCII decimals, then 00. Example: "213,9" = command 0xD5, reason 9. Command 0 = nothing refused since power-on. All reason codes: Appendix A.1.
StoredKept until the next refusal overwrites it; reading it does not clear it.

7.2 Line settings

0x30 - 0x38 — Set the line speed

Set the speed of the optical (meter-side) line. The command byte itself is the speed.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inCommand mode only
SendFE FE 42 4C 55 45 30 38 4E 31 XX FF - XX is the command byte
Command byte
  • 0x30 300 baud
  • 0x31 600 baud
  • 0x32 1200 baud
  • 0x33 2400 baud
  • 0x34 4800 baud
  • 0x35 9600 baud
  • 0x36 19200 baud
  • 0x37 28800 baud - above the optical standard, see the note
  • 0x38 38400 baud - above the optical standard, see the note
ReplyNo reply. The new speed applies at once.
StoredRAM only - send 0xE0 to keep it as the power-on default.
If refused (v6.0 and later)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15).

NOTE:

28800 and 38400 baud are above what the optical standard covers: they may need a sensitivity adjustment (0xD0) and bytes can be lost. Use them only with a protocol that has its own checksum (Chapter 5.3).

0x40 - 0x44 — Set the data format

Set the data format of the optical line. The command byte itself is the format.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inCommand mode only
SendFE FE 42 4C 55 45 30 38 4E 31 XX FF - XX is the command byte
Command byte
  • 0x40 7E1
  • 0x41 8N1
  • 0x42 8E1
  • 0x43 8O1
  • 0x44 8N2
ReplyNo reply. The new format applies at once.
StoredRAM only - send 0xE0 to keep it as the power-on default.
If refused (v6.0 and later)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15). 0x44 (8N2) from v5.2.

0x50 - 0x51 — Break on / off

Hold the optical transmit line in the break state, or release it.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inCommand mode only
SendFE FE 42 4C 55 45 30 38 4E 31 XX FF - XX is the command byte
Parameter
  • 0x50 break on - the transmit line is held low
  • 0x51 break off
ReplyNo reply.
StoredRAM only - a power cycle also releases the break.
If refused (v6.0 and later)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15).

NOTE:

For meters that need a break condition before a session.

7.3 Power and battery

0xA1 — Read the battery voltage

Read the battery voltage in millivolts.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 A1 FF
ReplyASCII decimal, then 00. Example: "3206".
On v5.xAnswered in command mode and in the fixed-speed modes; the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15).

NOTE:

The lowest voltage measured since power-on. Measured after the regulator, so a nearly empty battery can still read high. The useful range is 3000 - 3200 mV. Charge the probe before a firmware update.

0xA9 — Read the battery charge

Read the battery charge as a percentage.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 A9 FF
ReplyASCII decimal 0 - 100, then 00. Example: "78".

NOTE:

Linear between 3000 mV (0%) and 3200 mV (100%); the same caveat as 0xA1.

0xA2 — Keep the probe awake

Stop the probe from entering its low-power sleep.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 A2 FF
Reply06 00 (ACK).
StoredRAM only - send 0xE0 to keep it after a power cycle.
On v5.xAnswered in command mode and in the fixed-speed modes; the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15).

NOTE:

Without a connection the probe otherwise sleeps after 60 s. This does not stop the auto power-off (0xC3). Send it again after anything that restarts the probe.

0xC2 — Switch off

Switch the probe off, as with the power button.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 C2 FF
ReplyNone - the probe switches off.
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15).

0xC3 — Set the auto power-off time

Set how long the probe waits without activity before it switches itself off.

WARNING:

0 switches the probe off as soon as the connection closes. Do not store a time under 60 s with 0xE0: at power-up the probe would switch itself off before you can connect.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 C3 FF
Parameter
  • 0 - 253 seconds without activity
  • 255 never switch off
Reply
  • 06 00 at once - now send the parameter byte.
  • 06 00 again when the value is applied.
If refused (v6.0 and later)No parameter within 1 s: 15 00 and nothing changes.
StoredRAM only - send 0xE0 to keep it after a power cycle.
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15). Factory value 254 s; a connected probe never switched itself off.

NOTE:

Factory value 240 s. The countdown runs only while no connection is open; a connected probe without traffic switches off after about 11 minutes (Chapter 11.3). 254 (0xFE) cannot be sent: 0xFE always starts a new frame (Chapter 6.2.3).

7.4 Optical head

0xD0 — Set the optical sensitivity

Set the sensitivity of the optical receiver.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 D0 FF
Parameter
  • 0 - 255 higher = more sensitive; 254 cannot be sent (see the note)
Reply
  • 06 00 at once - now send the value.
  • 06 00 again when the value is applied.
If refused (v6.0 and later)No value within 1 s: 15 00 and nothing changes.
StoredRAM only - send 0xE0 to keep it after a power cycle.
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15). Factory value 26; a factory reset (0xE1) set 49 on older units.

NOTE:

Factory value 30 (49 on older units). Raise it step by step for meters with a weak optical output; lower it if you see duplicated bytes from reflections. On KMK119, KMK139 and KMK179 stay at or below 0x55. 254 (0xFE) cannot be sent: 0xFE always starts a new frame (Chapter 6.2.3).

7.5 Working mode

0xD5 — Select the working function

Select what the optical line does on KMK118 / KMK138.

ProductsKMK118 · KMK138
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 D5 FF
Parameter
  • 0 Command mode
  • 1 IEC auto
  • 2 Fixed 9600 8N1
  • 3 DLMS auto
  • 0xFF back to the default of the loaded image
  • none read the active value
Reply
  • Write: 06 00, then the probe restarts (about 50 ms later).
  • Read: 15 00 followed by the value as ASCII decimal and 00. The 15 00 is normal.
If refusedValue out of range: 15 00 and nothing changes (reason 9, Appendix A.1).
StoredStored at once. Kept by a factory reset (0xE1) and by firmware updates.

NOTE:

Before v6.0 each function was a separate firmware. The functions: Chapter 4.1.

0xD1 — Select the firmware variant

Select the firmware variant on KMK119 / KMK139 / KMK179.

ProductsKMK119 · KMK139
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 D1 FF
Parameter
  • 0 standard - the switch selects the working mode
  • 2 the same as 0
  • 6 ANSI2 - switch positions 1 - 3 are fixed lines, as shipped on KMK139
  • other project-specific variants - contact us
  • 0xFF back to the default of the loaded image
  • none read the active value
Reply
  • Write: 06 00, then the probe restarts (about 50 ms later).
  • Read: 15 00 followed by the value as ASCII decimal and 00. The 15 00 is normal.
If refusedValue out of range: 15 00 and nothing changes (reason 9, Appendix A.1).
StoredStored at once. Kept by a factory reset (0xE1) and by firmware updates.

NOTE:

Loading a different firmware image does NOT change a variant set with this command. A probe whose variant was never set uses the variant of the loaded image.

0xD2 — Switch position 3 line settings

Choose the line settings of switch position 3.

ProductsKMK119 · KMK139 (accepted on KMK118 / KMK138 without effect; a KMK139 with the ANSI2 variant stores it, but its line does not change)
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 D2 FF
Parameter
  • 0 9600 8N1 (default)
  • 1 9600 8E1
  • 2 19200 8N1
  • 3 28800 8N1
  • 4 1200 8N1
  • 0xFF back to the default
  • none read the active value
Reply
  • Write: 06 00, then the probe restarts (about 50 ms later).
  • Read: 15 00 followed by the value as ASCII decimal and 00. The 15 00 is normal.
If refusedValue out of range: 15 00 and nothing changes (reason 9, Appendix A.1).
StoredStored at once. Kept by a factory reset (0xE1) and by firmware updates.

0xD3 — IEC baud change-over mode

Choose the IEC 62056-21 baud change-over mode used by the IEC auto mode.

ProductsKMK118 · KMK138 · KMK119 · KMK139 (a KMK139 with the ANSI2 variant stores it, but its line does not change)
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 D3 FF
Parameter
  • 0 mode C (default)
  • 1 mode E
  • 0xFF back to the default
  • none read the active value
Reply
  • Write: 06 00, then the probe restarts (about 50 ms later).
  • Read: 15 00 followed by the value as ASCII decimal and 00. The 15 00 is normal.
If refusedValue out of range: 15 00 and nothing changes (reason 9, Appendix A.1).
StoredStored at once. Kept by a factory reset (0xE1) and by firmware updates.

0xD4 — DLMS start framing

Choose the data format at the start of a DLMS session in the DLMS auto mode.

ProductsKMK118 · KMK138 · KMK119 · KMK139 (a KMK139 with the ANSI2 variant stores it, but its line does not change)
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 D4 FF
Parameter
  • 0 7E1 (default)
  • 1 8N1
  • 0xFF back to the default
  • none read the active value
Reply
  • Write: 06 00, then the probe restarts (about 50 ms later).
  • Read: 15 00 followed by the value as ASCII decimal and 00. The 15 00 is normal.
If refusedValue out of range: 15 00 and nothing changes (reason 9, Appendix A.1).
StoredStored at once. Kept by a factory reset (0xE1) and by firmware updates.

7.6 Settings

0xE0 — Store the settings

Store the current session settings as the power-on defaults.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 E0 FF
Reply06 00 - two bytes; read both.
StoredYes - this is the command that makes settings survive a power cycle
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15).

NOTE:

Stores sleep, auto power-off, sensitivity, line speed and data format. The working-mode commands 0xD1 - 0xD5 store themselves. The stored bytes: Appendix A.3.

0xE1 — Factory reset

Restore and store the factory settings.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareAll versions (v5.x and v6.x)
Works inCommand mode only
SendFE FE 42 4C 55 45 30 38 4E 31 E1 FF
Reply06 00.
StoredYes - written to EEPROM immediately
If refused (v6.0 and later)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On v5.xOnly on firmware with a command mode, which answered it in command mode and also in the fixed-speed modes (the mode was not checked); the automatic IEC and DLMS modes did not answer commands, and there was no refusal reply (15). It restored an auto power-off of 254 s and sensitivity 26 (49 on older units).

NOTE:

Restores: sleep on, auto power-off 240 s, sensitivity 30 (49 on older units), 300 baud 7E1. It does not change the working mode or variant (0xD1 - 0xD5).

7.7 Wireless module

0xBD — Restart the wireless module

Restart the Bluetooth or WiFi module of the probe.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 BD FF
Reply06, then the module restarts and the connection drops.
If refused15 if a module configuration is pending (reason 2) or the meter is sending (reason 3).

NOTE:

The connection drops about 26 s after the 06 and you can reconnect after about 36 s (measured on a Windows PC over the Bluetooth serial port). Useful when the connection is up but data no longer passes.

0xBC — Factory-reset the wireless module

Return the Bluetooth or WiFi module to its own factory configuration.

WARNING:

Service use only. The module loses its production settings: the device name and the link parameters return to the module defaults, and on BT v5.1 models Bluetooth Low Energy stays off until the probe restores it at its next module start. Drop the connection right after the 06 - while the link is held open the reset does not happen. Restoring the production settings needs abcZ in service mode - contact us.

ProductsKMK118 · KMK138 · KMK119 · KMK139
FirmwareFrom v6.0 - not in v5.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 BC FF
Reply06 (single byte).
If refused15 if a module configuration is pending (reason 2) or the meter is sending (reason 3).
StoredWritten into the module.

8. Status, Identity and Capabilities

A few read-only commands tell you what a probe is and what it is doing. They work in every working mode and change nothing, so you can send them at any time - except in the middle of a meter transfer (Chapter 6.4).

QuestionCommandExample replyDetails
Which product, firmware and mode?0xA0"N23221133 v6.4 290926"name code
Exactly which firmware image is running?0x9E"1301"compare for equality with the value published with your firmware
What are all the settings now?0xDA32 comma-separated fieldsfields 1 - 11
Which features does this firmware have?0xDBa 32-bit numbercapability bits
Why was my last command refused?0xDC"213,9"reason codes

8.1 Reading the firmware name

The name has a nine-character code, the version and the build date. Example "N23221133 v6.4 290926":

CharValueMeans
c0Ncurrent optical sensor
c12KMK118 / KMK138
c23fixed 9600 8N1
c32DLMS start 7E1
c42IEC mode C
c51A/B bootloader
c61staged update supported
c73firmware v6.x
c83Bluetooth module (BT v4.1 or BT v5.1 model)

The firmware file name carries the same code, but only with the defaults of the image. Characters c2 - c5 are read from the probe at start-up, so after a mode change, or on a probe that still has the legacy bootloader, the name differs from the file name. That is not a fault: only the version and the date must match.

8.2 Asking for a feature

Before you use a feature that not every firmware has, read 0xDB and test its bit. Never compare the whole number with a fixed value: a newer firmware adds bits. Firmware without the capability read (built before August 2026, and every v5.x) does not answer 0xDB at all - treat silence as "no extra features".

9. Settings and Persistence

The probe keeps two kinds of settings. Knowing which is which saves surprises after a power cycle, a factory reset or a firmware update.

Session settingsIdentity settings
Settingssleep, auto power-off time, optical sensitivity, power-on line speed and data formatKMK118 function, DLMS start framing, IEC change-over mode, switch position 3 line, KMK119 variant
Stored bytes0 - 45 - 9
Changed by0xA2, 0xC3, 0xD0, line commands - in RAM, at once0xD1 - 0xD5 - stored at once, applied by a restart
After a power cyclekept only after 0xE0kept
Factory reset (0xE1)back to the factory valueskept
Firmware update over the airkeptkept
Programming with a programmerset to the programmed defaultsset to the defaults of the loaded image

9.1 Storing and restoring

0xE0 stores the session settings as they are now; they become the power-on settings. 0xE1 restores and stores the factory values - sleep on, auto power-off 240 s, sensitivity 30 (49 on older units), 300 baud 7E1 - and works only in command mode. Neither touches the identity settings, so a factory reset never changes what kind of probe it is.

Every stored byte: Appendix A.3. The line settings are also re-applied from the stored values at every new connection (Chapter 5.2.2).

10. Firmware Update

A firmware update keeps the probe's stored settings and its identity (Chapter 9). Update with abcZ on a Windows PC (section 10.2) or with ZRobo on an Android phone (section 10.3). A probe with firmware v6.x takes an update at any time and in every working mode; you do not need to switch it off and on - abcZ and ZRobo prepare the probe themselves. A probe with firmware v5.x takes an update only in the first 10 s after it is switched on, so abcZ and ZRobo ask you to switch it off and on (Chapter 14.2.1).

10.1 Before you update

10.1.1 Which file

Choosing the update file: probes with the A/B bootloader take the _OTA.bin, probes with the legacy bootloader the _LEGACY.bin; never an _OTA.bin on the legacy bootloader

Figure 10.1 - Which file for which probe

For each firmware image your firmware package has two files for abcZ and ZRobo. Which one a probe takes depends on its bootloader; abcZ shows the bootloader on the Overview page (Chapter 12.2.1).

FileForHow it loads
_OTA.binprobes with the A/B bootloaderstaged: the probe keeps running its firmware until the new one is complete and checked
_LEGACY.binprobes with the legacy bootloader: every probe with firmware v5.x, and v6.x probes that were moved from v5.x over the airlegacy load: not protected against interruption (section 10.4.2)

WARNING:

Never load an _OTA.bin into a probe with the legacy bootloader: the old bootloader writes the compressed file as it is, and the probe does not start again - only a programmer brings it back. abcZ and ZRobo check the bootloader before they send anything and refuse such a file. An older abcZ may not check: update with abcZ 4.2.0 (Chapter 12).

Your own software can read the bootloader from character c5 of the firmware name (Chapter 8.1).

Download the file for your model from its product page on probeformeters.com (Latest Firmware), or use the one we supply with your probes; abcZ and ZRobo refuse a file made for another model. Loading a firmware image does not change a stored working mode or variant (Chapter 4).

For a KMK139 use the KMK119 file with Ansi2 in its name: it carries the ANSI2 variant the KMK139 leaves the factory with (Chapter 4.2). A probe whose variant was never set with 0xD1 uses the variant of the loaded image, so the standard file would change the switch positions of a KMK139.

10.1.2 Charge the probe first

A probe with firmware v6.x refuses to start an update while its battery is below 3100 mV (0xA1). abcZ skips such a probe and tells you why; ZRobo reads the battery before it sends anything and warns you.

10.2 Update with abcZ (Windows)

Open the probe in abcZ (Chapter 12.1) and choose the Firmware page - or, for several probes at once, tick them in the Devices list and press "Update firmware...". Then:

  1. Press Choose a .bin... for each model and pick the firmware file (Figures 10.2 and 10.3); abcZ refuses a file made for another model. Section 10.1.1 tells which file to use.
  2. Press Review and update firmware (Figure 10.4). The review shows which file goes to which probe, the update path, the link, the number of packets and an estimate of the time; nothing has been sent yet (Figure 10.5).
  3. Leave Check module defaults before the update ticked: abcZ compares the module with our standard and writes only what differs.
  4. Press Start the update. abcZ shows the progress of every probe. A probe whose battery is below 3100 mV is skipped, with the reason - charge it first.
  5. When the update ends, abcZ reads every probe again (Figure 10.6). A green row means the probe came back and reported the new firmware itself; a red row means the check could not be completed: open the probe and read it, and see the Log page (Chapter 12).

A probe with firmware v5.x is updated over the legacy path, with a _LEGACY.bin file; when abcZ needs the probe restarted, its row asks you to switch it off and on (Chapter 14.2.1).

abcZ Firmware page: one image per model - press Choose a .bin to pick the firmware file for your probes; devices without an image are skippedabcZ Choose a .bin: pick the _OTA.bin image for your model from the firmware package (KMK119 standard image v6.4 here); the dialog lists OTA images (*.bin)
Figure 10.2 - Firmware: one image per modelFigure 10.3 - Choose a .bin: the _OTA.bin file for the model
abcZ Firmware page after choosing the image: every model has an image - press Review and update firmware to see which file goes to which device before anything is sentabcZ Review before the update: which image goes to which probe, the update path (staged A/B), link, packets and an estimate - nothing is sent until you press Start the update
Figure 10.4 - Every model has an imageFigure 10.5 - Review before anything is sent

abcZ after the update: 1 of 1 devices updated and verified - the probe restarted on the new image and abcZ read it back

Figure 10.6 - Updated and verified

Video - updating a KMK119 with abcZ over Bluetooth:

Watch the video at probeformeters.com/download/abcz-firmware-update.mp4.

10.3 Update with ZRobo (Android)

  1. Connect to the probe over BT SPP or BT BLE (Chapter 13.1) and open the Firmware page (Figure 10.7).
  2. Tap Choose firmware file (_OTA.bin) and pick the file for the probe (section 10.1.1). ZRobo checks it against the connected probe: "This firmware file can be sent to the connected device." (Figure 10.8). A file for another model is refused.
  3. Tap Update the device. ZRobo reads the battery first, then shows the progress ("Sending packet ... of ...", Figure 10.9).
  4. When the update ends, the probe restarts with the new firmware and ZRobo connects again: "Done - the device came back with the new firmware and is connected again." (Figure 10.10).
  5. If the connection drops, nothing is committed: reconnect and tap Continue - the update goes on where it stopped.
  6. A probe with firmware v5.x: ZRobo asks "Have you switched the probe off and on?" - switch the probe off and on, answer Yes, and ZRobo catches the boot-up window.
ZRobo Firmware page: choose an _OTA.bin file, then Update the deviceZRobo 3.0.0 Firmware page after choosing the file: the file name, its size, and the check - This firmware file can be sent to the connected device
Figure 10.7 - ZRobo, Firmware pageFigure 10.8 - The file is chosen and checked
ZRobo 3.0.0 Firmware page during the update: a progress bar and Sending packet 162 of 318ZRobo 3.0.0 Firmware page after the update: Done - the device came back with the new firmware and is connected again
Figure 10.9 - The file is being sentFigure 10.10 - Done: the probe is back with the new firmware

Video - updating a KMK119 with ZRobo over the Bluetooth serial port (SPP):

Watch the video at probeformeters.com/download/zrobo-firmware-update.mp4.

10.4 Time and interruptions

10.4.1 How long it takes

LinkUpdateTime for one probe (measured)
Bluetooth serial port (SPP)staged (_OTA.bin)about 10 - 20 s
BLE, BT v5.1 modelsstaged (_OTA.bin)about 35 - 50 s
BLE, BT v4.1 modelsstaged (_OTA.bin)about 160 s
Bluetooth serial port (SPP)legacy (_LEGACY.bin)about 60 s

Connecting and the final check add some time. abcZ shows its own estimate in the review, before anything is sent (section 10.2).

During a staged update the probe shows no progress: its LEDs keep their normal meaning. When the transfer ends the probe restarts, and its red LED blinks fast while the new firmware is applied (2.3).

10.4.2 If an update is interrupted

With the A/B bootloader the running firmware stays until the new one is complete and checked; a power loss during the switch-over is completed at the next power-up. An interrupted staged update can simply be started again.

A legacy load (_LEGACY.bin) is not protected: if it is interrupted, the row says "in the bootloader". The probe then has no firmware and waits in its bootloader - also after it is switched off and on; it does not answer and its red LED blinks. Do not start another update before the probe has been switched off and on: an update started without that can be written to the wrong place.

  1. Switch the probe off and on. Then stay on the Firmware page and do not press Select port, Find devices or Open device until the update is running: a read at that moment can block the probe.
  2. Press Start over and tick "Instead, load 1 silent device as already waiting in the bootloader (forced, no trigger)". Only a _LEGACY.bin file is accepted.
  3. A second box appears: tick "The device has been switched off and on since the interrupted upload" - you did that in step 1. Then press Review and update firmware and Start the update.

If the row then says "bootloader stuck", nothing was written: do steps 1 to 3 once more. If abcZ was closed after the interruption, the row is gone: read the probe's port with Select port (it gives no reply), open its row and the Firmware page, choose the same file and tick the box of step 2; only then switch the probe off and on and, without reading it again, go on with step 3. If the probe does not take the load, see Appendix B.2.2; if nothing helps, a programmer brings it back - contact us.

10.5 Project-specific firmware

Firmware for a particular meter or protocol - for example another layout of the working modes - is available as a project-specific variant; contact us. Update such a probe only with the file we supply for it.

11. Power and Battery

11.1 Battery and charging

KMK119 and KMK139 have a 1200 mAh battery; KMK118 and KMK138 have a 600 mAh battery. Charge the probe with the cable that comes with it, from any USB charger or PC port with a USB Type-A socket. Depending on the hardware version the probe has a USB Type-C or a Micro-USB port. While the probe charges its charge LED is on; the LED goes off when the battery is full.

How long a charge lasts depends on the work. In our test with firmware v6.3 220926 a PC read an IEC meter through the probe every 10 seconds over Bluetooth (SPP, working mode IEC auto; the meter was simulated): a KMK119 worked about 39.5 hours on a full charge and a KMK118 about 18 hours (Figure 11.1). The KMK139 has the same board and battery as the KMK119, and the KMK138 the same as the KMK118.

Battery test with firmware v6.3 220926: probe voltage (0xA1, the lowest since power-on) against hours of work, an IEC meter read every 10 seconds - KMK119 about 39.5 hours, KMK118 about 18 hours

Figure 11.1 - Battery test with firmware v6.3 220926: an IEC meter read every 10 seconds

The voltage stays almost level for most of the charge and then falls quickly. When the CHARGE LED (on KMK118 and KMK138 the LED with the battery symbol) turns red, finish the work and charge the probe - in our test it switched off soon after:

In our testKMK119KMK118
Worked on a full chargeabout 39.5 hoursabout 18 hours
From 3200 mV to 3000 mV, where the CHARGE LED turns redabout 75 minutesabout 30 minutes
From 3000 mV until the probe switched offabout 25 minutesabout 10 minutes

11.2 Battery level

0xA1 reads the battery voltage in millivolts and 0xA9 as a percentage; both give the lowest voltage measured since power-on. The probe measures the voltage after its regulator, so a nearly empty battery can still read full: the useful range is 3000 - 3200 mV, and 0xA9 maps this range to 0 - 100 %. Below 3000 mV the CHARGE LED turns red, and it changes back once the battery reaches 3050 mV. Below 3100 mV a firmware update does not start (Chapter 10.1.2).

11.3 Auto power-off

The probe switches itself off to save the battery. Without a connection it waits 240 s without activity (the factory value; set it with 0xC3). While a connection is open that countdown does not run; instead a probe that stays connected without any traffic switches itself off after about 11 minutes. Every byte in either direction - from your software or from the meter - starts both again. 255 turns both off. Both wait while a firmware update or a module setting is in progress.

11.4 Sleep

Without a connection, a probe with sleep on goes into a low-power sleep after 60 s and a KMK119 or KMK139 switches its mode LEDs off. A freshly programmed probe has sleep off; a factory reset (0xE1) turns it on and 0xA2 turns it off (Appendix A.3). Sleep does not switch the probe off - auto power-off does.

12. Software - abcZ 4.2.0 for Windows

abcZ is our Windows program for the probes. It finds them, shows what they report about themselves, changes their settings and updates their firmware - of one probe or of many at a time. Download it from the product page of your probe or directly: abcZ-4.2.0.zip. The archive holds one program file, abcZ.exe, that runs without installation. It needs a PC with 64-bit (x64) Windows 11 in a version Microsoft still supports, or with a Windows 10 Enterprise LTSC or IoT Enterprise edition that Microsoft still supports: abcZ is built on .NET 10, and these are the Windows versions .NET 10 supports.

This chapter shows abcZ in normal mode. Admin mode is for service use: changes made there can make the probe unreachable. Contact us before using it.

abcZ runs in one window. If you start it a second time, no second window opens: the open one comes to the front and says "A second abcZ was started and closed - this window is the one in use". To work with several probes, open them side by side in its Devices list.

12.1 Find your probes

Pair the probe with the PC first (Chapter 3.1). Then choose under SOURCE how abcZ looks for probes:

  • "Bluetooth BLE + SPP (Serial Ports)" - the paired Bluetooth COM ports and a BLE scan, in one list. abcZ starts with this one.
  • "Bluetooth SPP (Serial Ports) Only" - the paired Bluetooth COM ports only.
  • "Bluetooth BLE Only" - a BLE scan only.

abcZ reads nothing until you ask (Figure 12.1). Find devices opens and reads every probe it recognises - by its Bluetooth address or its KMK name - and leaves every other port closed. Select port lists each paired probe's outgoing COM port with its name and Bluetooth address, without opening a port (Figure 12.2); pick one to read only that probe. Ports abcZ does not recognise are listed below them: read one only if you know what is on it.

Each column of the list is a value read from the probe; a dash means that the probe does not have the command (Figure 12.3). Double-click a row, or select it and press Open device, to open the probe's pages.

If a probe will not reconnect, Reset Bluetooth switches the PC's Bluetooth radio off and on. Every Bluetooth link of the PC - a mouse or keyboard too - drops for a few seconds; the pairings are kept and nothing is written to the probe.

abcZ 4.2.0 Devices page at start (normal mode, source Bluetooth SPP only): nothing is read until you press Find devices or Select port

Figure 12.1 - Devices at start: nothing is read yet

abcZ Select port: each probe's outgoing Bluetooth COM port is listed with its name and address (SPP COM20 - KMK119 736e5e here); pick one to read only that probe

Figure 12.2 - Select port: each probe's outgoing COM port, by name and address

abcZ Devices after Select port: the KMK119 on COM20 is read - model, generation, link, firmware, bootloader and device function (scroll right for the meter line, switch position, auto power-off, sensitivity, battery and status)

Figure 12.3 - A probe read over Select port

12.2 A probe's pages

12.2.1 Overview

The Overview page shows what the probe reports about itself: the firmware name and date, the nine-character name code decoded character by character (Chapter 8.1), the link, the battery, how an update is protected, and the meter line - the speed and framing the optical line uses now and the one it starts with at power-on. Read again reads it all anew.

abcZ Overview of a KMK119: firmware name and date, and the nine-character name code decoded (optical sensor, model, variant, DLMS start, IEC mode, bootloader, update capability, generation, wireless module)

Figure 12.4 - Overview of a KMK119

12.2.2 Settings

The Settings page lists the probe's settings with the command behind each one. On the device is the value read from the probe; choose a New value and press Write and verify. What writing does tells what happens: 0xD1 - 0xD5 restart the probe, so abcZ waits, reopens the port and reads the value back before it reports success (Chapter 6.3.2); the other settings apply at once and last until the next restart unless you store them. Dimmed rows are commands this probe does not have; hover one to see why. The settings themselves are in Chapter 4, Chapter 5 and Chapter 9.

The Meter line box works in command mode only: choose the speed and framing and press Apply to line. Store as power-on default (0xE0) keeps the current settings for the next power-on. Hold the line in break (0x50) and Release (0x51) start and end a break on the optical line. Factory defaults (0xE1) and Turn off (0xC2) do what the commands do.

abcZ Settings of a KMK119: each row shows the command, the value on the device, a new value to write and what writing does (for example, a variant change restarts the probe)

Figure 12.5 - Settings

12.2.3 Module

The Module page shows the probe's Bluetooth module: its identity and the settings we set at the factory. Press Read all from the module: On the module then shows what the module reported, and Allowed values what it accepts. Where a value differs from our standard, abcZ fills in our standard as the New value, and Write to the module applies it. No other value can be changed in normal mode.

FieldWhat it isOur standard
HardwareTypeThe module type as the module itself reports it: BT43H on BT v4.1 models, BT53B on BT v5.1 models.read-only
BD_ADDRThe Bluetooth address.read-only
BuildVersionThe date code of the module's own firmware.read-only
CODClass of Device: how the probe presents itself to a PC or phone that scans.001f00
DeviceNameThe name shown when you pair or scan.model and the last six characters of the address, for example "KMK119 736e5e"
DefaultAuthThe default authentication mode for a new pairing.4
BLEModemModeBluetooth Low Energy as a serial link: 1 = on.1
BatteryEnableThe BLE battery service.false
CharacteristicMaxThe largest BLE characteristic size.1
ConnectIntMin / ConnectIntMaxThe BLE connection interval the probe asks for, in steps of 1.25 ms (12 / 24 = 15 / 30 ms). The phone or PC decides (Chapter 6.5).12 / 24
UartTimeoutHow long the module waits before it passes on a partly filled packet.600 on BT v5.1 models; BT v4.1 models keep their own value

The Caveat column adds a note to a field when one applies. The SERVICE PORT row reads the module over the optical port instead of the Bluetooth link, for service use (Chapter 12.4); you do not need it.

abcZ Module page (normal mode): the Bluetooth module's identity and our defaults, read from the module - the value on the module next to the allowed values

Figure 12.6 - Module, after Read all from the module

12.2.4 Diagnostics

Diagnostics reads the probe's counters and its state. The counters only count up, so a number alone does not tell when something happened. To see what an action costs, press Read counters, then Use as baseline, do the action you suspect - for example a meter reading or a firmware update - and read again: the change column shows the difference. Forget baseline returns to plain readings. Below the counters every state value carries its own note on the screen. When you contact us about a problem, send us a screenshot of this page.

abcZ Diagnostics: read the counters, press Use as baseline, do the action you suspect, read again - the change column shows what it cost; below, the device state from 0xDA with a note next to each value

Figure 12.7 - Diagnostics, top of the page

12.3 Update and log

12.3.1 Update the firmware

The Firmware page updates the firmware of the open probe; for several probes at once, tick them in the Devices list and press "Update firmware...". The steps, with the screens and a video, are in Chapter 10.2; what to do when a probe waits in its bootloader is in Chapter 10.4.2.

12.3.2 Log

The Log page lists every step abcZ took, probe by probe; Only what went wrong narrows the list and Copy everything copies it. abcZ also writes abcZ.log and abcZ.previous.log next to its program file: send both with a problem report.

The Bluetooth PIN written from the Module page appears in the log only by its length, for example "(hidden, 16 chars)".

12.4 Service port

The Service port page talks to the probe's Bluetooth module directly, through a USB optical probe placed face to face with the probe's optical port, without the probe's firmware in between. It is for service use - for example when BLE has been turned off on the module - and you do not need it in normal use; contact us before you use it.

13. Software - ZRobo 3.0.0 for Android

ZRobo is our free Android app for reading meters through the probe. It also reads and changes the probe settings, shows its diagnostics, updates its firmware and shows its Bluetooth module. Get it from Google Play; ZRobo's own user guide is on its product page. This chapter covers what you need with a KMK probe. Android 9 or newer with Bluetooth is required.

13.1 Connect to the probe

  1. Switch the probe on.
  2. Tap Change in the bar at the top. The Devices page lists your paired probes and the ways each one can be reached: BT SPP (classic Bluetooth) and BT BLE. Tap Scan to find probes that are not listed yet; a probe with firmware v6.x also offers BT BLE, because BLE is on from the factory.
  3. Tap BT SPP or BT BLE on the probe's row. When the link is up the chip in the bar turns green; over BLE the bar also shows, as the link comes up, the MTU agreed with the probe's Bluetooth module.
  4. With Connect by itself to the probe you last used ticked, ZRobo reconnects when it starts. The chip in the bar always shows which link is in use.
ZRobo 3.0.0 Devices screen: paired probes listed with their transports (BT SPP / BT BLE); Scan finds new onesZRobo Devices after Scan: the KMK119 now also offers BT BLE (v6.x probes have BLE on by default)
Figure 13.1 - Devices: paired probes and their linksFigure 13.2 - After Scan the KMK119 also offers BT BLE
ZRobo Meter Reading screen connected to a KMK119 over BT SPP (green chip), before readingZRobo connected to a KMK119 over BT BLE; the bar shows the negotiated MTU (23 on this module)
Figure 13.3 - Connected over BT SPPFigure 13.4 - Connected over BT BLE, with the MTU

13.2 Read a meter

13.2.1 Taking a reading

Put the optical head on the meter's optical port, with the probe in a mode that suits the meter (Chapter 4). Tap Read meter: the meter's lines appear under READOUT as they arrive, and the chip beside READOUT shows OK or Failed.

ZRobo reads IEC 62056-21 meters; for ANSI meters use your ANSI meter reading software. The last line under the "!" is the block check character of the readout, shown as received.

If the chip shows Failed and no line arrived, check that the optical head sits on the meter's optical port and that the probe mode suits the meter, then read again.

ZRobo readout of an IEC 62056-21 mode C meter through a KMK119 (SIM-METER = simulated meter on the bench); last line is the block check character

Figure 13.5 - A readout (SIM-METER is the simulated meter on our bench)

Video - connecting and reading a meter:

Watch the video at probeformeters.com/download/zrobo-reading-spp-command-mode.mp4.

13.2.2 Match "Bluetooth REDZ command mode" to the probe's mode

This setting is on the Functional tab of Settings. When it is on, ZRobo sets the probe's line to 300 baud 7E1 before every reading, with the line commands of Chapter 5.2.1. The probe accepts them only in command mode (Chapter 4).

  • Probe in command mode - a KMK118 as it leaves the factory, or a KMK119 with the switch in position 4: turn the setting on.
  • Probe in an automatic mode - for example a KMK119 with the switch in position 1: the probe sets the line by itself. If the setting is on, the probe refuses the line commands and ZRobo shows "The probe refused it: not in command mode right now" before each reading; the reading still completes. Turn the setting off to avoid the message.

ZRobo Settings - Functional: auto-connect to last probe, show all Bluetooth devices when scanning, REDZ command mode, auto-save after reading

Figure 13.6 - Settings, Functional tab

13.3 Settings, diagnostics and firmware

13.3.1 Probe settings

On the Device tab of Settings, tap Read from the device. Each row then shows the value on the probe ("On the device"); rows this model does not have are greyed out. Change a row and tap Write and verify. Rows marked "This setting restarts the device when written" restart the probe (Chapter 6.3.2). The settings themselves are described in Chapter 4, Chapter 5 and Chapter 9.

ZRobo Settings - Device after Read from the device: each row shows the value on the device; rows not on this model are greyed

Figure 13.7 - Settings, Device tab after Read from the device

13.3.2 Diagnostics

Run diagnostics reads the probe's state and explains each value. When you contact us about a problem, send us a screenshot of this page.

ZRobo Diagnostics after Run diagnostics: device state from 0xDA with a note under each value (KMK119, switch position 1)

Figure 13.8 - Diagnostics

13.3.3 Firmware and module

The Firmware page updates the probe's firmware; the steps are in Chapter 10.3. The Module page shows the Bluetooth module's identity and the settings we set at the factory, next to our standard values, after Read from the module.

ZRobo Module page after Read from the module: identity and our defaults, module value next to our standard (all compared rows match)

Figure 13.9 - Module after Read from the module

14. What's New and Migrating from v5.x

This chapter is for anyone who already uses probes with v5.x firmware. It lists what changed in each release, which commands are new, and what to watch when you move a probe to v6.x.

14.1 What changed

14.1.1 Release history

VersionChange
v6.4Data integrity fix: if the start-up window (60 s after power-on) ended while the probe was holding 0xFE bytes, it sent them in front of every later byte towards the meter until it was switched off, and no longer answered commands. Affected v6.0 - v6.3 in every working mode.
v6.3Data integrity fix: when the data sent to the meter contained FE FE FE, the probe could pass extra 0xFE bytes to the meter, which breaks a DLMS/HDLC length field and checksum. Affected v6.0 - v6.2 in every working mode, and v5.x in its fixed-speed and command modes.
v6.2New 0x9E: tells exactly which firmware image is running.
v6.2The identity settings (Chapter 9) accept 0xFF: back to the default of the loaded firmware.
v6.2Storing settings (0xE0) during a live meter transfer no longer loses meter data.
v6.2New product: KMK179, the KMK119 board with a WiFi module; commands over TCP.
v6.2Factory auto power-off 240 s (v6.0 and v6.1: 180 s).
v6.1 / v6.20xDA grew to 32 fields; new fields are only added at the end.
v6.0Third generation: one firmware per product with the working mode chosen by command or switch; commands answered in every working mode, with refusal reasons (0xDC); new read-outs 0xA9, 0xDA and 0xDB; staged (A/B) firmware update on probes with the new bootloader; wireless module restart and factory reset (0xBD, 0xBC).

14.1.2 Command differences

The customer commands of this manual, compared with the v5.5 source code. Service counters are in Appendix B.1.2; commands used only by service tools are not listed. The "On v5.x" row of each card gives the details.

CodeCommandIn v5.x
0xA0Read the firmware nameYes
0x9ERead the image identityNo - new in v6.2
0xDARead all settingsNo - new in v6.0
0xDBRead the capabilitiesNo - new in v6.0
0xDCWhy was it refused?No - new in v6.0
0x30 - 0x38Set the line speedYes
0x40 - 0x44Set the data formatYes (0x44 from v5.2)
0x50 - 0x51Break on / offYes
0xA1Read the battery voltageYes
0xA9Read the battery chargeNo - new in v6.0
0xA2Keep the probe awakeYes
0xC2Switch offYes
0xC3Set the auto power-off timeYes
0xD0Set the optical sensitivityYes
0xD5Select the working functionNo - new in v6.0
0xD1Select the firmware variantNo - new in v6.0
0xD2Switch position 3 line settingsNo - new in v6.0
0xD3IEC baud change-over modeNo - new in v6.0
0xD4DLMS start framingNo - new in v6.0
0xE0Store the settingsYes
0xE1Factory resetYes
0xBDRestart the wireless moduleNo - new in v6.0
0xBCFactory-reset the wireless moduleNo - new in v6.0

14.1.3 What works differently

Topicv5.xv6.x
Variant (KMK119 family)Each variant was a separate firmware.One firmware; the variant is stored and changed with 0xD1.
Function (KMK118, KMK138)Each function was a separate firmware.One firmware; the function is stored and changed with 0xD5.
Switch position 3 lineFixed by the firmware.Five choices with 0xD2.
DLMS start framingFixed by the firmware.A setting: 0xD4.
IEC change-over modeFixed by the firmware.A setting: 0xD3.
CommandsHandled in command mode and in the fixed-speed modes, not in the automatic IEC and DLMS modes; firmware without a command mode handled only 0xA0 - 0xA2. No refusal reply.Answered in every working mode; a refusal is 15 and 0xDC tells why.
Starting a firmware updateOnly in a 10 s window after power-on.At any time; no power cycle needed.
Interrupted updateCould leave the probe without working firmware.With the A/B bootloader the running firmware stays until the new one is complete and checked; a power loss during the switch-over is completed at the next power-up.
Firmware nameFree text up to v5.3; from v5.4 nine characters with c5 - c7 always 000.Every character has a meaning; c2 - c5 show the live state (Chapter 8.1).
Auto power-offFactory 254 s; a connected probe never switched itself off.Factory 240 s; a connected probe without traffic switches itself off after about 11 minutes.
Bluetooth version (BT v4.1 or BT v5.1 model)Not visible from software.0xDA field 11 tells it: BT43H = BT v4.1, BT53B = BT v5.1.
Device nameLong names; in a BLE scan list every probe looked the same.Short names "KMK118 xxxxxx" that stay unique in a BLE scan list.

Also different: 0xE0 answers with two bytes (06 00); the line settings return to the stored values at every new connection (Chapter 5.2.2); loading a different firmware image does not change a stored variant or function (Chapter 4).

14.2 Moving to v6.x

14.2.1 Updating v5.x probes

Firmware v5.x takes a new firmware only in a 10 s window right after power-on, while the Bluetooth connection itself needs 5 - 20 s to come up. The update tool has to catch that window; if it does not land, switch the probe off and on and try again. A programmer is the fallback. The steps are in Chapter 10.

A probe updated this way keeps its old (legacy) bootloader: character c5 of the name stays 0. Later updates still work at any time, but not as a staged (A/B) update - the A/B bootloader can only be installed with a programmer.

14.2.2 Compatibility

A v6.x firmware replaces the v5.x firmware of the same product and working mode one to one: a probe whose stored settings were never changed starts exactly as before, so nothing changes until someone sends a command. The stored session settings are kept by the update.

KMK139 probes shipped with v5.x firmware used ANSI speeds on switch positions 1 - 3 (4800, 9600 and 19200 baud 8N1). The ANSI2 variant of v6.x keeps this layout (Chapter 4.2): update a KMK139 with its ANSI2 file. With the standard file, positions 1 and 2 become IEC auto and DLMS auto.

15. Troubleshooting

Start with the probe itself: is it switched on, charged (Chapter 11) and in the working mode the meter needs (Chapter 4)? Then look up what you see below.

15.1 A command is refused

A refusal is 15 (NACK). Right after it, 0xDC tells which command was refused and why (Appendix A.1).

What you seeAfterWhat it meansWhat to do
15 (without 00)a line command (Chapter 5.2.1) or 0xE1The probe is not in command mode.Put it in command mode (Chapter 4).
06 00, then 15 00 a second later0xC3, 0xD0The value byte did not arrive within 1 s.Send the frame and its value in one write (Chapter 6.2.1).
15 00, then a value and 000xD1 - 0xD5No value was sent, so the command was a query. This is normal.Read the value that follows.
15 00 instead of the second 06 000xC3, 0xD0The byte after the frame was 0xFE, which always starts a new frame.Do not start another frame before the value; 254 cannot be set (Chapter 6.2.3).
15 000xD1 - 0xD5The value is outside the allowed range.Use a value listed on the command card (Chapter 7).

15.2 A command gets no answer

  • Check the frame: 12 bytes - FE FE, "BLUE08N1", the command, FF (Chapter 6.1.2). Bytes that are not a complete frame go to the meter.
  • While a firmware update runs, the probe answers only 0xA0, 0xDA, 0xDB and 0xDC; other commands get no answer until the update ends.
  • While abcZ reads or writes the settings of the wireless module (Chapter 12.2.3), the probe answers no other command until that is finished.
  • A command the product does not have gets no answer - a dash in the table of Chapter 7, for example 0xD1 on a KMK118 or 0xD5 on a KMK119.
  • After a command that restarts the probe, close the port and open it again (Chapter 6.3.2).
  • A probe with firmware v5.x does not answer commands in the automatic IEC and DLMS modes (Chapter 6.1.1).

15.3 Readings fail or data is garbled

Check that the optical head sits flat on the meter's optical port and that the working mode and line suit the meter (Chapter 4, Chapter 5). Then adjust the optical sensitivity with 0xD0 - a higher value is more sensitive: raise it one step at a time for a meter with a weak optical output, such as a battery-powered meter; lower it one step at a time when bytes arrive doubled because of reflection. On a KMK119 keep it at 85 (0x55) or below. Try a reading after each step, and store the value that works with 0xE0.

If the end of a transfer does not reach the meter, your software may close the connection too early: see Chapter 6.4.

15.4 Frequently seen

What you seeWhat to do
Windows lists the probe twice when you pair it.One entry is the Bluetooth serial port, the other BLE. Pair the serial port entry and use its Outgoing COM port (Chapter 3.1).
The COM port does not open the first time.Open it again - the first open of a Bluetooth COM port on Windows can time out (Chapter 6.5).
A line setting is gone after reconnecting.At every new connection the probe applies the stored line settings; store yours with 0xE0 (Chapter 5.2.2).
ZRobo shows "The probe refused it: not in command mode right now".ZRobo's Bluetooth REDZ command mode is on while the probe is in an automatic mode; turn the setting off (Chapter 13.2.2).
A reply appears inside the meter data.A command was sent during a meter transfer; send commands between readings (Chapter 6.4).
The battery reads full, but the probe soon switches off.The reading is taken after the regulator; charge the probe (Chapter 11.2).
The probe switched itself off while connected.A connected probe without any traffic switches off after about 11 minutes (Chapter 11.3).
abcZ skips a probe in a firmware update.Its battery is below 3100 mV: charge it and start again (Chapter 10.1.2).
After an interrupted update the probe does not answer and its red LED blinks.It waits in its bootloader, also after a power cycle: switch it off and on, then load it again as a forced load without reading it in between (Chapter 10.4.2).
A KMK139 reads differently after an update.It runs the standard variant: switch positions 1 and 2 are IEC auto and DLMS auto. Load its ANSI2 file (Chapter 10.1.1) or send 0xD1 with 6 (Chapter 4.2, Chapter 14.2.2).
The name from 0xA0 differs from the firmware file name.Characters c2 - c5 show the live state; only the version and the date must match (Chapter 8.1).

Appendix A - Replies, refusals and stored settings

A.1 Refusal reasons

After a refusal (15), 0xDC returns the command code and one of these reason codes. Some reasons come from service commands (firmware update, module configuration).

ReasonMeaning
1The probe has the legacy bootloader, so a staged update is not possible.
2A module configuration window is open.
3The meter is sending. The command needs 200 ms of silence on the optical line.
4The battery is below 3100 mV.
5No update session is open.
6Update trigger without arming, outside the power-on window.
7The parameter byte did not arrive within 1 s.
80xFE was sent as a parameter. 0xFE always starts a new frame.
9The parameter value is out of range.
10The command works only in command mode.
11A module setting was refused (queue full, mixed queue, unknown setting or value not allowed).
12The update image was refused (wrong product or size).
13Update packets out of sequence, or the image check failed.
14The update cannot be resumed from that position.
15An update session is already open.

A.2 Status bytes

ByteNameMeaning
06ACKCommand accepted
15NACKCommand refused - ask 0xDC why
00endEnd of a text reply
11XONFirmware update packet accepted

A.3 Stored settings

Bytes 0 - 4 are session settings: they change in RAM and survive a power cycle only after 0xE0. Bytes 5 - 9 are written at once by their own command and are kept by a factory reset (Chapter 9).

ByteSettingRangeFactory valueSet withKept by
0Sleep enabled0 or 10 (disabled) on a freshly programmed unit; 0xE1 sets 1 (enabled)0xA2 disables it0xE0
1Auto power-off seconds0-254 seconds, 255 = disabled240 s0xC30xE0
2Optical sensitivity0-25530 (new sensor) / 49 (old sensor)0xD00xE0
3Power-on baud code0x30-0x380x30 (300 baud)0x30-0x38 in command mode0xE0
4Power-on framing code0x40-0x440x40 (7E1)0x40-0x44 in command mode0xE0
5KMK118 device function0-3, 0xFF = use the image default0xFF (unwritten)0xD5written immediately
6DLMS start framing0 = 7E1, 1 = 8N1, 0xFF = default0xFF (unwritten, means 7E1)0xD4written immediately
7IEC baud change-over mode0 = mode C, 1 = mode E, 0xFF = default0xFF (unwritten, means mode C)0xD3written immediately
8KMK119 switch position 3 config0-4, 0xFF = default0xFF (unwritten, means 9600 8N1)0xD2written immediately
9KMK119 device variant0-6, 0xFF = use the image default0xFF (unwritten)0xD1written immediately

Appendix B - Service information

For service and production. Your own software does not need these.

B.1 Dump, counters and stored bytes

B.1.1 Settings dump fields 12 - 32

Continues the field list of 0xDA.

FieldMeaningTypical
12Frame parser position (normally 12)12
13Meter-side transmit buffer fill, bytes0
14Auto power-off hold bit mask: 1 update session, 2 armed trigger, 4 module configuration0
15Last auto power-off restart source: 1 update session, 2 armed trigger, 3 module configuration, 4 link activity; 0 never4
16Update session idle timeout, s45
17Firmware update trigger arm window, s30
18Module guard status: 0 settings found correct at the end of the round (field 27 contains 4 if a repair was written first and a full re-read then confirmed it) or no round yet this power cycle, 1 restored and verified, 2 stopped after three failures, 3 no confirmed result - field 20 tells why0
19Module guard attempt counter (kept over power cycles; 3 = stop)0
20Module guard stop reason, meaningful when field 18 is 2 or 3: 0 none, 1 read came back empty or no fix could be worked out, 2 verify read empty, 3 cancelled by a link, 4 verify blocked by a link, 5 attempt brake, 6 settings still wrong after the repair (counted in field 19), 7 read came back with fields missing0
21Last module guard phase opened (can read 0 after a completed round - use field 27)0
22Module guard policy: 0 disabled, 1 run once (default), 255 every power-up1
23Module guard completed flag (kept over power cycles)1
24Last matched module event (KMK179 only; 0 on Bluetooth)0
25Module guard phase now: 0 none, 1 read, 2 write, 3 verify (round running), 4 round closed0
26WiFi module recovery reset counter (KMK179 only; 0 on Bluetooth)0
27Bit mask of every module guard phase opened this power cycle0
28Module status lines found nested at the module-UART input (saturates at 255)0
29Module status lines seen in total (saturates)0
30Last self-recovery reason: 0 none, 1 join failed or BSS lost, 2 fast latch recovery, 3 silence recovery0
31Sticky bit mask of the gates the latch-recovery trigger saw0
32Peak silence on the module UART, s (saturates at 255)0

B.1.2 Diagnostic counters

Plain queries with no parameter; they work in every mode and are cleared by a restart. Read 0x9D first: every counter is counted since power-up.

CodeMeasuresHealthy value
0x9DSeconds since power-up (stops at 65535)Read it first
0x9CMeter bytes handed to the wireless module since power-upCompare with what your software received
0xA3Peak fill of the meter-side (UART1) TX ring buffer, in bytesBelow the buffer size; used for RAM sizing
0xA4Bytes dropped because the UART1 TX ring was fullMust stay 0
0xA5Cause of the last reset (0 = software / 7 = watchdog / 12 = power-on)12 after a power cycle, 0 after a settings write
0xA6UART1 (meter) hardware receive overrun (OERR) counterMust stay 0
0xA7Worst-case main-loop iteration time in millisecondsA few ms; blocking waits are excluded
0xA8Bytes dropped from the UART1 (meter) receive ringMust stay 0
0xAAPeak fill of the UART1 (meter) receive ringWell below buffer size
0xABHow many times back-pressure was applied towards the phone/PCMay be non-zero on long uploads; not an error
0xACUART2 (Bluetooth) transmit buffer "full" counterMust stay 0; if not, the TX buffer is too small
0xADBytes dropped from the Bluetooth receive ring - this is where phone-to-meter data loss is countedMust stay 0 up to the guaranteed burst size
0xAEPeak fill of the Bluetooth receive ringBelow buffer size
0xAFUART2 (Bluetooth) hardware receive overrun counterMust stay 0
0x9FPeak fill of the UART2 (Bluetooth) TRANSMIT buffer - the companion of 0xAC: 0xAC says WHETHER it ever filled up, 0x9F says HOW FULL it got. Sampled from the main loop, so the value is a LOWER BOUND; a peak that occurs and drains between two loop turns is not seen. The completely-full end (buffer size) may read back as 0 - that end is what 0xAC countsWell below the buffer size; judge it together with 0xAC

B.1.3 Stored bytes 10 - 13

Continues Appendix A.3. Written by the probe itself; do not write them. Bytes from 14 on hold internal copies (module type, and on the KMK179 a pending module reset and the module address).

ByteMeaningProgrammed value0xDA
10Out-of-production trace: 1 = the wireless module was factory-reset (0xBC) and not reconfigured since; 0xFF = clear0xFFfield 10
11Module guard attempt counter (3 = stop)0field 19
12Module guard policy: 0 disabled, 1 run once, 0xFF every power-up1field 22
13Module guard completed flag: 0xA5 = completed0xFFfield 23

B.2 The legacy bootloader

B.2.1 Returning to v5.x firmware

A v6.x probe with the legacy bootloader (name character c5 = 0) accepts a legacy firmware load at any time, without a power cycle, so the service tools can load a v5.x file directly. The stored settings in bytes 0 - 4 are kept; v5.x does not use bytes 5 and higher, and they are still there when v6.x is loaded again. Measured on a KMK118. For a probe with the A/B bootloader (c5 = 1), contact us before loading v5.x.

B.2.2 A probe that stays in the legacy bootloader

StateHow it got thereWhat it doesWhat to do
Timed outan update trigger with no image after itreturns to the normal firmware after 10 snothing - reconnect
Waitingat power-up, or after an unfinished loadwaits and accepts an imagestart the load again
Latchedan update trigger that was not followed at once by the imageanswers every byte with 13 11 (XOFF XON) and accepts nothingswitch off and on, and start the load again at once - it usually clears

To tell them apart, send the 0xA0 frame: an answer means the normal firmware runs. If there is none, send about 150 bytes of 00: no answer = waiting, pairs of 13 11 = latched. A legacy load must run from the trigger to the last packet in one go: do not close the port or send anything else in between.

B.3 Engineering changes from v5.x to v6.x

Topicv5.xv6.x
Watchdog resetoffon (about 2 s); 0xA5 tells the cause of the last reset
Module status linescould leak into the meter dataabsorbed by the probe
Burst from your software to the meternot guaranteedbuffered with back-pressure; about 2.4 kB (BT v4.1 models) and 2.5 kB or more (BT v5.1 models) measured without loss
Module setting valuesnot available - module settings needed a service probechecked against the values the module accepts (0xDB bit 4096)
Diagnostic countersnoneAppendix B.1.2
0xDA field 10-cleared only by a real module write (v6.2; v6.0 - v6.1: also by a module guard round)
Module guard-runs once after a module factory event, not at every power-up (v6.1)