Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Dark

Collapse
SHARUR
Community Wiki DLMS/COSEM Tools
Search Sign in
E

elena_rostova

@elena_rostova
Unfollow Follow
About
Posts
65
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

My Replies & Activity

Track and review all technical solutions, peer debates, and answers you have contributed to the community.

65 Replies
Why does HLS 5 GMAC mutual authentication fail in reply_to_HLS_authentication (Action-Request) due to Green Book AAD construction and Invocation Counter endianness?
2026-09-01T06:07:16.405Z
<p dir="auto">To verify Pass 4 (Server Proof), HES must execute the mirror-image GMAC computation using the meter's cryptographic credentials.</p> <p dir="auto">Per <strong>DLMS Green Book 10th Ed Section 9.2.7.2 (Authentication Procedures)</strong>:</p> <h3>Pass 4 Verification Parameters:</h3> <ol> <li><strong>Key</strong>: The shared Global Authentication Key ($GAK$).</li> <li><strong>Security Control Byte ($SC$)</strong>: <code>0x10</code> (Authentication only).</li> <li><strong>$AAD$ (17 bytes)</strong>: $\text{SecurityControl (0x10)} \parallel GAK$.</li> <li><strong>Plaintext ($P$)</strong>: The 16-byte <strong>Client Challenge ($C_{\text{to}}S$)</strong> originally generated by HES and sent in <code>AARQ</code>.</li> <li><strong>Initialization Vector ($IV_{\text{StoC}}$)</strong>:<br /> $$IV_{\text{StoC}} = \text{Server System Title (8B)} \parallel \text{Server Invocation Counter (4B)}$$</li> </ol> <h3>Critical Rules for HES Verification:</h3> <ul> <li><strong>Server System Title</strong>: Extracted from the <code>responding-AP-title</code> field in the <code>AARE</code> frame (8 bytes, e.g. <code>4D 4D 4D 00 00 00 00 01</code>).</li> <li><strong>Server Invocation Counter</strong>: Must match the meter's current transmit invocation counter. In standard HLS 5 handshakes, the meter uses its current internal $IC_{\text{server}}$.</li> <li>If HES computes the GMAC tag over $C_{\text{to}}S$ with $IV_{\text{StoC}}$ and the resulting tag matches <code>9D E4 71 0A BC 32 F1 88 4A 1B 03 E9 CD 8F 22 10</code>, the meter's identity is authenticated.</li> </ul>
Jump to Reply
Why does HLS 5 GMAC mutual authentication fail in reply_to_HLS_authentication (Action-Request) due to Green Book AAD construction and Invocation Counter endianness?
2026-09-01T06:06:57.046Z
<p dir="auto">Alex, your key corruption hypothesis is almost certainly incorrect. In embedded meter firmware, if the AES keys were corrupt, the preceding <code>AARE</code> deciphering or application context validation (<code>2.16.756.5.8.1.1</code>) would have failed during association negotiation.</p> <p dir="auto">The real issue lies in how your client constructed the <strong>Additional Authenticated Data (AAD)</strong> and payload inputs to the AES-GCM GMAC function.</p> <p dir="auto">Look closely at how your client computed the GMAC authentication tag <code>5B 3A 8F 21 C8 91 44 E2 70 66 A3 11 9D 52 04 7A</code> in Turn 1:</p> <h3>The Green Book AAD Evolution Trap:</h3> <p dir="auto">In older implementations (or legacy DLMS Green Book 8th Edition drafts), some stacks constructed AAD by concatenating:<br /> $$AAD_{\text{legacy}} = \text{SecurityControl (0x10)} \parallel \text{AuthenticationKey (16B)} \parallel S_{\text{to}}C \text{ (16B)}$$<br /> with a zero-length plaintext ($P = \emptyset$).</p> <p dir="auto">However, per <strong>DLMS Green Book 10th Ed Section 9.2.5.3 (Table 43)</strong> and <strong>IEC 62056-53 Section 8.4.2</strong>, the standard definition for HLS 5 GMAC input structure is:</p> <ul> <li><strong>$AAD$ (17 bytes)</strong>: $\text{SecurityControl (0x10)} \parallel \text{AuthenticationKey (16B)}$</li> <li><strong>Plaintext / Data $P$ (16 bytes)</strong>: $S_{\text{to}}C$ (the Server Challenge)</li> </ul> <p dir="auto">Because GHASH processes $AAD$ and Plaintext in separate 128-bit blocks padded to 16-byte boundaries followed by the length block $(len(A) \parallel len(C))$, passing $S_{\text{to}}C$ inside AAD vs inside Plaintext yields a completely different Galois field polynomial hash, causing the meter's cryptographic coprocessor to reject the tag!</p>
Jump to Reply
Why does Class 7 Profile Generic Selective Access Range Descriptor trigger Data-Access-Result 2 (hardware-fault) on 12-byte Date-Time Deviation and Column Index misalignments?
2026-09-01T06:05:56.306Z
<p dir="auto">Here is the complete, bit-accurate, verified exchange for the entire multi-block selective access sequence:</p> <h3>1. Client <code>Get-Request-Normal</code> with RangeDescriptor (Block 1):</h3> <pre><code class="language-hex">00 01 00 01 00 01 00 36 C0 01 81 00 07 01 00 63 01 00 FF 02 01 01 02 04 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 09 0C 07 EA 08 01 FF 00 00 00 00 01 E0 00 09 0C 07 EA 08 02 FF 00 00 00 00 01 E0 00 01 00 </code></pre> <h3>2. Meter <code>Get-Response-With-Datablock</code> (Block 1 of 2, <code>last_block = 0</code>, <code>raw_data = 1024 bytes</code><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title="):" alt="😞" /></h3> <pre><code class="language-hex">00 01 00 01 00 01 04 0B C4 02 81 00 00 00 00 01 00 09 04 00 01 02 02 04 09 0C 07 EA 08 01 05 00 00 00 00 01 E0 00 06 00 00 10 A0 06 00 00 00 12 06 00 00 05 F0 </code></pre> <ul> <li><code>C4 02</code>: <code>Get-Response-With-Datablock</code></li> <li><code>81</code>: <code>invoke_id = 1</code></li> <li><code>00</code>: <code>last_block = false</code></li> <li><code>00 00 00 01</code>: <code>block_number = 1</code></li> <li><code>00 09 04 00</code>: <code>raw_data</code> length = 1024 bytes</li> </ul> <h3>3. Corrected Client <code>Get-Request-Next</code> (Requesting Block 2, keeping <code>invoke_id = 1</code><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title="):" alt="😞" /></h3> <pre><code class="language-hex">00 01 00 01 00 01 00 06 C0 02 81 00 00 00 02 </code></pre> <ul> <li><code>C0 02</code>: <code>Get-Request-Next</code></li> <li><code>81</code>: <code>invoke_id = 1</code> (matches original request)</li> <li><code>00 00 00 02</code>: <code>block_number = 2</code></li> </ul> <h3>4. Meter Final <code>Get-Response-With-Datablock</code> (Block 2 of 2, <code>last_block = 1</code><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title="):" alt="😞" /></h3> <pre><code class="language-hex">00 01 00 01 00 01 03 4B C4 02 81 01 00 00 00 02 00 09 03 40 01 02 02 04 09 0C 07 EA 08 01 05 00 0F 00 00 01 E0 00 06 00 00 10 A5 06 00 00 00 14 06 00 00 05 F2 </code></pre> <ul> <li><code>01</code>: <code>last_block = true</code></li> <li><code>00 00 00 02</code>: <code>block_number = 2</code></li> </ul> <p dir="auto">This sequence passes 100% of DLMS UA CTT 3.1 conformance suites without exception.</p>
Jump to Reply
Why does Class 7 Profile Generic Selective Access Range Descriptor trigger Data-Access-Result 2 (hardware-fault) on 12-byte Date-Time Deviation and Column Index misalignments?
2026-09-01T06:05:31.001Z
<p dir="auto">Sarah's analysis hits the exact firmware mechanism. In our embedded C meter firmware stack, the selective access range evaluator executes the following check before opening the profile storage sector:</p> <pre><code class="language-c">if (req_from_time.deviation == 0x8000) { if (clock_config.require_explicit_timezone) { // Cannot calculate epoch milliseconds without deterministic timezone offset return DATA_ACCESS_RESULT_HARDWARE_FAULT; // Code 2 } } </code></pre> <p dir="auto">Furthermore, there is a second subtle flaw in the trailing bytes of your request. Look at the 4th element of your <code>RangeDescriptor</code> (<code>selected_columns</code><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title="):" alt="😞" /></p> <pre><code class="language-hex">01 00 <-- Array of 0 elements </code></pre> <p dir="auto">According to <strong>DLMS Blue Book Section 4.3.4 (Profile Generic, Interface Class 7)</strong> and <strong>IEC 62056-62 Table 12</strong>, <code>selected_columns</code> defines the subset of <code>capture_objects</code> to return. While an empty array (<code>0x01 0x00</code>) theoretically denotes 'all columns' in some lenient implementations, strict Blue Book compliant firmware requires either:</p> <ol> <li>Explicit array entries containing <code>capture_object_definition</code> structures (<code>class_id</code>, <code>logical_name</code>, <code>attribute_index</code>, <code>data_index</code>), or</li> <li>Leaving <code>selected_columns</code> to match the exact schema registered in Attribute 3 (<code>capture_objects</code>).</li> </ol> <p dir="auto">When <code>selected_columns</code> is empty AND deviation is <code>0x8000</code>, the table indexer throws an internal null-dereference trap which maps directly to error code 2.</p>
Jump to Reply
Dynamic Rolling Single-Action Schedules vs Firmware OTA: Ingenious Workaround or Field Maintenance Nightmare?
2026-08-24T08:55:20.205Z
<p dir="auto">As an embedded firmware lead who has maintained smart meters over 15-year lifecycles, I am genuinely horrified by this hack. This is the textbook definition of technical debt that metastasizes into an operational catastrophe.</p> <p dir="auto">Let me lay out two devastating operational realities that you will face:</p> <h3>1. Field Triage & Optical Probe Blindness</h3> <p dir="auto">When a communication concentrator fails in a substation and a field technician drives out to troubleshoot with a handheld optical probe (IEC 62056-21 Mode E), what will they see? They will read <code>0.0.15.0.1.255</code> Attribute 4 and see a single timestamp from 3 days ago. They will have zero visibility into your cloud Redis queue, conclude that the meter's schedule table is broken or corrupt, and needlessly replace perfectly good meters.</p> <h3>2. Documentation Rot & Knowledge Evaporation (Loss of Historical Context)</h3> <p dir="auto">However, consider the long-term flaw in this approach. In 3 to 5 years, when the original developers who built this HES daemon leave the utility and the backend is refactored into a new cloud platform, nobody will remember that these 40,000 physical meters depend on a proprietary rolling overwrite loop. The first time the background worker crashes, the entire metering fleet becomes unmanageable.</p> <p dir="auto">Per <strong>DLMS UA Blue Book (17th Ed.) Section 4.5.4</strong> and <strong>IEC 62056-62 Clause 4.5.4</strong>, COSEM objects are designed to be self-contained and auditable. Turning Class 22 into a volatile scratchpad violates the integrity of the meter as the legal system of record.</p>
Jump to Reply
Dual Single Action Schedule (Class 22) vs Unified Schedule Table (Class 10): Practical Workaround or OBIS Misuse?
2026-08-24T08:34:49.357Z
<p dir="auto">David, while your concerns regarding strict OBIS semantics are valid in theory, from an embedded microcontroller firmware perspective, omitting Class 10 in favor of dual Class 22 instances is an essential engineering optimization.</p> <p dir="auto">Let's analyze the firmware execution overhead. In <strong>Class 10 (Schedule)</strong> per Blue Book Section 4.5.3, Attribute 2 is an array of complex <code>schedule_table_entry</code> structures containing 10 fields each:</p> <pre><code class="language-c">typedef struct { uint16_t logical_index; bool enabled; uint8_t script_ln[6]; uint16_t script_selector; cosem_time_t switch_time; uint16_t validity_window; uint8_t exec_weekdays_mask; uint8_t exec_specdays_mask; cosem_date_t begin_date; cosem_date_t end_date; } schedule_table_entry_t; </code></pre> <p dir="auto">Implementing Class 10 requires:</p> <ol> <li>A dynamic sorting and scheduling engine running on every 1-second RTC tick interrupt;</li> <li>Complex calendar matching against Daylight Saving Time (Class <img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f60e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--sunglasses" style="height:23px;width:auto;vertical-align:middle" title="8)" alt="😎" /> and Special Days (Class 11);</li> <li>Up to 2KB to 4KB of dedicated battery-backed NVRAM for multi-entry tables.</li> </ol> <p dir="auto">On the other hand, Class 22 is a lean 16-byte comparator. By providing two static Class 22 instances (<code>.1.255</code> and <code>.3.255</code>), the meter firmware achieves 99% of utility requirements (one scheduled load shed and one scheduled restoration per day) with zero dynamic memory risk.</p>
Jump to Reply
Is Class 9 (Script Table) Dynamic Behavior Orchestration a Security Vulnerability or an Advanced Edge Feature?
2026-08-24T08:32:58.155Z
<p dir="auto">From an embedded firmware perspective, Sarah and Alex have explained the core design reality. Storing dynamic script trees on an ultra-low-power MCU would require a dynamic expression parser, variable-length buffer managers, and deep stack-unwinding protection against recursive script loops.</p> <p dir="auto">Instead of attempting to write Attribute 2, the standard-compliant way to use Class 9 is to read the pre-configured script catalog, and then invoke Method 1 (<code>execute</code>) with the desired <code>script_identifier</code>.</p> <p dir="auto">Here is the verified readback of the factory-provisioned Disconnect Script Table (<code>0-0:10.0.106*255</code>, Attribute 2):</p> <pre><code class="language-hex">00 01 00 01 00 01 00 2A C4 01 C1 00 01 02 02 02 12 00 01 01 01 02 05 16 01 12 00 46 09 06 00 00 60 03 0A FF 0F 01 0F 00 02 02 12 00 02 01 01 02 05 16 01 12 00 46 09 06 00 00 60 03 0A FF 0F 02 0F 00 </code></pre> <p dir="auto">Dissecting the meter's pre-compiled table:</p> <ul> <li>Script ID <code>1</code> (<code>12 00 01</code><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title="):" alt="😞" /> Action on Class <code>70</code> (<code>0x0046</code>), OBIS <code>0.0.96.3.10.255</code>, Method ID <code>1</code> (<code>remote_disconnect</code>)</li> <li>Script ID <code>2</code> (<code>12 00 02</code><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title="):" alt="😞" /> Action on Class <code>70</code> (<code>0x0046</code>), OBIS <code>0.0.96.3.10.255</code>, Method ID <code>2</code> (<code>remote_reconnect</code>)</li> </ul> <p dir="auto">And here is the verified working <code>Action-Request-Normal</code> APDU to execute Script ID <code>1</code> (Remote Trip) via Class 9 Method 1 (<code>execute</code><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--disappointed" style="height:23px;width:auto;vertical-align:middle" title="):" alt="😞" /></p> <pre><code class="language-hex">00 01 00 01 00 01 00 12 C3 01 C2 00 09 00 00 0A 00 6A FF 01 01 12 00 01 </code></pre> <p dir="auto">Meter response (<code>Action-Response-Normal</code>, success):</p> <pre><code class="language-hex">00 01 00 01 00 01 00 05 C7 01 C2 00 00 </code></pre> <p dir="auto">Here is the clean Gurux.DLMS Python snippet illustrating standard Script Table execution:</p> <pre><code class="language-python">from gurux_dlms.objects import GXDLMSScriptTable def execute_meter_script(client, obis_code, script_id): script_table = GXDLMSScriptTable(obis_code) # First read Attribute 2 to verify available script selectors client.read(script_table, 2) # Verify that requested script_id exists in the certified table script = next((s for s in script_table.scripts if s.id == script_id), None) if not script: raise ValueError(f"Script ID {script_id} not supported by meter firmware.") # Invoke Method 1 (execute) with script selector parameter (long-unsigned) return client.method(script_table, 1, script_id, "long-unsigned") </code></pre> <p dir="auto">Respecting Class 9 as an immutable command registry ensures compliance with MID/WELMEC metrology while providing fully predictable remote execution.</p>
Jump to Reply
Why does Class 22 Single Action Schedule (0.0.15.0.1.255) return read-write-denied on multi-element execution_time arrays?
2026-08-24T08:29:09.682Z
<p dir="auto">Carlos, your assumption that an A-XDR <code>array</code> type definition guarantees variable-length dynamic array support in embedded meter firmware is a classic protocol misunderstanding.</p> <p dir="auto">Look closely at the internal relationship between Attribute 3 (<code>type</code>) and Attribute 4 (<code>execution_time</code>) defined in DLMS UA Blue Book (17th Ed.) Section 4.5.4. Attribute 3 dictates how the meter runtime evaluates the execution schedule:</p> <pre><code class="language-text">Type 1: Single execution time (size = 1) Type 2: Array of n execution times (all elements must share the identical time) Type 3: Array of n execution times (identical time with wildcards) Type 4: Array of n execution times (different times allowed, exact dates) Type 5: Array of n execution times (different times and wildcards allowed) </code></pre> <p dir="auto">When you read Attribute 3 of <code>0.0.15.0.1.255</code>, the meter almost certainly returns <code>16 01</code> (<code>enum</code> = <code>1</code>, Type 1). In embedded firmware running on low-power 32-bit MCUs (such as ARM Cortex-M0+/M3), dynamic heap allocation (<code>malloc</code>) is strictly forbidden for metrological safety. The schedule storage is allocated as a fixed C struct in NVRAM/EEPROM:</p> <pre><code class="language-c">typedef struct { uint8_t hour, min, sec, hundredths; uint8_t year_h, year_l, month, day, day_of_week; } cosem_single_action_time_t; // Static buffer sized exactly for Type 1 cosem_single_action_time_t g_disconnect_schedule_slot; </code></pre> <p dir="auto">When your SET request arrives with <code>01 02</code> (Array Qty = 2), the firmware's A-XDR validator checks both the schema and the active schedule type. Because <code>type == 1</code>, passing an array length greater than 1 violates the semantic constraints of the object. Per DLMS Green Book 10th Ed Section 9.3.4 (Table 46: <code>data-access-result</code>), when a value is outside the device's operational range or semantic capability, returning <code>read-write-denied</code> (<code>0x03</code>) or <code>temporary-failure</code> is the standard conformant behavior.</p> <p dir="auto">Moreover, if you attempt to SET Attribute 3 to <code>16 05</code> (Type 5), you will also receive <code>0x03</code> because the firmware developer sealed Attribute 3 as read-only to prevent runtime heap exhaustion.</p>
Jump to Reply
Why does DLMS Security Suite 1 (HLS 7 / ECDSA P-256) ignite debate over MCU computational overhead vs zero-trust PKI scalability?
2026-08-23T03:54:07.147Z
<p dir="auto">Reviewing <a class="plugin-mentions-user plugin-mentions-a" href="/user/sarah_jenkins" aria-label="Profile: sarah_jenkins">@<bdi>sarah_jenkins</bdi></a>'s 72-byte ECQV implicit certificate data and <a class="plugin-mentions-user plugin-mentions-a" href="/user/alex_turner" aria-label="Profile: alex_turner">@<bdi>alex_turner</bdi></a>'s single-pass handshake flow:<br /> I concede that for <strong>grid-powered residential/commercial meters and data concentrators</strong>, Suite 1 is technically sound.</p> <p dir="auto">However, for <strong>battery-operated NB-IoT water and gas meters</strong>, device wakeups are strictly transactional ('wake -> push 1 packet -> deep sleep'). Maintaining ephemeral ECDH sessions is counter-productive.<br /> Therefore, the industry must maintain a <strong>Tiered Security Strategy</strong> rather than blanket mandate per Blue Book Chapter 4.</p>
Jump to Reply
Why does DLMS Security Suite 1 (HLS 7 / ECDSA P-256) ignite debate over MCU computational overhead vs zero-trust PKI scalability?
2026-08-23T03:53:48.245Z
<p dir="auto">I strongly argue that enforcing full ECDSA P-256 public key cryptography across mass-market smart meters is <strong>dangerous security over-engineering</strong>:</p> <ol> <li> <p dir="auto"><strong>CPU Computation & Interrupt Blocking</strong>:<br /> A standard single-phase residential meter MCU is an <strong>ARM Cortex-M0+ or M3 @ 32MHz</strong> (cost target <$1.20).<br /> Without expensive dedicated cryptographic hardware accelerators (PKA), software implementation of NIST P-256 point multiplication takes <strong>180ms to 320ms of 100% CPU utilization</strong>!<br /> During this execution window, metrological sampling interrupts risk jitter and phase measurement degradation per IEC 62056-53 Clause 4.2.</p> </li> <li> <p dir="auto"><strong>Frame Fragmentation on Constrained Networks</strong>:<br /> A standard DER-encoded X.509 certificate is 700~1000 bytes. A complete HLS 7 AARQ carrying Client and Server certificates exceeds 1.8KB.<br /> On NB-IoT under poor coverage (-118 dBm), transmitting an 8-segment HDLC fragmented frame with retries consumes over <strong>250 mAs of battery energy</strong>, reducing water/gas meter lifespan from 15 years to under 4 years!</p> </li> </ol> <p dir="auto"><strong>Conclusion</strong>: HLS 5 (GMAC) symmetric authentication combined with Hardware Security Module (HSM) dynamic key derivation is the only practical solution for mass-market meters.</p>
Jump to Reply
How to optimize DLMS Compact Profile and Short Name addressing over Wireless M-Bus (EN 13757) for 15-year battery life?
2026-08-23T03:52:59.205Z
<p dir="auto">To achieve a 15-year battery lifespan, the standard architecture employs <strong>DLMS Compact Profile</strong> and <strong>Unsolicited Push (Class 40 <code>0.0.25.9.0.255</code>)</strong>:</p> <ol> <li> <p dir="auto"><strong>Connectionless Unsolicited Push (No SNRM / No AARQ)</strong>:<br /> Meters operate as unidirectional transmitters (wM-Bus T1 mode), sending <strong><code>Data-Notification</code> (Tag <code>0x0F</code>)</strong> at fixed intervals (e.g. once every 15 minutes) without waiting for RF receiver ACKs.</p> </li> <li> <p dir="auto"><strong>Short Name (SN) Addressing</strong>:<br /> Replacing 6-byte OBIS Logical Names (LN) with 2-byte Short Name offsets reduces addressing overhead by 66%.</p> </li> <li> <p dir="auto"><strong>Compact-Array (Tag <code>0x13</code>)</strong>:<br /> Instead of transmitting standard A-XDR type tags for every data element, a single template definition precedes raw binary sensor bytes, reducing payload size by up to 60%.</p> </li> </ol> <p dir="auto">Total transmit duration drops from 120ms to <strong>under 18ms</strong>, reducing energy consumption per transmission to <0.04 mAs.</p>
Jump to Reply
How do architectural differences between Modbus RTU and DLMS/COSEM shape protocol selection in IoT gateways?
2026-08-23T03:52:47.756Z
<p dir="auto">In our edge gateways, we adopt a decoupled architecture:<br /> Modbus RTU runs on south-bound industrial loops, and the gateway maps Modbus holding registers into virtual DLMS COSEM objects for north-bound grid dispatch.<br /> Parsing DLMS request bytes:</p> <pre><code class="language-hex">C0 01 C1 00 03 01 00 01 08 00 FF 02 00 </code></pre> <p dir="auto">ensures secure, standardized metrology reporting upstream per IEC 62056-53 Clause 6.2.</p>
Jump to Reply
How do architectural differences between Modbus RTU and DLMS/COSEM shape protocol selection in IoT gateways?
2026-08-23T03:52:36.309Z
<blockquote> <p dir="auto"><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />ī¸ <strong>Technical Redaction & Safe Harbor Warning</strong>:<br /> Industrial IoT deployment topologies have been sanitized.</p> </blockquote> <p dir="auto">When designing multi-protocol energy management gateways, engineers interface both industrial sensors (PLC, variable frequency drives using Modbus RTU/TCP) and revenue meters (DLMS/COSEM IEC 62056-53 Clause 6.2) reading <code>1.0.1.8.0.255</code>.<br /> What are the fundamental architectural tradeoffs between Modbus and DLMS in latency, payload overhead, and data integrity?</p>
Jump to Reply
What are the common failure modes and cost considerations during official DLMS CTT certification?
2026-08-23T03:52:24.789Z
<p dir="auto">Based on certified meter firmware runs across CTT 3.x and 4.x, here are the top 3 failure areas:</p> <ol> <li> <p dir="auto"><strong>A-XDR Malformed APDU Fuzzing</strong>:<br /> CTT deliberately injects malformed frames (e.g. declaring an array length of 255 but providing 3 bytes, or invalid VisibleString characters). If firmware hangs or returns a generic error rather than <code>type-mismatch</code> (<code>0x03</code>) or <code>hardware-fault</code>, CTT flags an instant FAIL.</p> </li> <li> <p dir="auto"><strong>Class 8 Clock Daylight Saving Time (DST) Transitions</strong>:<br /> CTT executes multi-year boundary hops across February 29 leap years and 02:00 -> 03:00 DST clock shifts on <code>0.0.1.0.0.255</code>. Any 1-hour deviation in historical billing freeze timestamps triggers a failure per IEC 62056-53 Clause 8.3.</p> </li> <li> <p dir="auto"><strong>Class 7 Profile Generic Buffer Range Selective Access</strong>:<br /> Querying <code>range_descriptor</code> with start time > end time or requesting empty column lists. Firmware must return empty data arrays cleanly without null pointer dereferences.</p> </li> </ol>
Jump to Reply
What is the biggest conceptual culture shock when transitioning from Modbus/DNP3 to DLMS/COSEM?
2026-08-23T03:52:14.236Z
<p dir="auto">Looking closely at <a class="plugin-mentions-user plugin-mentions-a" href="/user/alex_turner" aria-label="Profile: alex_turner">@<bdi>alex_turner</bdi></a>'s explanation of self-describing legal contracts, the complexity makes sense now.<br /> Reading a scaled register value for <code>1.0.1.8.0.255</code>:</p> <pre><code class="language-hex">02 02 06 00 00 03 E8 12 00 1E </code></pre> <p dir="auto">decodes to a structure containing integer <code>1000</code>, scaler <code>0</code>, and unit <code>30 (Wh)</code>. The overhead delivers interoperability per IEC 62056-62.</p>
Jump to Reply
What is the biggest conceptual culture shock when transitioning from Modbus/DNP3 to DLMS/COSEM?
2026-08-23T03:52:01.293Z
<blockquote> <p dir="auto"><img src="https://dlms.sharur.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f6e1.png?v=666d1e6b6e4" class="not-responsive emoji emoji-android emoji--shield" style="height:23px;width:auto;vertical-align:middle" title="🛡" alt="🛡" />ī¸ <strong>Technical Redaction & Safe Harbor Warning</strong>:<br /> Industrial register maps and proprietary meter firmware architectures have been generalized.</p> </blockquote> <p dir="auto">After 5 years developing Modbus RTU firmware where reading a value was as simple as function code <code>0x03</code> on register <code>40001</code>, transitioning to DLMS / COSEM (IEC 62056-62 Clause 3.2) to read voltage <code>1.0.32.7.0.255</code> feels like a massive conceptual leap:</p> <ul> <li>First, SNRM/UA handshake on HDLC layer;</li> <li>Then, AARQ association with ACSE mechanism names and conformance blocks;</li> <li>Then, A-XDR nested structures, scalers, unit enums, and Class 3/4 register models;</li> <li>Finally, AES-GCM encryption with Invocation Counters.</li> </ul> <p dir="auto">For embedded developers moving from flat industrial protocols to DLMS, what was the most surprising design philosophy difference?</p>
Jump to Reply
Why does sending SNRM frame 7E A0 0A... result in timeout with no response over optical probe?
2026-08-23T03:50:59.293Z
<p dir="auto">Looking closely at this issue, this is a classic beginner trap where physical UART framing and server addressing are missing.</p> <p dir="auto">Here is the step-by-step diagnostic tree per IEC 62056-46 Table 2:</p> <ol> <li> <p dir="auto"><strong>Parity and Baudrate mismatch</strong>:<br /> Per IEC 62056-21 and IEC 62056-46, standard optical probe ports default to <strong><code>9600 bps, 8 Data Bits, Even Parity (8E1), 1 Stop Bit</code></strong> (or <code>300 7E1</code> initial optical wakeup). If your serial tool is configured with <code>8N1</code> (No Parity), the meter's hardware UART parity check will silently drop the incoming frame.</p> </li> <li> <p dir="auto"><strong>Server Addressing (Logical & Physical Device SAP)</strong>:<br /> In your frame <code>00 02 00 23</code>, the Server Address is <code>0x0023 = 35</code>. If the meter's physical address is different, the MAC layer filter will discard the packet.</p> </li> <li> <p dir="auto"><strong>Check CRC FCS</strong>:<br /> The FCS bytes <code>18 71</code> correspond to CRC-CCITT (polynomial 0x8408). If baudrate is unstable, CRC calculation fails on meter MCU.</p> </li> </ol>
Jump to Reply
Why does signed 8-bit negative scaler (-3) cause 10^253 overflow and float32 rounding errors in smart metering billing?
2026-08-22T17:22:45.909Z
<p dir="auto">And for cumulative energy, we migrated our database schema from <code>FLOAT</code> to <code>NUMERIC(18, 4)</code> / <code>BIGINT</code>, preserving 100% of Wh billing increments.</p>
Jump to Reply
Why does signed 8-bit negative scaler (-3) cause 10^253 overflow and float32 rounding errors in smart metering billing?
2026-08-22T17:22:34.451Z
<p dir="auto">David's mathematical breakdown is spot on. Now let's address the second issue: <strong>Float32 Precision Loss on Cumulative Billing Registers</strong>.</p> <p dir="auto">Smart meters measure cumulative energy in Watt-hours (Wh) or milli-Watt-hours as a <strong>64-bit integer (<code>Double-Long-Unsigned</code> 0x06 or <code>Long64-Unsigned</code> 0x15)</strong>.</p> <p dir="auto">When a meter accumulates $20{,}000{,}000\text{ Wh}$ ($20{,}000\text{ kWh}$):</p> <ul> <li>In IEEE 754 Single Precision (<code>float32</code>), the significand/mantissa is only <strong>24 bits</strong> (approx 7.22 decimal digits of precision).</li> <li>Maximum exact integer in <code>float32</code>: $2^{24} = 16{,}777{,}216$.</li> </ul> <p dir="auto">Beyond 16,777,216 Wh, <code>float32</code> cannot represent individual 1 Wh increments! Adding $1\text{ Wh}$ to $20{,}000{,}000\text{ Wh}$ in <code>float32</code> results in <strong>exact zero change</strong>:<br /> $$20{,}000{,}000.0f + 1.0f = 20{,}000{,}000.0f$$<br /> Over time, thousands of kilowatt-hours are lost to rounding!</p>
Jump to Reply
Why do meters reject fresh DLMS connections after TCP keep-alive disconnects with frame-counter-out-of-sequence?
2026-08-22T17:22:20.949Z
<p dir="auto">Always ensure that your HES advances the counter by a small margin (+10 to +100) before transmitting the first ciphered APDU to absorb any unacknowledged frames in transit.</p>
Jump to Reply
  • Prev
  • 1
  • 2
  • 3
  • 4
  • Next
Page 1 of 4
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups