Hi everyone,
I am new to the DLMS and energy meter domain. I am working on interfacing a Saral 100 energy meter (Secure Meters) with my microcontroller over the RS232 protocol. I’ve received some initial details from the vendor, but I want to confirm what exact parameters and values are required from the manufacturer to ensure proper communication and data reading.
Here’s what I have so far:
Voltage Levels – RS232 standard voltage levels (3–5 V depending on signal type).
Serial Communication Settings – Baud rate: 9600 bps, Parity: None, Stop bits: 1.
Hi, Thank you for pointing…
Hi,
Thank you for pointing this out. This is still being tested because it affects all communication. The new version should be released this week once all tests are complete.
Regards,
Mikko
Hi, Thank you for taking on…
Hi, Thank you for taking on this issue!
While you are testing this area before the release, I noticed another related boundary issue in GXDLMS.getLNPdu().
When calculating whether the remaining data fits in the current PDU:
totalLength = len_ + len(reply)
totalLength does not account for the byte count header added right after by _GXCommon.setObjectCount(len_, reply).
Because of this, at the exact boundary where len_ + len(reply) == p.settings.maxPduSize, totalLength > p.settings.maxPduSize evaluates to False. The data is not truncated, and setObjectCount() adds 1 extra byte, resulting in a PDU that exceeds maxPduSize by 1 byte (e.g. 101 bytes instead of 100) while LastBlock is set to 0.
Proposed fix for both issues in GXDLMS.py:
1. In multipleBlocks():
Current code:
len_ += p.attributeDescriptor.size
Should be:
len_ += p.attributeDescriptor.available()
2. In getLNPdu():
Current code:
totalLength = len_ + len(reply)
Should be:
totalLength = len_ + len(reply) + _GXCommon.getObjectCountSizeInBytes(len_)
Hope this helps