As you can see last packet is AARQ. What I do not understand when I copy this packet into your online DLMS translator (of course without ascii characters on the right) I get error "Message to XML failed. Invalid DLMS framing.". Also the meter doesnt response to AARQ packet with AARE. Can you please check if AARQ packet is correct ? I have parsed the above message and found no errors. All fields including CRC seems to be correct.
Thank you. I have also found another small error in GuruxDLMSClientExample project in method CGXCommunication::Read. When the overlapped operation fails because of timeout, you dont cancel read operation. I changed it like this:
//Wait until data is actually read
if (::WaitForSingleObject(m_osReader.hEvent, m_WaitTime) != WAIT_OBJECT_0)
{
(!CancelIo(m_hComPort))
{
return DLMS_ERROR_CODE_RECEIVE_FAILED;
}
Without calling CancelIo later write operation will cause that first byte received from meter will be swallowed by background overlapped read operation. GetOverlappedResult is needed because CancelIo itself is asynchronous.
Hi,
Hi,
There are invalid data at the end of the packet (e6 e6 00). Remove them.
BR,
Mikko
Is this a bug in Gurux.dlms
Is this a bug in Gurux.dlms.cpp library ? I see these bytes are added in int CGXDLMS::GetLNPdu method.
Hi,
Hi,
You are right we have broken this. I added an issue from this.
https://www.gurux.fi/node/13783
Then new version is on tests and it's released later today.
BR,
Mikko
BR,
Mikko
Thank you. I have also found
Thank you. I have also found another small error in GuruxDLMSClientExample project in method CGXCommunication::Read. When the overlapped operation fails because of timeout, you dont cancel read operation. I changed it like this:
//Wait until data is actually read
if (::WaitForSingleObject(m_osReader.hEvent, m_WaitTime) != WAIT_OBJECT_0)
{
(!CancelIo(m_hComPort))
{
return DLMS_ERROR_CODE_RECEIVE_FAILED;
}
GetOverlappedResult(m_hComPort, &m_osReader, &bytesRead, TRUE);
return DLMS_ERROR_CODE_RECEIVE_FAILED;
}
Without calling CancelIo later write operation will cause that first byte received from meter will be swallowed by background overlapped read operation. GetOverlappedResult is needed because CancelIo itself is asynchronous.
Hi Ján,
Hi Ján,
Thank you from this info. Is this happening in Linux or Windows?
We'll check this.
BR,
Mikko
Windows.
Windows.
Hi Ján,
Hi Ján,
Thanks from this info. We'll make a test environment and test this. A new version was released yesterday.
BR,
Mikko