Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCS errors with Kaifa meters #68

Open
gnumfen opened this issue Sep 5, 2023 · 2 comments
Open

HCS errors with Kaifa meters #68

gnumfen opened this issue Sep 5, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@gnumfen
Copy link

gnumfen commented Sep 5, 2023

I'm having problems decoding data from two Kaifa meters. The exception I'm getting is "HCS is not correct Calculated".

This is data from first meter:
7ea09b01000110561be6e7000f40000000090c07e7090401103400ff800000021209074b464d5f30303109103733343031353730313132353335343409084d41333034483444060000044f0600000000060000000006000000c0060000088f06000005aa060000057c06000008da06000008f906000008e6090c07e7090401103400ff8000000608c141c9060000000006001ae03806013151959d787e
This is data from the second meter:
7ea11d01000110b0aee6e7000f4000000000022409060100000281ff09074b464d5f30303109060000600100ff09103733343031353730333037383433393509060000600107ff09074d41333034483409060100010700ff060000017209060100020700ff060000000009060100030700ff060000000009060100040700ff0600000050090601001f0700ff06000001be09060100330700ff060000047b09060100470700ff060000009409060100200700ff06000008ee09060100340700ff06000008e609060100480700ff06000008dd09060000010000ff090c07e709040111132dffffc40009060100010800ff0600bc0d9009060100020800ff060000000009060100030800ff06001c05dc09060100040800ff06000fed42acfd7e

As far as I can see there is more data in the header then on other meters.

@Krolken Krolken self-assigned this Sep 5, 2023
@Krolken Krolken added the bug Something isn't working label Sep 5, 2023
@Krolken
Copy link
Contributor

Krolken commented Sep 5, 2023

Hi.

I see a problem in the parsing of hdlc frames.

The meter is using a 1 byte and a 2 byte address, but when we calculate the hcs we are forcing the 2 byte address to a 1 byte address.

We should instead keep track of the initial length of the address so we can encode the address properly.

@gnumfen
Copy link
Author

gnumfen commented Sep 8, 2023

Hi
I have done a attempt at fixing my problem. It is in my kaifa-branch in the cloned repo.
I'm not very proud of the change in data_notification.py...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants