we managed to connect to the meter over GPRS (Dynamic IP). Everything works as expected (thanks for the library!).
As we are buying meters from different providers we need to make a public connection first to get the meter manufacturer name and then a private connection (using the correspondent manufacturer password) to download the readings.
How can we achieve that?
We can't close the socket since it is the meter contacting us at first place and the IP is dynamic so we can't call it back?
We basically nee to close the public client (not the socket) and open a private client straight away (same socket connection)
There are differences between the meters. Some meters are expecting that you will call Release after you have read the meter info with public address. Some meter manufacturers expect that you will establish the new connection without calling the release and just sending SNRM/AARQ messages.
thanks for the AMI link but I can see it uses only one client (based on the app config) at a time.
internal static void OnClientConnected(object sender, Gurux.Common.ConnectionEventArgs e)
{
Console.WriteLine("Client {0} is connected.", e.Info);
GXNet server = (GXNet)sender;
try
{
GXNet media = server.Attach(e);
Thread thread = new Thread(new ParameterizedThreadStart(ReadMeter));
thread.Start(media);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
After the meter has connected to the server (listener) I am looking for a way to open a public client (16) get some information (like serialNo) and then open a private client (17) to get meter readings.
yes I found the piece of code where it uses public and then private client. I also found the .Disconnect()
and .Release() methods you were talking about. As we are using the project Gurux.DLMS.Meter.Listener.Net (for GPRS dynamic IP) the GXDLMSReader has not any of the above methods (Gurux.Common 8.1.2002.1903, Gurux.DLMS 9.0.2008.2701, Gurux.Net 8.1.2002.1902). Are there any equivalent methods or do we need to update to the latest dll (the ones on the AMI project)?
Hi Omar,
Hi Omar,
You need to check this:
https://www.gurux.fi/Gurux.DLMS.DynamicIP
There are differences between the meters. Some meters are expecting that you will call Release after you have read the meter info with public address. Some meter manufacturers expect that you will establish the new connection without calling the release and just sending SNRM/AARQ messages.
You should check Gurux.DLMS.AMI listener. It will do this.
https://github.com/Gurux/Gurux.DLMS.AMI
BR,
Mikko
Hi Mikko,
Hi Mikko,
thanks for the AMI link but I can see it uses only one client (based on the app config) at a time.
internal static void OnClientConnected(object sender, Gurux.Common.ConnectionEventArgs e)
{
Console.WriteLine("Client {0} is connected.", e.Info);
GXNet server = (GXNet)sender;
try
{
GXNet media = server.Attach(e);
Thread thread = new Thread(new ParameterizedThreadStart(ReadMeter));
thread.Start(media);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
After the meter has connected to the server (listener) I am looking for a way to open a public client (16) get some information (like serialNo) and then open a private client (17) to get meter readings.
Where do I call "Release" from?
Thanks
Hi,
Hi,
AMI uses a public client to get Logical Device Name. Then it finds the correct meter and updates the settings.
Search ReleaseRequest-method.
BR,
Mikko
Hi,
Hi,
yes I found the piece of code where it uses public and then private client. I also found the .Disconnect()
and .Release() methods you were talking about. As we are using the project Gurux.DLMS.Meter.Listener.Net (for GPRS dynamic IP) the GXDLMSReader has not any of the above methods (Gurux.Common 8.1.2002.1903, Gurux.DLMS 9.0.2008.2701, Gurux.Net 8.1.2002.1902). Are there any equivalent methods or do we need to update to the latest dll (the ones on the AMI project)?
Thanks
Hi,
Hi,
Release is implemented in Gurux.DLMS. Add this and call it.
https://github.com/Gurux/Gurux.DLMS.Net/blob/434fee43d3f75d86834318230f…
BR,
Mikko
Thank you Mikko
Thank you Mikko