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. Forums
  3. Upgrade The Firmware In Python Code

Upgrade The Firmware in Python Code

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By Jinay Sharma , 7 March, 2022
Forums
Gurux.DLMS

How can i upgrade the firmware in python code.

I am using Rpi Board. I am using Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/

Please provide a Command or code.

where i add firmware file location??

Profile picture for user Kurumi

Kurumi

4 years 4 months ago

Hi,

Hi,

Check Image updating from here:
http://gurux.fi/Gurux.DLMS.Client

There is no python example available at the moment, but you can easily modify have for your needs.

There are changes between the image files. Some meter manufacturers are using binary files and some hex files or JSON files.

You need to read the data from the file by yourself and then update it like described in Image updating.

BR,
Mikko

Jinay Sharma

4 years 4 months ago

Dear Mikko,

Dear Mikko,

I'm not able to transfer image file.
what is client: {maxReceivePDUSize} in imageTransferInitiate ??
what passes argument in imageBlockTransfer fuction ??
need your support.

Meter Configuration
logicalName: 0.0.44.0.0.255
ImageBlockSize: 128
ImageTransferredBlocksStatus : 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
ImageFirstNotTransferredBlockNumber: 335
ImageTransferEnabled: True
ImageTransferStatus: 1
ImageActivateInfo: bytearray(b'ABCDEFG') bytearray(b'') 98028
Image File format: .bin

Profile picture for user Kurumi

Kurumi

4 years 4 months ago

Hi,

Hi,

Meter defines max PDU size in attribute #2. Image block size.
http://gurux.fi/Gurux.DLMS.Objects.GXDLMSImageTransfer

tr = GXDLMSImageTransfer
imageBlockValue = #Read this from the file.
frames = tr.imageBlockTransfer(client, imageBlockValue, None)

Send frames to the meter using readDataBlock-method.

BR,
Mikko

Jinay Sharma

4 years 4 months ago

Hi,

Hi,
I did it this way. not received any output
file = open("F:\image.bin", "rb")
ImageTransfer = GXDLMSImageTransfer()

ImageTransfer.client = settings.client
ImageTransfer.imageIdentifier = 'ABCDEFG'
ImageTransfer.forImageSize = 98028
data = ImageTransfer.imageTransferInitiate(ImageTransfer.client,ImageTransfer.imageIdentifier,ImageTransfer.forImageSize)
reply = GXReplyData()
reader.readDataBlock(data,reply)

ImageTransfer.imageBlockValue = file.read()
ImageTransfer.imageBlockCount = None
frames = ImageTransfer.imageBlockTransfer(ImageTransfer.client, ImageTransfer.imageBlockValue, ImageTransfer.imageBlockCount)

reader.readDataBlock(frames,reply)

Profile picture for user Kurumi

Kurumi

4 years 4 months ago

Hi,

Hi,

You need to read image block size first.

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

Who's new

  • BaEdhlfwwvUqFMkOYk
  • CrzONrPdvkWUif…
  • kra4026
  • HilipLot
  • NithnCXPiBJHVG…
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin