Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Invalid HDLC Frame With Python

Invalid HDLC frame with Python

By yar.l , 14 December, 2023
Forums
Gurux.DLMS

Hi. I want to Initiate an ImageTransfer on my meter by using your amazing Python library.
After running this code:

target = GXDLMSImageTransfer("0.0.44.0.0.255")
identification = "4410"
# Reading file data.bin with image
data = f.read()
# Initiating image transfer
target.imageTransferInitiate(open_and_close_connection.client, identification, len(data))
# Reading imageTransferStatus
GXDLMSReader.read(target, 6)

I get this exchange in console. Where frames with GetRequest to read Image Transfer Status have Invalid HDLC frame:

TX: 12:27:17 7E A0 13 02 21 61 93 CF 64 81 80 06 05 01 72 06 01 72 B5 F6 7E
RX: 12:27:17 7E A0 1F 61 02 21 73 E1 E2 81 80 12 05 01 72 06 01 72 07 04 00 00 00 01 08 04 00 00 00 01 25 36 7E
TX: 12:27:17 7E A0 4D 02 21 61 10 86 C6 E6 E6 00 60 3E A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 02 AC 12 80 10 A9 F2 EE 23 65 F1 A6 34 F9 D1 1C 8B E1 6D 1F 26 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 5D FF FF 41 04 7E
RX: 12:27:17 7E A0 59 61 02 21 30 C4 68 E6 E7 00 61 4A A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 0E 88 02 07 80 89 07 60 85 74 05 08 02 02 AA 12 80 10 1B 0D 86 43 21 10 88 C4 E2 71 B8 DC EE 77 3B 9D BE 10 04 0E 08 00 06 5F 1F 04 00 00 1E 1D 08 00 00 07 1D F1 7E
TX: 12:27:17 7E A0 2C 02 21 61 32 61 6E E6 E6 00 C3 01 C1 00 0F 00 00 28 00 00 FF 01 01 09 10 37 19 40 EE 23 B3 9F 92 54 94 A9 61 AC 9E BC 71 C4 89 7E
RX: 12:27:17 7E A0 25 61 02 21 52 13 4A E6 E7 00 C7 01 C1 00 01 00 09 10 88 BB 82 14 32 A2 BB 10 19 2C ED 77 DF 40 6D DA 80 3A 7E
TX: 12:27:17 7E A0 1A 02 21 61 76 08 85 E6 E6 00 C0 01 C1 00 12 00 00 2C 00 00 FF 06 00 1B D6 7E
RX: 12:27:18 7E A0 08 61 02 21 11 69 26 7E
TX: 12:27:18 7E A0 08 02 21 61 53 6F 51 7E
RX: 12:27:18 7E A0 1F 61 02 21 73 E1 E2 81 80 12 05 01 72 06 01 72 07 04 00 00 00 01 08 04 00 00 00 01 25 36 7E

Any feedback would be appriciated!

Profile picture for user Kurumi

Kurumi

2 years 7 months ago

Hi, You can establish the…

Hi,

You can establish the connection without problems, but before you try to read
Image Transfer Status you have call read, write, or action that has increased the HDLC frame counter.

Check your code and don't call client.read if you don't send the generated message to the meter.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin