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

KMK179 - Wifi Optical Probe User Manual

1. Introduction

The KMK179 connects the optical port of a meter to your software over Wi-Fi, on one TCP connection. 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, KMK179, Wi-Fi link to PC on your network

Figure 1.1 - From the meter to your software

1.1 The products

ProductOptical headBoardWorking mode chosen with
KMK179KMK179 optical head: IEC 62056-21
IEC 62056-21
KMK119 board with a Wi-Fi modulethe mode switch

The KMK179 is the Wi-Fi member of the family. The hardware is shown in Chapter 2; how it 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.4).

1.2 This manual

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

2. Hardware Overview

The KMK179 is built on the KMK119 board, with a Wi-Fi module in place of the Bluetooth module: it has the same mode switch and an IEC 62056-21 optical head. The working modes are in Chapter 4.

2.1 Front

KMK179 front: power button, charge, link and speed LEDs

Figure 2.1 - KMK179 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.
  • POW. is on while the probe is on.
  • LINK blinks fast while the probe is not on a Wi-Fi network, blinks slowly when it is on the network and no client is connected, and stays on while a client is connected - for example while software has the probe's TCP port open. TX and RX flash when data goes to and comes from the meter.
  • SPEED: MODE 1 - MODE 4 show the switch position (2.2.1).

2.2 Mode switch, USB port and optical head

2.2.1 Mode switch and USB port

KMK179 side views: USB port, mode switches and the switch table printed on the case

Figure 2.2 - KMK179 sides

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

KMK179 optical head: IEC 62056-21

Figure 2.3 - KMK179 optical head (IEC 62056-21)

The KMK179 has an IEC 62056-21 optical head with a flat face that sits on the meter's optical port, and holds on the meter with an N38 magnet.

A KMK179 on the optical port of an IEC meter

Figure 2.4 - KMK179 on the optical port of an IEC meter

2.3 The red LED

The CHARGE LED 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 Wi-Fi

The KMK179 joins your Wi-Fi network and waits for one TCP connection, on port 2015 as it leaves the factory. Commands and meter data travel on that connection (Chapter 6.5); there is no serial port to fall back on.

A new KMK179 first has to learn the name and the password of your network. You give them to it once with abcZ, over the optical port, on the Service port page (Chapter 12.4); from then on the probe joins your network every time it is switched on.

3.1 Is the probe on your network?

Watch the LINK LED: it blinks fast while the probe is not on a network, blinks slowly when it is on the network and no client is connected, and stays on while a client is connected. The probe takes its address from your router (DHCP); you find it in the router's list of clients by its MAC address, which starts with 00:04:3E.

3.2 Try the command channel

Any TCP client that sends bytes given in hex is enough - for example a terminal program such as RealTerm. Connect to the probe's address, port 2015, 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 (0xA1). The frame is explained in Chapter 6.1.2; the same test in Python and C# is in Chapter 6.6.

3.3 Read a meter

Use meter reading software that can open a TCP connection: give it the probe's address and port 2015, and choose the working mode that suits the meter (Chapter 4). For example our ZR meter reading software.

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 KMK179

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

4.1 KMK179 - 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.

PositionLEDWorking modeWhat the optical line doesOptions
1MODE 1IEC 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
2MODE 2DLMS 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

The table describes the standard firmware variant; other variants are project-specific. The variant is stored in the probe and changed only with 0xD1: loading a different firmware image does not change it.

KMK179 is the KMK119 board with a WiFi module: the switch, the LEDs and the modes are the same.

4.2 Reaching command mode

ProductHow
KMK179Switch 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 lineswitch position 3: set with 0xD2, default 9600 baud 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

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 WiFi TCP connection; 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. The legacy firmware of the KMK179 takes commands in command mode (switch position 4).

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 - 0xD4)

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. 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 - 0xD4 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:

  • open a NEW TCP connection before the next command - the old socket can stay open, but do not rely on it;
  • send 0xA2 again if your job needs it (6.4).

6.4 A good session

  1. Open the connection (TCP port 2015).
  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.

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

Commands and meter data travel on one TCP connection to the probe, port 2015 (production setting). There is no serial profile to fall back on: a probe that is not on your network cannot be reached.

The WiFi module drops an association after about 120 s without traffic and joins again later: keep some traffic on the link, and reopen the socket before you call it a fault. A reply can arrive several seconds late, because the module may hold its delivery; allow about 10 s before you treat a command as unanswered.

6.6 Code examples

Both examples read the name, the battery and two settings, then set the sensitivity. Both examples were run on a KMK179 with firmware v6.4 290926 (only the address changed); adjust the address.

6.6.1 Python

"""Talk to a KMK179 WiFi optical probe from Python over its TCP connection."""
import socket
import time

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


def command(sock, code, param=None, wait=3.0):
    """Send one command frame (and an optional parameter byte); return the raw reply."""
    data = FRAME + bytes([code, 0xFF])
    if param is not None:
        data += bytes([param])              # the parameter goes in the same write
    sock.sendall(data)
    reply = b""
    end = time.monotonic() + wait           # the WiFi module can hold a reply for a few seconds
    while time.monotonic() < end:
        try:
            chunk = sock.recv(1024)
        except socket.timeout:
            continue
        if not chunk:
            break                           # the probe closed the connection
        reply += chunk
    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(address="192.168.1.50", port=2015):
    with socket.create_connection((address, port), timeout=5) as probe:
        probe.settimeout(0.1)
        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)

// Talk to a KMK179 WiFi optical probe from C# over its TCP connection.
using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Text;
using System.Threading;

static class ZtTcp
{
    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(NetworkStream link, byte code, int param = -1, int waitMs = 3000)
    {
        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
        link.Write(data.ToArray(), 0, data.Count);
        var reply = new List<byte>();
        var buffer = new byte[1024];
        var end = DateTime.UtcNow.AddMilliseconds(waitMs);   // the WiFi module can hold a reply
        while (DateTime.UtcNow < end)
        {
            while (link.DataAvailable)
            {
                int n = link.Read(buffer, 0, buffer.Length);
                for (int i = 0; i < n; i++)
                    reply.Add(buffer[i]);
            }
            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()
    {
        using (var client = new TcpClient("192.168.1.50", 2015))
        {
            NetworkStream probe = client.GetStream();
            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 legacy firmware" row. Refusal reasons and status bytes are in Appendix A; service commands are in Appendix B.

CodeCommandKMK179Since
0xA0Read the firmware nameYlegacy
0x9ERead the image identityYv6.2
0xDARead all settingsYv6.2
0xDBRead the capabilitiesYv6.2
0xDCWhy was it refused?Yv6.2
0x30 - 0x38Set the line speedClegacy
0x40 - 0x44Set the data formatClegacy
0x50 - 0x51Break on / offClegacy
0xA1Read the battery voltageYlegacy
0xA9Read the battery chargeYv6.2
0xA2Keep the probe awakeYlegacy
0xC2Switch offYlegacy
0xC3Set the auto power-off timeYlegacy
0xD0Set the optical sensitivityYlegacy
0xD1Select the firmware variantYv6.2
0xD2Switch position 3 line settingsYv6.2
0xD3IEC baud change-over modeYv6.2
0xD4DLMS start framingYv6.2
0xE0Store the settingsYlegacy
0xE1Factory resetClegacy
0xBDRestart the wireless moduleYv6.2
0xBCFactory-reset the wireless moduleYv6.2

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

7.1.1 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.

ProductsKMK179
FirmwareLegacy firmware and v6.x
Works inEvery working mode
SendFE FE 42 4C 55 45 30 38 4E 31 A0 FF
ReplyASCII text, then 00. Example: "N70221134 v6.4 290926".
On legacy firmwareAvailable. It answers a free-text name, for example CC_WF52_v6.0 280722 - that version number is not a v6.x version.

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 (the legacy firmware has no name code)fixed
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.

7.1.2 0x9E — Read the image identity

Read the build identity of the running firmware image.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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.

7.1.3 0xDA — Read all settings

Read every setting in one reply.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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.

7.1.4 0xDB — Read the capabilities

Ask which features this firmware image has.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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)

7.1.5 0xDC — Why was it refused?

Ask why the last command was refused (NACK).

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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: "210,9" = command 0xD2, 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

7.2.1 0x30 - 0x38 — Set the line speed

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

ProductsKMK179
FirmwareLegacy firmware 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.x)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On legacy firmwareAvailable.

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).

7.2.2 0x40 - 0x44 — Set the data format

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

ProductsKMK179
FirmwareLegacy firmware and v6.x (0x44 from v6.2)
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.x)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On legacy firmwareAvailable, except 0x44.

7.2.3 0x50 - 0x51 — Break on / off

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

ProductsKMK179
FirmwareLegacy firmware 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.x)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On legacy firmwareAvailable.

