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. Invalid Block Number

Invalid block number

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 AndreasAtPowel , 12 December, 2017
Forums
Gurux.DLMS

Hi

We are having some problem with invalid block numbers when communicating with UDP against Kaifa meters. Here is an example of how the communication may look like:

Send: 00-01-00-01-00-01-00-1A-C8-18-30-00-00-00-0F-14-F4-C4-82-58-6B-7D-3A-CF-7B-BC-3A-D6-00-70-97-C5-73-B2

Receive: 00-01-00-01-00-01-00-C7-CC-81-C4-30-00-00-00-0F-10-F4-C4-82-58-6B-78-29-0E-85-94-A6-31-44-65-1C-04-1C-3D-AA-DB-00-2E-B6-34-5B-1A-DA-16-C6-B1-3C-DA-99-E2-96-DF-C7-14-17-6D-F3-E3-F8-50-9D-1C-51-06-21-E0-97-51-F9-C1-FE-31-C8-F1-68-32-1B-95-53-B8-29-B9-5E-80-A9-10-19-DE-F3-1B-54-6E-F9-5C-86-02-7D-3C-51-65-12-AB-D6-38-34-0F-D4-C5-D4-03-3F-BC-0C-70-FE-AE-41-18-73-4C-D0-4D-92-AD-3E-F5-BD-A7-11-90-BF-94-95-F4-BF-E3-4C-80-62-B2-49-61-25-1B-7E-91-3B-05-AE-92-8F-BF-11-DC-A7-DD-25-CE-6F-41-D2-7B-86-32-7D-B8-E6-9F-10-B0-71-07-C5-6C-AF-C0-DF-5A-C4-31-C1-EC-D5-57-02-4C-B1-D9-81-C9-E3-9C-B2-97-0E-DC-73-48-64-A8-70-CE-31-F7-D9-9E

Send: 00-01-00-01-00-01-00-1A-C8-18-30-00-00-00-10-A8-84-35-C9-59-83-91-27-06-7D-58-43-B8-C1-D1-D5-97-54-3C

After this, we don´t get anything before we timeout (after 30 seconds). So we try sending again:

Send: 00-01-00-01-00-01-00-1A-C8-18-30-00-00-00-10-A8-84-35-C9-59-83-91-27-06-7D-58-43-B8-C1-D1-D5-97-54-3C

Receive: 00-01-00-01-00-01-00-1D-CC-1B-30-00-00-00-10-AC-84-35-C8-59-83-97-39-67-B9-0A-0A-1E-5B-85-EA-27-B6-1C-86-AE-7E

And in the last packet data we get the following error: Invalid Block number. It is 6 and it should be 7.

Do you know how we can get by this problem?

Regards
Helena

Profile picture for user Kurumi

Kurumi

8 years 5 months ago

Invalid block number

Hi,

Don't generate new packet if the packet is lost. I believe that you are calling Read to generate a new message. This will cause that block index is increased. If the message is lost and a timeout occurs just send generated bytes again.

BR,

Mikko

AndreasAtPowel

8 years 5 months ago

Hi

Hi

No we don´t generate a new packet if the packet is lost after a timeout. This is visible in my example:

Send: 00-01-00-01-00-01-00-1A-C8-18-30-00-00-00-10-A8-84-35-C9-59-83-91-27-06-7D-58-43-B8-C1-D1-D5-97-54-3C

After this, we don´t get anything before we timeout (after 30 seconds). So we try sending again:

Send: 00-01-00-01-00-01-00-1A-C8-18-30-00-00-00-10-A8-84-35-C9-59-83-91-27-06-7D-58-43-B8-C1-D1-D5-97-54-3C

BR
Helena

AndreasAtPowel

8 years 2 months ago

Hello

Hello

We´re still having problem with Invalid block number.
I have managed to get the data sent and received without encryption. At the end you can see that we don´t get any response for request 4956. We then send the same request again (5321). We get a response but the block number is still 2, and we get an error "Invalid block number. It is 2 and it should be 3". Do you have any idea on how we should handle this? The communication quality against the meter is quite bad, and we get this error often.

char peer0_24[] = { /* Packet 4561 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x40,
0xc0, 0x01, 0xc1, 0x00, 0x07, 0x01, 0x00, 0x63,
0x01, 0x00, 0xff, 0x02, 0x01, 0x01, 0x02, 0x04,
0x02, 0x04, 0x12, 0x00, 0x08, 0x09, 0x06, 0x00,
0x00, 0x01, 0x00, 0x00, 0xff, 0x0f, 0x02, 0x12,
0x00, 0x00, 0x09, 0x0c, 0x07, 0xe2, 0x03, 0x15,
0x03, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x0c, 0x07, 0xe2, 0x03, 0x1b, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 };
char peer0_25[] = { /* Packet 4907 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x40,
0xc0, 0x01, 0xc1, 0x00, 0x07, 0x01, 0x00, 0x63,
0x01, 0x00, 0xff, 0x02, 0x01, 0x01, 0x02, 0x04,
0x02, 0x04, 0x12, 0x00, 0x08, 0x09, 0x06, 0x00,
0x00, 0x01, 0x00, 0x00, 0xff, 0x0f, 0x02, 0x12,
0x00, 0x00, 0x09, 0x0c, 0x07, 0xe2, 0x03, 0x15,
0x03, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x09, 0x0c, 0x07, 0xe2, 0x03, 0x1b, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00 };
char peer1_20[] = { /* Packet 4943 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0xc8,
0xc4, 0x02, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x01,
0x00, 0x81, 0xbd, 0x01, 0x7a, 0x02, 0x03, 0x09,
0x0c, 0x07, 0xe2, 0x03, 0x15, 0x03, 0x17, 0x00,
0x00, 0xff, 0x80, 0x00, 0x00, 0x11, 0x00, 0x06,
0x00, 0x30, 0x39, 0xc3, 0x02, 0x03, 0x09, 0x0c,
0x07, 0xe2, 0x03, 0x16, 0x04, 0x00, 0x00, 0x00,
0xff, 0x80, 0x00, 0x00, 0x11, 0x00, 0x06, 0x00,
0x30, 0x40, 0xa5, 0x02, 0x03, 0x09, 0x0c, 0x07,
0xe2, 0x03, 0x16, 0x04, 0x01, 0x00, 0x00, 0xff,
0x80, 0x00, 0x00, 0x11, 0x00, 0x06, 0x00, 0x30,
0x47, 0x61, 0x02, 0x03, 0x09, 0x0c, 0x07, 0xe2,
0x03, 0x16, 0x04, 0x02, 0x00, 0x00, 0xff, 0x80,
0x00, 0x00, 0x11, 0x00, 0x06, 0x00, 0x30, 0x4e,
0x04, 0x02, 0x03, 0x09, 0x0c, 0x07, 0xe2, 0x03,
0x16, 0x04, 0x03, 0x00, 0x00, 0xff, 0x80, 0x00,
0x00, 0x11, 0x00, 0x06, 0x00, 0x30, 0x53, 0xdf,
0x02, 0x03, 0x09, 0x0c, 0x07, 0xe2, 0x03, 0x16,
0x04, 0x04, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00,
0x11, 0x00, 0x06, 0x00, 0x30, 0x55, 0xee, 0x02,
0x03, 0x09, 0x0c, 0x07, 0xe2, 0x03, 0x16, 0x04,
0x05, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x11,
0x00, 0x06, 0x00, 0x30, 0x58, 0x3e, 0x02, 0x03,
0x09, 0x0c, 0x07, 0xe2, 0x03, 0x16, 0x04, 0x06,
0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x11, 0x00,
0x06, 0x00, 0x30, 0x5a, 0x2e, 0x02, 0x03, 0x09 };
char peer0_26[] = { /* Packet 4944 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07,
0xc0, 0x02, 0xc1, 0x00, 0x00, 0x00, 0x01 };
char peer1_21[] = { /* Packet 4955 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0xc8,
0xc4, 0x02, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x02,
0x00, 0x81, 0xbd, 0x0c, 0x07, 0xe2, 0x03, 0x16,
0x04, 0x07, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00,
0x11, 0x00, 0x06, 0x00, 0x30, 0x5b, 0x62, 0x02,
0x03, 0x09, 0x0c, 0x07, 0xe2, 0x03, 0x16, 0x04,
0x08, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x11,
0x00, 0x06, 0x00, 0x30, 0x5d, 0x76, 0x02, 0x03,
0x09, 0x0c, 0x07, 0xe2, 0x03, 0x16, 0x04, 0x09,
0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x11, 0x00,
0x06, 0x00, 0x30, 0x5f, 0xf4, 0x02, 0x03, 0x09,
0x0c, 0x07, 0xe2, 0x03, 0x16, 0x04, 0x0a, 0x00,
0x00, 0xff, 0x80, 0x00, 0x00, 0x11, 0x00, 0x06,
0x00, 0x30, 0x61, 0xbd, 0x02, 0x03, 0x09, 0x0c,
0x07, 0xe2, 0x03, 0x16, 0x04, 0x0b, 0x00, 0x00,
0xff, 0x80, 0x00, 0x00, 0x11, 0x00, 0x06, 0x00,
0x30, 0x62, 0xee, 0x02, 0x03, 0x09, 0x0c, 0x07,
0xe2, 0x03, 0x16, 0x04, 0x0c, 0x00, 0x00, 0xff,
0x80, 0x00, 0x00, 0x11, 0x00, 0x06, 0x00, 0x30,
0x63, 0xe9, 0x02, 0x03, 0x09, 0x0c, 0x07, 0xe2,
0x03, 0x16, 0x04, 0x0d, 0x00, 0x00, 0xff, 0x80,
0x00, 0x00, 0x11, 0x00, 0x06, 0x00, 0x30, 0x65,
0x13, 0x02, 0x03, 0x09, 0x0c, 0x07, 0xe2, 0x03,
0x16, 0x04, 0x0e, 0x00, 0x00, 0xff, 0x80, 0x00,
0x00, 0x11, 0x00, 0x06, 0x00, 0x30, 0x65, 0xf7,
0x02, 0x03, 0x09, 0x0c, 0x07, 0xe2, 0x03, 0x16 };
char peer0_27[] = { /* Packet 4956 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07,
0xc0, 0x02, 0xc1, 0x00, 0x00, 0x00, 0x02 };
char peer0_28[] = { /* Packet 5321 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07,
0xc0, 0x02, 0xc1, 0x00, 0x00, 0x00, 0x02 };
char peer1_22[] = { /* Packet 5325 */
0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0a,
0xc4, 0x02, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x02,
0x01, 0x13 };

Regards
Helena

Profile picture for user Kurumi

Kurumi

8 years 2 months ago

Invalid block number

Hi,

Your meter is sent the block to the client and it clears the block after it's sent. When client request block again meter returns an error (because this block don't exist anymore). The only way to solve this is to start reading again. Some meters require that you close the session and start a new one.

This is meter issue and there is nothing else what you can do.

BR,

Mikko

AndreasAtPowel

8 years 2 months ago

Thank you! Regards Helena

Thank you!

Regards
Helena

  • 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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin