Hello Mikko,
We want to implement a time-out feature for each association.
In fact, after opening an association if we wait more than the time-out programmed by default for this association (for example 3 min) without sending or reading data. The meter should close automatically the association after time-out is exceeded. After that, if we try to read some data from the meter, it should be rejected.
Sure, for each type of association, it will have its own time-out open session.
Best Regards,
Lara Wakim
Hi,
Hi,
The timeout value is set for HDLC setup object using inactivity timeout. So timeout value is depending on the communication channel and not on the association.
If you are using WRAPPER, you need to set an inactivity timeout for TCP/UPD setup object.
BR,
Mikko
Hi Mikko,
Hi Mikko,
We were checking again this feature to be sure that it is working like expected and we noticed something that we want to share.
In fact, the svr_handleInactivityTimeout() function (triggered by the svr_run() function) is responsible to check the hdlc inactivity timeout. If the time elapsed from the last received frame is greater than the hdlc.inactivityTimeout, we set the variable "inactivity" to 1 and the following code is triggered:
//If inactivity timeout is elapsed.
if (inactivity)
{
svr_disconnected(settings);
svr_reset(settings);
}
But we noticed from the client side that the connection seems still on because no request of disconnection has been sent. After that when we tried to read or disconnect manually from the client, it was crashing.
So we think that there is a part missing in the above code that should tell the client that the association is done and we are in a disconnect status. Moreover the client should be ready for a new connection.
If you please can check this (to be able to repeat the issue: stop the sendPush for the push setup message and change the inactivity timeout to 10s to speed the testing and avoid the keep alive pdu).
Best Regards,
Lara Wakim
Hi Lara,
Hi Lara,
DLMS meter doesn't notify the client when the HDLC timeout has occurred and the association is closed. In TCP/IP connection there is a FIN message, but for HDLC there is nothing. If the client doesn't read anything from the meter, the meter just closes the association and that's it.
BR,
Mikko
Hi,
Hi,
Okay thank you for this explanation.
We have a related question we noticed when we click the disconnect button to close the association with the meter:
- the client sends to the server a "DLMS_COMMAND_DISC" pdu (0x53)
- the server sends to the client a "DLMS_COMMAND_UA" pdu (0x73)
But based on the green book when we have to close the association with the meter:
- the client should send to the server a "DLMS_COMMAND_RELEASE_REQUEST" pdu (0x62)
- the server should send to the client a "DLMS_COMMAND_RELEASE_RESPONSE" pdu (0x63)
But this is not the case! why are we using the first option not the second one when disconnecting? what is the main difference?
Best Regards,
Lara Wakim
Hi,
Hi,
Release service is added later to DLMS and all the meters are not supporting it. It's actually crashing a few of the meters. For this reason, it's optional and release is sent only when a secured connection or TCP/IP connection is used.
Please, create a new topic if you have a new question. I can see the new and open questions better than the closed ones.
BR,
Mikko