NOTE:

For meters that need a break condition before a session.

7.3 Power and battery

7.3.1 0xA1 — Read the battery voltage

Read the battery voltage in millivolts.

ProductsKMK179
FirmwareLegacy firmware 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 legacy firmwareAvailable.

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.

7.3.2 0xA9 — Read the battery charge

Read the battery charge as a percentage.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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.

7.3.3 0xA2 — Keep the probe awake

Stop the probe from entering its low-power sleep.

ProductsKMK179
FirmwareLegacy firmware 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 legacy firmwareAvailable.

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.

7.3.4 0xC2 — Switch off

Switch the probe off, as with the power button.

ProductsKMK179
FirmwareLegacy firmware 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 legacy firmwareAvailable.

7.3.5 0xC3 — Set the auto power-off time

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

WARNING:

Do not store 0 or a short time with 0xE0: at power-up the probe would switch itself off before a client can connect.

ProductsKMK179
FirmwareLegacy firmware 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.x)No parameter within 1 s: 15 00 and nothing changes.
StoredRAM only - send 0xE0 to keep it after a power cycle.
On legacy firmwareAvailable. Factory value 254 s.

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

7.4.1 0xD0 — Set the optical sensitivity

Set the sensitivity of the optical receiver.

ProductsKMK179
FirmwareLegacy firmware 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.x)No value within 1 s: 15 00 and nothing changes.
StoredRAM only - send 0xE0 to keep it after a power cycle.
On legacy firmwareAvailable. Factory value 26.

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

7.5.1 0xD1 — Select the firmware variant

Select the firmware variant on KMK119 / KMK139 / KMK179.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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
  • 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.

7.5.2 0xD2 — Switch position 3 line settings

Choose the line settings of switch position 3.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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.

7.5.3 0xD3 — IEC baud change-over mode

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

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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.

7.5.4 0xD4 — DLMS start framing

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

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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

7.6.1 0xE0 — Store the settings

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

ProductsKMK179
FirmwareLegacy firmware 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 legacy firmwareAvailable.

NOTE:

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

7.6.2 0xE1 — Factory reset

Restore and store the factory settings.

ProductsKMK179
FirmwareLegacy firmware 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.x)Outside command mode: 15 (NACK), reason 10 - Appendix A.1.
On legacy firmwareAvailable. It restored an auto power-off of 254 s and sensitivity 26.

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 - 0xD4).

7.7 Wireless module

7.7.1 0xBD — Restart the wireless module

Restart the Bluetooth or WiFi module of the probe.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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:

Reconnect when the probe is back on the network (LINK LED blinking slowly). Useful when the connection is up but data no longer passes.

7.7.2 0xBC — Factory-reset the wireless module

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

WARNING:

This takes the probe OFF your network and keeps it off: the module goes back to its own network name ("Amped AP") and to UDP, so no TCP connection comes back. The reset is applied at the next power-up. Use it only when you can reach the probe over the optical service line to write the network settings back.

ProductsKMK179
FirmwareFrom v6.2 - not in the legacy firmware
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"N70221134 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"210,9"reason codes

8.1 Reading the firmware name

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

CharValueMeans
c0Ncurrent optical sensor
c17KMK179
c20standard variant
c32DLMS start 7E1
c42IEC mode C
c51A/B bootloader
c61staged update supported
c73firmware v6.x
c84WiFi module

The legacy firmware of the KMK179 answers with a free-text name instead, for example CC_WF52_v6.0 280722. That version number is not a v6.x version: KMK179 firmware v6.x starts at v6.2 and always has the nine-character code.

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 (the legacy firmware) 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 formatDLMS start framing, IEC change-over mode, switch position 3 line, variant
Stored bytes0 - 45 - 9
Changed by0xA2, 0xC3, 0xD0, line commands - in RAM, at once0xD1 - 0xD4 - 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 a KMK179 with abcZ on a Windows PC, over Wi-Fi (section 10.2). A KMK179 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. It has no other update path. A KMK179 with the legacy firmware cannot be moved to v6.x over the air: its first v6.x firmware is loaded with a programmer (Chapter 14.2.1).

10.1 Before you update

10.1.1 Which file

Choosing the update file: a KMK179 with firmware v6.x takes the _OTA.bin; the legacy firmware needs a programmer

Figure 10.1 - Which file for which KMK179

For each firmware image the KMK179 package has an _OTA.bin, which abcZ loads over Wi-Fi as a staged update: the probe keeps running its firmware until the new one is complete and checked. Every KMK179 with firmware v6.x has the A/B bootloader, so there is no _LEGACY.bin.

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 refuses a file made for another model. Loading a firmware image does not change a stored working mode or variant (Chapter 4).

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.

10.2 Update with abcZ (Windows)

Open the probe in abcZ (Chapter 12.1) and choose the Firmware page. 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).
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 model (shown with a KMK119)Figure 10.3 - Choose a .bin: the _OTA.bin file for the model (shown with a KMK119)
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 image (shown with a KMK119)Figure 10.5 - Review before anything is sent (shown with a KMK119)

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 (shown with a KMK119)

10.3 Time and interruptions

10.3.1 How long it takes

LinkUpdateTime for one probe (measured)
Wi-Fi (TCP)staged (_OTA.bin)about 100 - 210 s

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

10.3.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.

10.4 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

The KMK179 has a 1200 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.4 290926 a PC read an IEC meter through the probe every 10 seconds over Wi-Fi (one TCP connection, working mode IEC auto; the meter was simulated): a KMK179 worked about 9 hours on a full charge.

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 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

Under SOURCE choose "Connect by IP address (KMK Wi-Fi)", type the probe's address and port (2015, Chapter 3) and press Connect.

Video - reaching a KMK179 over Wi-Fi with abcZ:

Watch the video at probeformeters.com/download/abcz-kmk179-connect.mp4.

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

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.

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 - 0xD4 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.1 - Settings (shown with a KMK119)

12.2.3 Module

On a KMK179 the page is called Wi-Fi module and shows the probe's Wi-Fi module: its identity and its network settings. Press Read all from the module; where a value differs from our standard, abcZ fills in our standard as the New value, and Write to the module applies it. SSID and PassPhrase are the only fields you can type in normal mode. Check both before you write: with a wrong value the probe cannot join the network and can no longer be reached over Wi-Fi - contact us.

FieldWhat it isOur standard
Hardware, MAC_ADDR, BuildVersionThe module type, its MAC address and its firmware date code.read-only
DeviceNameThe name of the probe on the network.KMK179 and the address
SSIDThe name of the Wi-Fi network the probe joins.your network
PassPhraseThe password of that network.your network
AuthTypeThe network security type.1
DeviceModeSTA: the probe joins your network as a client.STA
AutoJoinTrue: the probe joins the network by itself at power-on.True
IPProtocolTCP: the probe waits for your TCP connection.TCP
LocalPortThe TCP port the probe listens on.2015
DHCPModetrue: the router gives the probe its address.true

When the probe cannot be reached over Wi-Fi - it has never joined a network, or its network settings are wrong - its module is read and written over the optical port instead (Chapter 12.4).

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.2 - Diagnostics, top of the page (shown with a KMK119)

12.3 Update and log

12.3.1 Update the firmware

The Firmware page updates the firmware of the open probe over Wi-Fi. The steps, with the screens, are in Chapter 10.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 Wi-Fi PassPhrase 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 KMK179's Wi-Fi module directly, through a USB optical probe placed face to face with the KMK179's optical port, without the probe's firmware in between. Use it to put a new KMK179 on your network, or one whose network settings are wrong:

  1. Switch the KMK179 off, set the switch to position 3 (Chapter 2.2.1) and switch it on: the module is reached only in mode 3.
  2. Place a USB optical probe face to face with the KMK179's optical port and plug it into the PC. No program may be connected to the KMK179 over the network meanwhile: the module's answers do not reach the optical port then.
  3. On the Service port page choose the PORT - the list shows the plugged-in KMK optical probes, each with its identity -, choose the Wi-Fi module as MODULE and keep the LINE at 9600 8N1, the line of switch position 3 unless you changed it (0xD2). Press Open on the Module page.
  4. abcZ opens the module as a device of its own, on its Module page, and reads it over the optical probe: "... values read over the service port". Type the SSID and the PassPhrase of your network and press Write to the module. abcZ writes them, reads each one back and restarts the module: "... written and read back; the module restarted to use them".
  5. Switch the KMK179 off, set the switch back to the position you work in and switch it on. Its LINK LED blinks slowly when it is on your network (Chapter 3.1).

If the module does not answer, abcZ names the three usual causes: the KMK179 is not in mode 3, the optical probe does not sit face to face with its optical port, or the line speed differs. To change a value once more, press Read all from the module first: abcZ compares what you type with its last reading of the module. For a KMK179 that is open in abcZ over Wi-Fi the page also offers Read on the Module page: the module is then read through the optical probe and written over the probe's own Wi-Fi link.

Video - putting a KMK179 on the network over the service port (the PassPhrase is blurred):

Watch the video at probeformeters.com/download/abcz-kmk179-service-port.mp4.

13. Software - ZRobo 3.0.0 for Android

ZRobo, our free Android app, connects to probes over Bluetooth only. The KMK179 is reached over Wi-Fi, so ZRobo does not connect to it: use ZR meter reading software or your own TCP client (Chapter 6).

14. What's New and Migrating from the Legacy Firmware

This chapter is for anyone who already uses KMK179 probes with the legacy firmware - the firmware that answers 0xA0 with a free-text name such as CC_WF52_v6.0 280722 (Chapter 8.1). KMK179 firmware v6.x starts at v6.2: the v6.0 and v6.1 entries below reached the KMK179 with v6.2. The chapter 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.2 - 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.2 in every working mode.
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 command list of the legacy firmware. Service counters are in Appendix B.1.2; commands used only by service tools are not listed. The "On legacy firmware" row of each card gives the details.

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

14.1.3 What works differently

TopicLegacy firmwarev6.x
Variant (KMK119 family)Each variant was a separate firmware.One firmware; the variant is stored and changed with 0xD1.
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.
CommandsThe commands marked "Yes" in 14.1.2; use command mode (switch position 4).Answered in every working mode; a refusal is 15 and 0xDC tells why.
Starting a firmware updateOnly in a 60 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, for example CC_WF52_v6.0 280722.Every character has a meaning; c2 - c5 show the live state (Chapter 8.1).
Auto power-offFactory 254 s.Factory 240 s; a connected probe without traffic switches itself off after about 11 minutes.

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 legacy probes

A KMK179 with the legacy firmware cannot be moved to v6.x over the air: its old bootloader refuses v6.x images (a safety check), and there is no legacy update file for this product. The first v6.x load needs a programmer; after that, updates run over WiFi.

14.2.2 Compatibility

The first v6.x load of a KMK179 is done with a programmer, which sets the stored settings to the defaults of the loaded image (Chapter 9). Check the working mode and the settings after the load.

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 - 0xD4No 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 - 0xD4The 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.
  • The probe is not on your network: watch its LINK LED (Chapter 3.1).
  • The connection dropped after about two minutes without traffic, or the reply is late: Chapter 6.5.
  • After 0xBC the probe has left your network and cannot be reached over Wi-Fi - contact us.
  • With the legacy firmware, use command mode (switch position 4, 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. Try a reading after each step, and store the value that works with 0xE0.

15.4 Frequently seen

What you seeWhat to do
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).
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).
An update was interrupted.The running firmware is untouched: start the update again (Chapter 10.3.2).
On the Service port page abcZ says "The Wi-Fi module did not answer".Put the KMK179 in mode 3 (switch position 3, then switch it on), place the optical probe face to face with its optical port, keep the line of switch position 3, and close any program that is connected to the KMK179 over the network (Chapter 12.4).
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).
0xA0 answers a free-text name such as CC_WF52_v6.0 280722.That is the legacy firmware, not v6.x (Chapter 14).

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 Returning to the legacy firmware

A KMK179 cannot be returned to the legacy firmware over the air: the v6.x bootloader of this product refuses it, and there is no legacy update path. Returning needs a programmer - contact us.

B.3 Engineering changes from the legacy firmware to v6.x

TopicLegacy firmwarev6.x
Watchdog resetoffon (about 2 s); 0xA5 tells the cause of the last reset
Module setting valuesnot available - module settings needed a service probechecked against the values the module accepts (0xDB bit 4096)
Diagnostic countersnoneAppendix B.1.2
Module guard-runs once after a module factory event, not at every power-up (v6.1)