I'm experiencing issues with DLMS/COSEM communication when trying to read profile data from an electricity meter. While the initial connection is successful, reading profile data results in invalid HDLC frames.
Environment:
- Python with Gurux DLMS library
- TCP/IP connection to the meter
- Authentication Level: Low
- Using HDLC protocol
The connection parameters:
- IP: xx.xx.xx.xx
- Port: xxxx
- Client Address: xx
- Server Address: derived from meter serial number
- Password: ********
The issue:
1. Initial connection to the meter works fine
2. When trying to read profile data, I get HDLC frame errors:
The logs show "Invalid HDLC Frame: 0x3a Expected: 0x5a" errors, followed by "Data send failed".
I've tried:
1. Implementing a keep-alive mechanism
2. Setting appropriate timeouts
3. Reading capture objects before attempting to read profile data
4. Multiple reconnection attempts
The communication sequence:
1. Successfully establish connection
2. Get association view - successful
3. Try to read profile data - fails with HDLC frame errors
4. Subsequent retry attempts fail
Has anyone encountered similar issues? What could be causing these HDLC frame errors even though the initial connection is successful?
Any suggestions for:
1. Proper HDLC frame handling
2. Optimal DLMS/COSEM settings for profile data reading
3. Dealing with connection stability issues
My meters are Landis+Gyr E570 and E650
Thanks in advance for any help!
Problem solved - threads and…
Problem solved - threads and locks should have been used appropriately for keep-alive functions.