Operation

Meter data readout and transmission

Tip

Transmitting data is a far more energy consuming operation than reading the meter. For battery operated devices, it is therefore wise to set a larger transmit interval than the report interval to achieve a decent data granularity.

Transmission of meter data

Meter data can be transmitted using either MQTT-SN or LwM2M Send. The protocols cannot be used simultaneously, but it's possible to configure via LwM2M or the Elvaco OTC App. Regardless of the chosen transport protocol, the content of the transmitted data remains the same. When a meter data transmission is scheduled, the data being sent is defined by the chosen message format. If there are any unsent meter data available in the module, they will be transmitted according to the chosen recovery strategy (First in First out (FiFO) or Last in First out (LiFo)).

Meter data transmission using MQTT-SN

When using MQTT-SN, meter data messages are published to a MQTT-SN topic. Topic can be configured remotely using LwM2M resource 33905/./11, or via the Elvaco OTC App.

Meter data transmission using LwM2M Send

When using LwM2M Send as the protocol for meter data transfer, the data is published to the LwM2M object 33911.

Time handling

The module relies on the meter’s clock for keeping time. Time in the meter is assumed to be in standard local time (no DST). When synchronizing time in the meter using the Elvaco OTC App, local standard time is always used, even if DST is in effect. The timestamped meter data sent from the module can be adjusted to be sent in UTC by specifying the “UTC offset” configuration parameter. The UTC offset will be subtracted from the timestamp prior to transmission. If the meter is in Sweden, which uses CET (Central European Time), it should have UTC offset set to +60 (+1h). In this case at time 12.00 a telegram is sent with timestamp 11.00 as this is the corresponding UTC time. A meter in New York (USA) should have a UTC offset of "-300" (-5h) etc. A UTC offset of "0" means the meter time is used as-is.

If the meter is set to use DST this is ignored by the module and the standard time is used. Thus, the time on the meter’s display may not match the time in the telegram or in the Elvaco OTC App.

Synchronization

All schedules are based on a synchronization with a clock. This indicates that if a readout schedule of 60 minutes is used, it is synchronized on top of the hour, so 11:00, 12:00, 13:00 etc. 120 minutes will give 12:00, 14:00, 16:00 etc. When time in the module (or meter) is synchronized, a rescheduling takes place such that the next meter readout is made according to an updated time. Synchronization of the meter clock can be done in various ways, either periodically (automatically) or manually. It is recommended using a periodic approach to avoid the risk of letting the clock drift too much.

Periodic synchronization options
  • Network time (default setting)
  • NTP (Network Time Protocol)
Manual synchronization options
  • Over NFC using Elvaco OTC App
  • Over LwM2M using resource 3/./13
  • Setting the meter clock in the meter

To handle the case where time synchronization “moves time” past a previously planned readout (like 23.58 → 00.02) the module will always make a readout and transmission of a new value when time is synchronized. The device will, therefore, send an additional readout which can be masked on the server side.

Randomized transmissions

In order to prevent a large population of devices from transmitting data at exactly the same time the devices have a random delay before transmitting data. The delay is configurable via either the Elvaco OTC App and the NFC interface, or remotely via a device management system.

Readouts from the meter are always performed on top of the hour, 11.00, 13.00 etc. Transmissions can be carried out at other times but are planned at full hours given a set transmission interval (Ttransmit). The figure below illustrates this. The transmissions are planned at time T1. The actual Ttransmit is a random time between (T1 + Toffset) and (T1 + Toffset + Tdelay).

Ttransmit, Toffset and Tdelay are parameters in the product.

Conditions

  • Toffset + Tdelay <= Ttransmit

This should be checked by the device and the OTC App.

  • If Ttransmit is reduced below Toffset + Tdelay , then Toffset should be set to 0 and Tdelay = Ttransmit.
CMi61-serie_Transmission_ conditions

Data retransmission

If data cannot be sent, due for instance to network issues, there will be a number of retries after which the device will give up and leave the readout as “unsent” in its storage. Next time a transmission is attempted unsent data will be resent (if possible). Retransmission can be done by FIFO or LIFO.

Rules for retransmissions include maximum age of data, order of data, number of retransmitted data / transmission interval.

Example 10. Example 1

A device is configured the following way:

  • Message encoding: M-Bus
  • Auto upload order: FIFO
  • Measurement interval: 60 minutes
  • Transmit interval: 60 minutes
  • Transmit offset: 15 minutes
  • Transmit delay: 30 minutes
  • Maximum uploads per transmission: 4
  • Upload maximum age 72h

A network issue caused the module to be offline for 5 days, while still reading and storing measurement data. When the device manages to go online the following scenario takes place.

  • The device will start by transmitting measurement data that is 3 days old (FIFO order)
  • The device will send 4 measurement telegrams per hour, at a randomly chosen time between minute 15 and 45
  • Each telegram contains a single readout, totaling 4 readouts per transmission
  • The device will take approximately 1 day to “catch up” and start sending one measurement per hour


 

Example 11. Example 2

A device is configured the following way:

  • Message encoding: SenML/CBOR/M-Bus
  • Auto upload order: FIFO
  • Measurement interval: 60 minutes
  • Transmit interval: 60 minutes
  • Transmit offset: 15 minutes
  • Transmit delay: 30 minutes
  • Maximum uploads per transmission: 4
  • Upload maximum age 72h
  • Device max payload size: 12 (readouts per telegram)

A network issue caused the module to be offline for 5 days, while still reading and storing measurement data. When the device manages to go online the following scenario takes place.

  • The device will start by transmitting measurement data that is 3 days old (FIFO order)
  • The device will send 4 measurement telegrams per hour, at a randomly chosen time between minute 15 and 45
  • Each telegram contains 12 meter readouts, totaling 4 x 12 = 48 readouts per transmission
  • The device will take approximately 2 hours to “catch up” and start sending one measurement per hour


 

Measurement mode

CMi6160 can be run in two different modes, meter-controlled or module-controlled. The choice of mode will give different options on what data to send from the module. To change between the modes, see LwM2M Object 'Elvaco MCM Config' (Object ID 33906, resource 68). In meter-controlled mode, the payload is set depending on the settings in the meter. When using module-controlled payload, settings controlled by the module will dictate what data are sent.

Meter-controlled: Transparent

If using meter-controlled mode, the customer-defined telegram, as specified in the Diehl SHARKY or SCYLAR meter, is sent transparently without modification. Typically, this telegram is preconfigured in the meter at delivery but can also be adjusted in the field. When using this mode, message encoding is automatically set to SenML/CBOR to accommodate larger customer-defined telegrams. Since the protocol used in Diehl SHARKY and SCYLAR is M-Bus, the payload delivered in the SenML/CBOR packages will also be in M-Bus format

Module-controlled: Preset

In the module-controlled mode, the data sent depends on the selected message format. CMi6160 has two different message formats to choose from, Standard and Tariff. See section Message formats for a complete list of included records in each format.

Meter alarm monitor

Transmission of meter alarms

Meter alarms are transmitted using the chosen transport protocol, which can be either MQTT-SN or LwM2M Send. Regardless of the chosen transport protocol, the content of the transmitted data remains the same. When an alarm is triggered, the message follows the selected format, with Extended Error Codes appended to it. If there are any unsent meter data available in the module, they will be transmitted simultaneously with the alarm.

Meter alarm transmission using MQTT-SN

When using MQTT-SN, alarm messages are published on a separate topic, apart from the ordinary meter data delivery. The alarm topic is configurable via LwM2M resource 33906/./67.

Meter alarm transmission using LwM2M Send

When using LwM2M Send, the alarm messages are published on an own instance of the meter data object 33911.

Managing the alarm bitmasks

Each bit in the alarm mask is directly mapped to a meter error. The different alarm masks used for controlling the alarm monitor have the same mapping. The sections below describe how each bitmask should be managed and interpreted.

Alarm functionality enable bitmask

Monitoring an alarm is enabled by setting the bit to high (1), while keeping the alarm silent (i.e., preventing alarm messages from being triggered) is done by setting the bit to low (0). Below table gives some examples on how the bitmask can be set to achieve different behaviour.

Table 112. Examples of Alarm functionality enable bitmasks

Binary Hex Interpretation
0b1111 1111 1111 1111 0xFFFF All alarms are monitored
0b0 0x0 No alarms are monitored.
0b0001 1100 0001 0x1C1 Alarm bits 0, 6, 7, and 8 are monitored.


 

Alarm auto reset mask

In practical means, the Alarm auto reset mask makes it possible to re-trigger on a meter alarm that has been reset (e.g. due to natural reset, i.e. the meter has healed or been repaired, or thanks to a manual reset). If not enabling any alarms in the Alarm auto reset mask, a specific alarm will only be sent maximum twice during the lifetime of the module (once while set, and once while possibly reset). Choosing what alarms that automatically should be reset is handled in the same way as the alarm functionality enable bitmask.

Table 113. Examples of Alarm auto reset mask and Alarm reset bitmasks

Binary Hex Interpretation
0b1111 1111 1111 1111 0xFFFF All alarms in the alarm mask are reset.
0b0 0x0 No alarms in the alarm mask are reset (not interesting wanting to manually resetting the alarm mask).
0b0001 1100 0001 0x1C1 Alarm bits 0, 6, 7, and 8 are reset once the hysteresis criteria is fulfilled.


 

Alarm reset bitmask

A manual reset can take place any point in time, allowing the module to trigger on meter alarms again. Choosing what alarms that should be manually reset is handled in the same way as the alarm functionality enable bitmask.

Table 114. Alarm reset bitmasks

Binary Hex Interpretation
0b1111 1111 1111 1111 0xFFFF All alarms in the alarm mask are reset.
0b0 0x0 No alarms in the alarm mask are reset (not interesting wanting to manually resetting the alarm mask).
0b0001 1100 0001 0x1C1 Alarm bits 0, 6, 7, and 8 are reset.


 

Meter error interpretation

The table below specifies available meter errors and how they are mapped to the bitmask.

Meter alarm payload example

Using message format Tariff, a typical payload can look like:

04139C2E0000023B0000325A0000325E0000841006000000008420FD320000000001FD1750

If the same payload is sent as an alarm message, the extended error codes will be appended to the payload:

04139C2E0000023B0000325A0000325E0000841006000000008420FD320000000001FD175002FD180800

The extended meter codes are identified by the M-Bus DIF/VIF 2FD18, Error Mask, and is here followed by the two error bytes 0x0800. Since M-Bus is encoded using little endian, the resulting complete error mask is 0b0000 0000 0000 1000. This means error bit 3 is set, indicating there is some issue with the temperature measurements (see meter error interpretation table).

Module system log

Throughout the module's lifetime, various events may be of interest to log, for example, to analyze its behavior and overall health status. The built-in system log can be configured to store and report such events based on their criticality.

There are two settings available to control the behavior of the system log: Syslog storage level and Syslog auto-upload level. The storage level determines which events should be logged and stored in the module, while the auto-upload level defines which events should automatically be sent from the module, depending on their criticality. This allows storing critical events without necessarily sending them, helping to reduce data traffic or power consumption. New system log entries, with appropriate logging level, will be sent together with the subsequent meter data delivery.

Note

For a complete reference to LwM2M resources related to the module system log, see LwM2M Object 'Elvaco Syslog Config' (Object ID: 33918).

Below tables list what logging levels there are, and the implemented events that can be logged.

Table 116. Supported logging levels

Log level Log level name Description Remark
0 DEBUG Used for debugging unexpected device or server behavior. During normal operation, it's recommended not storing nor sending debug events.
1 INFO Informational, normal events
2 NOTICE Normal operation notifications
3 WARNING Warning logs
4 ERROR Error logs
5 CRITICAL Critical error logs
Varies Varies Log level determined based on the content of the log entry. Varying log level used e.g. for configuration changes. Some changes might be more or less sensitive. More sensitive log entries will get a higher logging level.


 

The table below lists all entries that can be logged in the device. The column to the right declares whether the system log entry origins from a configuration change or not. Apart from the log level, this categorization can be helpful when interpreting the logs on the receiving server.

Table 117. Supported log elements and corresponding log level

Entry Log data Log level Is configuration change
Product activation Reason for activation (button (if applicable), NFC, Activation at flow etc) NOTICE NO
Successful timesync INFO NO
Unsuccessful time sync Failed time synchronizations WARNING NO
Modem restarts INFO NO
Successful connections to Bootstrap, DM, MDM INFO NO
Failed connections to Network, Bootstrap, DM, MDM Network rejects, failed DTLS handshakes etc WARNING NO
Startup cause Reason/cause for startup, for example watchdog, brownout, soft-reset (e.g. button, NFC, LwM2M, console). Level may depend on cause. NOTICE NO
Changed SIM Change in ICCID WARNING NO
Successful FW Upgrade
  • Source
  • Target (e.g. main FW or modem FW)
WARNING NO
Unsuccessful FW Upgrade
  • Source
  • Target (e.g. main FW or modem FW)
  • Cause of failure
WARNING NO
Config reset with result
  • Source (NFC, console, DM)
  • Type (factory, stored)
  • Successful/unsuccessful
CRITICAL NO
Unsuccessful NFC writes

Reason for failure

  • Ignoring unrecognized data
  • Wrong product
  • Wrong PAK
  • Missing PAK
WARNING NO
Failed staged settings
  • Bootstrap server URI
  • Radio bands
  • APN mode and Manual APN
  • Manual PLMN
  • Roam Home PLMN Search
  • Log reason for failure
