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. Firmware Upgrade

Firmware upgrade

By kevin jose minj , 21 March, 2023
Forums
General discussion

How to upgrade firmware through python code?

file = open("firmware_iskra.bin", "rb")
reply = GXReplyData()
ImageTransfer = GXDLMSImageTransfer()
imageBlockSize = self.read(ImageTransfer, 2)
fw_filename = "firmware_iskra.bin"
imageIdentifier = "firmware_iskra"
forImageSize = int(os.path.getsize(fw_filename))
data=ImageTransfer.imageTransferInitiate(self.client,imageIdentifier,forImageSize)
reply = GXReplyData()
init_val = self.readDataBlock(data, reply)
ImageTransfer.imageBlockValue = file.read()
ImageTransfer.imageBlockCount = None
frames = ImageTransfer.imageBlockTransfer(self.client,
ImageTransfer.imageBlockValue, ImageTransfer.imageBlockCount)

reader.readDataBlock(frames,reply)

This code return access error: unknown error

What is the issue causing with this I tried in GuruxDLMSDirector its working fine while select the file and click update

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

Hi, Check first that the…

Hi,

Check first that the image identifier is correct. Some meters accept only specific names.
Can you transfer all the blocks for the meter or are you getting the exception right after imageTransferInitiate?

BR,
Mikko

kevin jose minj

3 years 2 months ago

In reply to Hi, Check first that the… by Kurumi

data=ImageTransfer…

data=ImageTransfer.imageTransferInitiate(self.client,imageIdentifier,forImageSize)
self.readDataBlock(data, reply)

when I am try to read this data issue is occuring and I passed active firmware identifier what I got from GuruxDLMS director now its showing
Access Error : Device reports a unmatched type.

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

In reply to data=ImageTransfer… by kevin jose minj

Hi, Check the image size…

Hi,

Check the image size that that is correct. What image identifier you was using in GuruxDLMSDirector? Use the same.

BR,
Mikko

kevin jose minj

3 years 2 months ago

In reply to Hi, Check the image size… by Kurumi

same error Access Error :…

same error

Access Error : Device reports a unmatched type.

identifier and image size is correct

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

In reply to same error Access Error :… by kevin jose minj

Hi, Our clients can update…

Hi,

Our clients can update Iskraemeco meters, but the firmware identifier is not "firmware_iskra".

You need to verify that from the meter vendor.

BR,
Mikko

kevin jose minj

3 years 2 months ago

In reply to Hi, Our clients can update… by Kurumi

Is there any way to check…

Is there any way to check the firmware identifier with gurux director?

Profile picture for user Kurumi

Kurumi

3 years 2 months ago

In reply to Is there any way to check… by kevin jose minj

Hi, No. The meter doesn't…

Hi,

No. The meter doesn't tell it and meter manufacturers are using different names for it.

BR,

Mikko

kevin jose minj

3 years ago

Hi Mikko, While I am…

Hi Mikko,

While I am updating firmware I am getting the error below

byte must be in range(0, 256)

In this line of code
frames = ImageTransfer.imageBlockTransfer(self.client,ImageTransfer.imageBlockValue, ImageTransfer.imageBlockCount)

kevin jose minj

2 years 12 months ago

Any updates regarding in…

Any updates regarding in this?

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin