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:
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.
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.
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.
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
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
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
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
Thank you! Regards Helena
Thank you!
Regards
Helena