WARNING NO
DeviceEnable Source of activation WARNING YES
DevEUI New and old WARNING YES
NfcCfgOpen WARNING YES
NfcAutoLockEnable WARNING YES
NfcAutoLockTimeout WARNING YES
MessageEncoding INFO YES
MessageType INFO YES
NfcEnabled WARNING YES
NdefUserText1 INFO YES
NdefUserText2 INFO YES
HwModel WARNING YES
ConsoleEnable Log in order to know the current state of the console. WARNING YES
HwRevision WARNING YES
MeterMaxRetries INFO YES
MeterCustomerNo WARNING YES
MeterIdentificationSource INFO YES
TraceLogLevels WARNING YES
ApnMode WARNING YES
ManualApn WARNING YES
BootstrapIp WARNING YES
BootstrapHostName WARNING YES
BootstrapPort WARNING YES
BootstrapSecurityMode WARNING YES
NbIotTimer3412 WARNING YES
NbIotTimer3324 WARNING YES
NbIotEdrx WARNING YES
NbIotEdrxMode WARNING YES
NbIotUsePSM WARNING YES
NbIotRadioBand WARNING YES
MqttSnConnectionMode WARNING YES
MqttSnTopic WARNING YES
LwM2MQueueMode WARNING YES
NbIotTxOffset WARNING YES
NbIotTxDelay WARNING YES
NbIotUploadsPerTx WARNING YES
ManualPlmn WARNING YES
NbIotDtlsMaxRewinds WARNING YES
NbIotDtlsMinTimeout WARNING YES
NbIotDtlsMaxTimeout WARNING YES
NbIotMqttsnCommTimeout WARNING YES
NbIotMqttsnCommAttempts WARNING YES
NbIotMdmCommFailures WARNING YES
NbIotCoapAckTimeout WARNING YES
NbIotCoapMaxRetransmit WARNING YES
NbIotIowaDtlsMinTimeout INFO YES
NbIotIowaDtlsMaxTimeout INFO YES
NbIotIowaCommRetryCount WARNING YES
NbIotIowaCommRetryDelay WARNING YES
NbIotIowaCommSeqRetryCount WARNING YES
NbIotIowaCommSeqRetryDelay WARNING YES
NbIotNwkConnMaxHoldoff WARNING YES
NbIotNwkSearchPeriod WARNING YES
NbIotModemRestartBackoff WARNING YES
NbIotMdmReconnectBackoff WARNING YES
NbIotLwM2MResumeBackoff WARNING YES
NbIotAutoUploadAgeLimit WARNING YES
NbIotAutoUploadOrder WARNING YES
Lwm2mBsUri WARNING YES
Lwm2mBsSecurityMode WARNING YES
Lwm2mUri WARNING YES
Lwm2mSecurityMode WARNING YES
Lwm2mLifetime WARNING YES
MqttsnUri WARNING YES
MqttsnSecurityMode WARNING YES
TimeSyncSource Log the new value. Relevant for determining the quality of the timestamps used in the log WARNING YES
NbIotUploadProtocol WARNING YES
NbIotEnableRai WARNING YES
PowerSource WARNING YES
NbIotAllowedRadioBands WARNING YES
MqttKeepaliveTimeout WARNING YES
LwM2MForcedQueueMode WARNING YES
NbIotRoamHomePlmnSearch WARNING YES
NbIotSyslogLevel WARNING YES
NbIotSyslogMqttSnTopic WARNING YES
NbIotSyslogAutoUploadLevel WARNING YES
NbIotSyslogAutoUploadAgeLimit WARNING YES
NbIotAlarmFuncEnableBitmask WARNING YES
NbIotAlarmMaskResetPeriod WARNING YES
NbIotAlarmHysteresis WARNING YES
NbIotAlarmAutoResetBitmask WARNING YES
NbIotAlarmTxDelayMax WARNING YES
NbIotEmcTestMode WARNING YES
NbIotAlarmMqttSnTopic WARNING YES
MeasurementMode WARNING YES
TxInterval INFO YES
MeterId Log both from and to values. Relevant for tracking meter changes or issues in meter communication. WARNING YES
UTCOffset INFO YES
TimestampRounding INFO YES
ModemConfigured INFO YES
ReadoutInterval INFO YES
ReportInterval INFO YES
Meter data readout DEBUG NO
Meter data transmission DEBUG NO
Found long payload WARNING NO
Meter data readout error Status code WARNING NO
No valid timestamp from meter NOTICE NO
Readout skipped on time change Old and new time NOTICE NO
Performing readout on time change Old and new time INFO NO
Stored [type] credentials for [address] [type] BS, DM etc. [address] server URI NOTICE NO
Unsupported encrypted meter communication ERROR NO


 

Transmission of the system log

The module system log can be transmitted using either MQTT-SN or LwM2M Send. Which one is used depends on the chosen transport protocol for the meter data. Regardless of the choice, the content of the transmitted data remains the same. When a system log entry, having a system log level that is configured to be sent, is stored in the module, it will be sent together with the subsequent meter data transmission. All unsent log entries that are supposed to be sent will be included.

System log transmission using MQTT-SN

When using MQTT-SN, system log entries are sent on a separate topic, apart from the ordinary meter data. The system log topic is configurable via LwM2M resource 33918/./0.

System log transmission using LwM2M Send

When using LwM2M Send, the system log entries are published on an own instance of the meter data object 33911.

Decoding of the system log

Regardless if the system log is sent using MQTT-SN or LwM2M Send, the payload is structured according to the SenML data model and encoded using CBOR. The system log message itself is stored as an ASCII text string inside the SenML record.

To get a complete description on how the SenML/CBOR packages are encoded, see section SenML/CBOR. Below example shows a simplified way to decode a system log message, from the raw payload to a human readable system log message.

  1. Raw payload (reference):

    82A200615602190200A322C11A699337A002020858335B636F6E6669675D204D65746572206964206368616E6765642066726F6D20383537323731363020746F203835373435303430

  2. Decode raw payload (e.g. using https://cbor.me/):

    [{0: "V", 2: 512}, {-3: 1(1771255712), 2: 2, 8: h'5B636F6E6669675D204D65746572206964206368616E6765642066726F6D20383537323731363020746F203835373435303430'}]

  3. Identify the data record in the package:

    5B636F6E6669675D204D65746572206964206368616E6765642066726F6D20383537323731363020746F2038353734353034305B636F6E6E48646C725D204D444D55706C6F61646564

  4. Decode data record as ASCII string:

    [config] Meter id changed from 85727160 to 85745040

Message encoding

The product has three options when it comes to message encoding:

  • M-Bus
  • JSON
  • SenML/CBOR

M-Bus

If using M-Bus as message encoding technique, data will be divided into Data Information Blocks (DIB) that include Data information field (DIF code), Value information field (VIF code) and a data field (DATA) where the actual payload is stored (illustrated in the following image).

M-Bus_DIB_structure_.png

DIB structure

The table below provides detailed examples of how data is encoded when using message encoding M-Bus.

Table 118. Payload, M-Bus encoded message

DIB Field Size Data type Description
1 Date/time 6 bytes INT32

Meter date and time (YY-MM-DD HH:MM)

Mapped to OBIS 9.36

046Dxxxxxxxx

Bit 31-28 = Year-high*

Bit 27-24 = Month

Bit 23-21 = Year-low*

Bit 20-16 = Day

Bit 15 = Summer time flag**

Bit 14-13 = Century

Bit 12-8 = Hour

Bit 7 = Error flag

Bit 6 = Reserved for future use***

Bit 5-0 = Minute

*The year is read by combining the yearhigh and year-low field. For example, year-high = 0010 and year-low = 010 =&gt; year = 0010010

**0 = standard time, 1= daylight-saving time

***0 = timestamp is valid, 1 = timestamp is not valid

2 Meter ID 6 bytes According to M-Bus EN13757- 3 identification field

Meter ID

0C78xxxxxxxx

3 Energy 6-7 bytes INT32

Energy consumption (Wh, J)

0406xxxxxxxx = xxxxxxxx * 0.001 MWh (kWh)

0407xxxxxxxx = xxxxxxxx * 0.01 MWh

04FB00xxxxxxxx = xxxxxxxx * 0.1 MWh

04FB01xxxxxxxx = xxxxxxxx MWh

040Exxxxxxxx = xxxxxxxx * 0.001 GJ (MJ)

040Fxxxxxxxx = xxxxxxxx * 0.01 GJ

04FB08xxxxxxxx = xxxxxxxx * 0.1 GJ

04FB09xxxxxxxx = xxxxxxxx GJ

4 Volume 6 bytes INT32

Volume (m3)

0413xxxxxxxx = xxxxxxxx * 0.001 m3

0414xxxxxxxx = xxxxxxxx * 0.01 m3

0415xxxxxxxx = xxxxxxxx * 0.1 m3

0416xxxxxxxx = xxxxxxxx m3

5 Power 4 bytes INT16

Power (W)

022Bxxxxxx = xxxxxx * 0.001 kW (W)

022Cxxxxxx = xxxxxx * 0.01 kW

022Dxxxxxx = xxxxxx * 0.1 kW

022Exxxxxx = xxxxxx kW

6 Flow 4 bytes INT16

Flow (m3/h)

023Bxxxxxx = xxxxxx * 0.001 m3/h

023Cxxxxxx = xxxxxx * 0.01 m3/h

023Dxxxxxx = xxxxxx * 0.1 m3/h

023Exxxxxx = xxxxxx m3/h

7 Fw temp 4 bytes INT16

Forward temperature (°C)

025Axxxx = xxxx * 0.1 °C

025Bxxxx = xxxx * °C

8 Rt temp 4 bytes INT16

Return temperature (°C)

025Exxxx = xxxx * 0.1 °C

025Fxxxx = xxxx °C

9 Error flags 5 bytes INT16

Error and warning flags

02FD17xxxx

For further information about Error flags, refer to the latest meter’s manual

10

Tariff 1

Energy

7 bytes INT32

Tariff 1 Energy consumption (Wh, J)

841003xxxxxxxx = xxxxxxxx Wh

841003xxxxxxxx = xxxxxxxx * 10 Wh

841003xxxxxxxx = xxxxxxxx * 100 Wh

841003xxxxxxxx = xxxxxxxx kWh

841003xxxxxxxx = xxxxxxxx *10 kWh

841003xxxxxxxx = xxxxxxxx MJ

841003xxxxxxxx = xxxxxxxx * 10 MJ

11

Tariff 2

Energy

7 bytes INT32

Tariff 2 Energy consumption (Wh, J)

842003xxxxxxxx = xxxxxxxx Wh

842003xxxxxxxx = xxxxxxxx * 10 Wh

842003xxxxxxxx = xxxxxxxx * 100 Wh

842003xxxxxxxx = xxxxxxxx kWh

842003xxxxxxxx = xxxxxxxx *10 kWh

842003xxxxxxxx = xxxxxxxx MJ

842003xxxxxxxx = xxxxxxxx * 10 MJ

12

Tariff 3

Energy

7 bytes INT32

Tariff 3 Energy consumption (Wh, J)

843003xxxxxxxx = xxxxxxxx Wh

843003xxxxxxxx = xxxxxxxx * 10 Wh

843003xxxxxxxx = xxxxxxxx * 100 Wh

843003xxxxxxxx = xxxxxxxx kWh

843003xxxxxxxx = xxxxxxxx *10 kWh

843003xxxxxxxx = xxxxxxxx MJ

843003xxxxxxxx = xxxxxxxx * 10 MJ

13 Missing time 6 bytes INT32

3C22xxxxxxxx = xxxxxxxx hours

3C23xxxxxxxx = xxxxxxxx days


 

JSON

When using JSON message encoding, messages sent consist of an object with a list of key – value pairs. Example of the names of each value type and unit are presented in the table below. The values are encoded as numbers or strings and the units are encoded as strings. JSON offers data encoding that is human-readable, at the expense of not being equally compact as e.g. SenML/CBOR.

Table 119. Payload, JSON encoded message

Field JSON key
Meter ID ID
Meter date / time TS
Energy E
Energy unit U
Volume V
Volume unit VU
Power P
Power unit PU
Flow F
Flow unit FU
Forward temperature FT
Forward temperature unit TU
Return temperature RT
Return temperature unit RU
Error flags EF
Tariff 1 Energy T1
Tariff 1 Energy unit U1
Tariff 2 Energy T2
Tariff 2 Energy unit U2
Tariff 3 Energy T3
Tariff 3 Energy unit U3
Missing time MT
Missing time unit MU
Extended information I


 

Example payload, JSON:

{"TS":"2025-08-27T07:36:01Z "," ID":81493511, "E":0, "U":"kWh", "V":0, "VU":"m3", "P":5012, "PU":"W", "F":212, "FU":"l/h", "FT":30.1, "TU":"C", "RT":22.5, "RU": "C", "I":"0x0010", "EF":"0x70"}

SenML/CBOR

For battery-powered devices it is recommended to send several measurements in the same UDP frame to save energy. In order to achieve this, SenML (Sensor Measurement Lists) + CBOR (Concise Binary Object Representation) is used to define a measurement list.

The idea is to send a list of measurements, where the first entry contains the base time for all the readouts (which only need to specify an offset) and the meter id shared by all readouts. The other records in the list may contain fewer readout fields to save space. The format allows sending all the data for every readout, in which case the savings (in bytes) is smaller and lies in that fewer telegrams are sent, some data needs not be transferred for every reading (like meter-id) and timestamps can be handled more efficiently. SenML/CBOR also provides one way to structure lists of readings in an efficient manner.

Elvaco uses SenML/CBOR/M-Bus data representation for transferring meter data in a compact and self-describing manner. The data being transferred is referred to as a pack, containing one record per measurement.

Note

SenML, CBOR and M-Bus are separate standards, this section describes how products can use these three in conjunction for representing multiple measurement values in a compact format suitable for radio transmission over for instance NB-IoT.

Structure of SenML pack

Meter readout data is sent as SenML, i.e., a list (aka array) of readout values (records), encoded using CBOR. Each record is a map of key/value pairs using SenML.

Note

Each product that uses the SenML/CBOR format shall follow the requirements below. In addition, it shall specify the exact contents of the data values included, meter ID format etc. Thus, this specification alone is not sufficient for building a parser for a specific product.

Base Time

Base time is used to set a reference time.

  • Timestamps are always encoded according to SenML (i.e., UNIX time)(SenML label -1 “Base time”, SenML definition of Time field)
  • This value must be included in the first record of the pack
  • All other values have a time value that is added to the base time to define the exact time of the readout
Base Name

Base name is used to represent the MeterID (Meter identification in M-Bus) for products that deliver measurement data for one meter.

  • If base name is used

    • This value MUST be included in the first record of the pack
    • This is represented as a string array (CBOR Major Type 3 - SenML label -2 “Base name”)

      • The product shall specify the exact format for this field, as it may vary depending on what type of “meter” is used. For an M-Bus format it is typically the M-Bus data without DIF/VIF.
    • No name is set for remaining meter readout values, only values belonging to a single meter can be represented in one pack.
  • If readouts to be sent contain different MeterIDs (module moved between meters for instance) they must NOT be sent in the same SenML pack

    • All values within a SenML pack MUST be for the same MeterID
    • The data values SHALL NOT have a name value further specifying the name for each value.
  • Base name SHALL NOT be used for SenML packs that have data for multiple meters. In such cases each record shall contain the MeterID of the meter.
Data values
  • The actual values from the meter can be encoded using multiple methods, such as M-Bus.
  • The first record can also contain a data value field containing more information than the remaining records in the pack. This is to include more information for the first reading and then only a subset of values for the remaining records to save space. (SenML label 8 - “Data value”)
Other values
  • (Base) Unit is not used, since the unit is specified by the M-Bus data
  • An “Encoder Version field” is used in a separate record to define the type and version of the encoded payload data.

Additional records

All records in the SenML pack are expected to contain measurement values. If there is a need for transmitting additional information in the same pack additional records can be added. For such records the name field shall be used by defining a name of at least a single character. In SenML the base name and the name fields are appended to result in the final record name.

The name shall contain at least one character outside [A-F, a-f, 0-9] which signifies non-hexadecimal representation, since meter-id is typically decimal/hexadecimal, and this makes it easier to check the record name for validity. If a parser finds a record with a name field like described above that it does not recognize it shall ignore the record.

The following additional records are currently used:

Record Name field Comment
Encoder Type & Version ”V” This field allows defining versions for the contents of the measurement field.
Extended Error Information "I" This record allows for sending extended information on a measurement, such as error information.
Encoder Type & Versioning

The following table defines allowed encoder types and versions. The information is sent in a special record “Encoder Version field”.

  • This field encapsulates both the encoding of the data and versioning
  • It contains no timestamp
  • It is encoded as a SenML Value
  • It has a Name field with the single letter “V”
  • If, when parsing, an invalid version is encountered the parsing shall stop with an error
  • The value shall be interpreted as an UINT16

    • The first byte is the encoder type and the second is the encoder version, both interpreted as UINT8.

      Example: value 0x0102 means Encoder type 0x01 and Encoder version 0x02.

    • Defined valid encoder types and versions are found in the table below
    • Size of whole record is maximum 7 bytes
  • If record is excluded, encoder type is 0 and encoder version is 0
Encoder Type Encoder Version Data Comment
0 (M-Bus) 0 0x0000

M-Bus encoding of payload data. Each data record contains all DIF/VIF/Values according to M-Bus.

Note that M-Bus uses LSB first byte order for the data and it shall be preserved here as well.

1 (Gateway) 0 0x0100

Gateway for meter data, i.e., data for multiple meters are contained in a single pack. Payload can be of various types depending on the interface used. Example of payload format is unencrypted or encrypted M-Bus data, with additional meta data.

This encoder type is currently not relevant for Elvaco meter connectivity products.

2 (Syslog) 0 0x0200

Syslog data message encoded as an ASCII hex string.

Key 2 indicates Log level. See section covering Module system log for details on the values for each level.

3 (Transparent M-Bus) 0 0x0300 Transparent M-Bus data. The payload contains a full (wired) M-Bus telegram, including both header and CRC. This encoder type is relevant when using the measurement mode meter-controlled Transparent.
Extended Information

This record is used to send extended information that cannot be sent as part of the normal meter readout data. Typical use case is additional error codes from the meter/device.

  • The format of the extended information is specific for the selected encoder. See table below.
  • The detailed interpretation of the information is product specific. For instance error codes for a meter is specific for a particular meter, even though they are encoded using M-Bus.
  • It is encoded as a SenML data Value
  • It has a Name field “I”
  • It shall contain a timestamp

    • The timestamp can be the same as another meter data record and then these two records shall be considered having been taken at the same time.
  • The extended information is an optional record

Encoder type Encoder version Format of extended error information
0 (M-Bus) 0

M-Bus encoding of payload data. Each data record contains all DIF/VIF/Values according to M-Bus.

Note that M-Bus uses LSB first byte order for the data and it shall be preserved here as well.

1 (Gateway) 0 Not relevant for Elvaco meter connectivity modules.
2 (Syslog) 0 Not defined yet
3 (Transparent M-Bus) 0

M-Bus encoding of payload data. Each data record contains all DIF/VIF/Values according to M-Bus.

Note that M-Bus uses LSB first byte order for the data and it shall be preserved here as well.

Example Transparent M-Bus and extended information

Below example shows a data package with two records, the first with Transparent M-Bus data, and the second with extended information, indicated by "I".

1  83                                      # array(3)
2  
3  ** Record for defining encoder and version **
4  
5     A2                      # map(2)
6        00                   # unsigned(0)   ## Key 1: Name
7        61                   # text(1)       ## Value 1:
8           56                # "V"           ## "V" = version
9        02                   # unsigned(2)   ## Key 2: Value
10       19 0300              # unsigned(768) ## Value 2: enc=3, ver=0
11 
12 ** first record of the pack **
13     
14    A2                      # map(2)
15       22                   # negative(2)          ## Key 1: Base Time
16       C1                   # tag(1)               ## Value 1:
17          1A 6835B149       # unsigned(1748349257) ## 2025-05-27T12:28:33+00:00
18       08                   # unsigned(8)          ## Key 2: Data value
19       58 36                # bytes(54)            ## Value 2: M-Bus telegram
20          6830306808007274
21          031961A51140048B
22          0000000C06080000  # Payload data, line breaks added for readbility
23          00046D220C3B350C
24          13377400008C10FD
25          32000000008C2013
26          000000006D16
27 
28 ** second record of the pack, containing extended information **
29 
30    A3                      # map(3)
31       00                   # unsigned(0)          ## Key 1: Name
32       61                   # text(1)              ## Value 1:
33          49                # "I"                  ## "I" = extended information
34       08                   # unsigned(8)          ## Key 2: Data value
35       45                   # bytes(5)             ## Value 2: M-Bus data
36          02FD187000        # "\u0002\xFD\u0018p\u0000"
37       06                   # unsigned(6)          ## Key 3: Timestamp
38       00                   # unsigned(0)          ## Value 3: Relative time 0

Validators

At https://cbor.me/, there's a Validator available for CBOR. Note that it does not understand SenML or M-Bus.

Note

A small bug has been identified in the hex interpretation of negative numbers in the validator. Please have this in mind if using the validator.

Configuration

SenML/CBOR is to be considered a message encoding. It defines how the messages are encoded, but not the actual contents of the messages (which fields from the meter are included). SenML/CBOR/M-Bus is one such encoding, but there could be several based on this SenML/CBOR specification and the encoder version field above defines exactly which type and version is used.

The contents of the message are defined by the message format. The message format sets which fields are to be included in both the first and the subsequent records of the SenML pack.

The number of records included in a pack is set by the readout and transmit intervals. See Scheduling Readouts for more details. If the readout interval is 120 minutes and the transmit interval is 1440 minutes 12 readouts in total will be included.

Message size restrictions

Each product may have different maximum payload sizes in a single telegram. Also depending on configuration (DTLS or not for instance) the net payload size may vary. Therefore, the device shall “fill up” as many telegrams as required to send the data. It is for the user to define a configuration that gives a reasonable tradeoff between power consumption (send fewer telegrams) and functional requirements (much data is sent).

If a device is configured using a Message Format and many readouts the data may not fit in a single telegram. In such cases multiple telegrams shall be sent and each telegram shall be fully self-described, i.e., contain Meter ID, timestamps etc.

Example 1
Parameter Value
Readout interval 60
Transmit interval 1440 (daily)
Message encoding SenML/CBOR/M-Bus version 0
Message format Standard
Max transmissions per day 3

This example results in the transmission of one message per day, containing 24 readings, all with the contents defined in the Standard message format. Data is encoded using SenML/CBOR/M-Bus. Maximum 3 unsent such messages are sent each time (if for some reason the messages were not sent “last time”). So maximum transmitted messages per day is 3 (containing 3x24=72 readings, covering 3 days)

Example 2
Parameter Value
Readout interval 120
Transmit interval 720
Message encoding SenML/CBOR/M-Bus version 0
Message format Tariff
Max transmissions per day 2

This example results in the transmission of one message every 12h, containing 6 readings, all with the content defined in the Tariff message format. Data is encoded using SenML/CBOR/M-Bus. Maximum 2 unsent such messages are sent each time (if for some reason the messages were not sent “last time”), so maximum transmitted messages per day is 4 (containing 4x6=24 readings, covering 2 days).

Security and access control

Table 120. Settings for controlling the local access to the device

LwM2M resource Setting Description
33906/./4 NFC Enabled Boolean. Turns on or off the NFC interface of the device. If disabled, it's not possible to do any local configuration to the device.
33906/./5 NFC Config-locked Boolean. Turn the NFC configuration lock on or off. If enabled, it will not be possible to do any local configuration to the device, unless having the PAK at hands.


 

Automatic NFC configuration lock

Table 121. Settings for controlling the automatic NFC configuration lock

LwM2M resource Setting Description
33906/./71 Enable NFC automatic configuration Lock Boolean. Turn the automatic NFC configuration lock On or Off. If turned on, the configuration lock will be enabled after the Automatic lock timeout has elapsed. The timer is started once the device has been activated.
33906/./72 Automatic NFC configuration lock timeout Time in minutes. Sets the time in minutes before the configuration lock will be enabled upon activation (requires the NFC automatic configuration lock to be enabled).


 

Reset procedures

Rebooting the module

  1. Press and hold the push button for 5-15 seconds.
  2. Release the button when the green LED is lit.
Led_indications_mcm_reboot__switch_off_.png

Switching off the module

  1. Press and hold the push button for 15-20 seconds.
  2. Release the button when the red LED is lit.
Led_indications_mcm_reboot__switch_off_.png

Performing factory reset

By performing a factory reset, the device reverts its settings to factory default. It will also delete all meter data and syslog entries stored in the module. Factory reset can be done either via the Elvaco OTC app, or remotely over LwM2M (resource 3/./5).

Note

Performing a factory reset restores all network and server parameters to their factory defaults. After the reset, the device attempts to bootstrap to Elvaco’s default server using automatic APN detection.

If the SIM card is configured for a private APN only, the device may still register to the NB-IoT network but will not be able to reach Elvaco's bootstrap server. The device will be logically unreachable, and a local re-configuration will be necessary.

Was this article helpful?

0 out of 0 found this helpful
Have more questions? Submit a request

Comments (0 comments)

Article is closed for comments.