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?
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
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?
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
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?
Hi, Yes, this looks correct…
Hi,
Yes, this looks correct.
BR,
Mikko
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?
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
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
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