Skip to main content
Home
for DLMS smart meters

Main navigation

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

Breadcrumb

  1. Home
  2. Firmware Upgrade Over The AIr

Firmware Upgrade Over The AIr

By kevin jose minj, 1 February, 2024
Forums
General discussion

Hi Mikko,

file = open("firmware.bin", "rb")
binary_data = file.read()
reply = GXReplyData()
imageTransfer = GXDLMSImageTransfer()
imageBlockSize = self.read(imageTransfer, 2)
filename = "firmware.bin"
img_identifier = "ABC"

forImageSize = int(os.path.getsize(filename))
verify = imageTransfer.imageVerify(self.client)
init_data = imageTransfer.imageTransferInitiate(self.client, img_identifier,
forImageSize)
reply = GXReplyData()
init_val = self.readDataBlock(init_data, reply)
frames = imageTransfer.imageBlockTransfer(self.client, binary_data,
None)
self.readDataBlock(frames, reply)

the above code is working fine and "self.readDataBlock(frames, reply)" method is giving true.Which means FW is successfully completed? or is there any way to check in GuruxDLMSDirector to check the latest updates in events?

Profile picture for user Kurumi

Kurumi

1 year 3 months ago

Hi, You have now just moved…

Hi,
You have now just moved the image to the meter.
Next, you need to verify the image and then activate it.

https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSImageTransfer

BR,
Mikko

kevin jose minj

1 year 3 months ago

verify = imageTransfer…

verify = imageTransfer.imageVerify(self.client)
activate = imageTransfer.imageActivate(self.client)

I executed this commands after transfering the image

[bytearray(b'\x00\x01\x00P\x00\x01\x00"\xd3 0\x00\x00\x03r}\n\xd8O_\xd2o\x06\xf1\xf8\xbf\xdb\x93\xe4b\xcbO\xdc\xff\xdaP\x90\xb8U\x8f\xe3\\')]
[bytearray(b'\x00\x01\x00P\x00\x01\x00"\xd3 0\x00\x00\x03s\x15\x0b+\xc2r<\x8e\xcf\x16C\xcc<n}\xa9\x80\xde\xa0L\xf9\x1b\x129\xcbW\xfa\xf6')]

TX: 14:20:50 00 01 00 50 00 01 00 09 62 03 80 01 00 03 80 01 00
RX: 14:20:51 00 01 00 01 00 50 00 17 63 15 80 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 00 19 02 00 00 07

This is the hex trace got. Is it fine? where should I check the firmware is installed or not?

Profile picture for user Kurumi

Kurumi

1 year 3 months ago

Hi, You need also send…

Hi,

You need also send verify and activate blocks to the meter. imageTransfer.imageVerify only generates the bytes. It doesn't send them to the meter.

You have sent the release and meter reply for it.

Image to activate info tells information from the image.
https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSImageTransfer

BR,
Mikko

kevin jose minj

1 year 3 months ago

verify = imageTransfer…

verify = imageTransfer.imageVerify(self.client)
self.readDataBlock(verify , reply)
activate = imageTransfer.imageActivate(self.client)
self.readDataBlock(activate, reply)

Is this the way I should send the verify and activate blocks?

Profile picture for user Kurumi

Kurumi

1 year 3 months ago

Hi, Yes, this looks correct…

Hi,

Yes, this looks correct.

BR,
Mikko

kevin jose minj

1 year 3 months ago

while doing verification and…

while doing verification and activation I am getting this error

TX: 12:25:43 00 01 00 50 00 01 00 22 D3 20 30 00 00 03 72 7D 0A D8 4F 5F D2 6F 06 F1 F8 BF DB 93 E4 62 CB 4F DC FF DA 50 90 B8 55 8F E3 5C
RX: 12:25:43 00 01 00 01 00 50 00 18 D7 16 30 00 00 03 71 82 6F 71 18 8B B5 1C 53 7C 6E 62 A5 34 0B 0C 47 12
TX: 12:25:47 00 01 00 50 00 01 00 22 D3 20 30 00 00 03 73 15 0B 2B C2 72 3C 8E CF 16 43 CC 3C 6E 7D A9 80 DE A0 4C F9 1B 12 39 CB 57 FA F6
RX: 12:25:47 00 01 00 01 00 50 00 18 D7 16 30 00 00 03 72 92 E8 B3 F4 91 4D B4 90 86 B0 32 0C 78 DC 31 30 2E
TX: 12:25:47 00 01 00 50 00 01 00 09 62 03 80 01 00 03 80 01 00
RX: 12:25:48 00 01 00 01 00 50 00 17 63 15 80 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 00 19 02 00 00 07
Access Error : Device reports a temporary failure.

Is there any wait time required before sending the verify and activate blocks to the meter?

Profile picture for user Kurumi

Kurumi

1 year 3 months ago

Hi, Verify and active the…

Hi,

Verify and active the image take different times with different meters. Some meters do it quickly and some can take several minutes to do it.

When the meter returns temperature failure, you need just wait e.g. 10 seconds and try again.

BR,
Mikko

kevin jose minj

1 year 3 months ago

verify = imageTransfer…

verify = imageTransfer.imageVerify(self.client)
time.sleep(20)
self.readDataBlock(verify, reply)
time.sleep(20)
activate = imageTransfer.imageActivate(self.client)
time.sleep(20)
self.readDataBlock(activate, reply)

I modified the code mentioned as above . Still I am getting below error.

TX: 11:13:11 00 01 00 50 00 01 00 22 D3 20 30 00 00 03 72 7D 0A D8 4F 5F D2 6F 06 F1 F8 BF DB 93 E4 62 CB 4F DC FF DA 50 90 B8 55 8F E3 5C
Service unknown. Other reason
RX: 11:13:12 00 01 00 01 00 50 00 03 D8 02 03
TX: 11:13:12 00 01 00 50 00 01 00 09 62 03 80 01 00 03 80 01 00
Service unknown. Other reason
RX: 11:13:12 00 01 00 01 00 50 00 03 D8 02 03
Service unknown. Other reason
Service unknown. Other reason

Profile picture for user Kurumi

Kurumi

1 year 3 months ago

Hi, Image verification or…

Hi,

Image verification or activation is takin more than 20 seconds.

You need to do it in while loop. Something like this:

verify = imageTransfer.imageVerify(self.client)
imageTransferStatus = ImageTransferStatus.IMAGE_VERIFICATION_INITIATED
#Loop until image verification succeeded.
while imageTransferStatus == ImageTransferStatus.IMAGE_VERIFICATION_INITIATED:
time.sleep(20)
imageTransferStatus = read(imageTransfer, 6)

if imageTransferStatus == ImageTransferStatus.IMAGE_VERIFICATION_FAILED:
#Show error.

BR,
Mikko

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 05/20/2025 - 08:40
    gurux.dlms.c 9.0.2505.2001
  • Mon, 05/19/2025 - 10:19
    gurux.net.java 1.0.30
  • Mon, 05/19/2025 - 10:00
    gurux.dlms.c 9.0.2505.1901
  • Thu, 05/15/2025 - 16:26
    gurux.dlms.c 9.0.2505.1501
  • Wed, 05/14/2025 - 08:30
    gurux.dlms.c 9.0.2505.1401

New forum topics

  • HDLC Adress resolver configuration
  • Reading all "Data" object type parameter together
  • com_read getting failed for billing profile and instantaneous profile
  • Simulator connection closed
  • Regarding the dlms android project
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin