Hi everyone,
I am pretty new to DLMS and Smartmeters,
For a customer, I have a DLMS smartmeter that I can connect via Optical Port,
It has HighGMAC authentication, I know phisical and logical Server and client address
It connects both with HDLC and Wrapper, I don't know the difference (I will appreciate if you can address me on some documentation)
Start Protocol is DLMS, with Logical Name Referencing,
I have both Block Cipher Key and Authentication Key.
If I connect on serial port I can get all the values from all the registers, but if I try to connect via GPRS,
with Dynamic IP, I can get the notification for the meter connection on the PC where I have DLMS Director but if in Device Settings i change Media to Net, after a while I get an error that the meter didn't respond in the given time.
As I am pretty new I don't know if the problem is in the GPRS Connection, in the start of the communication, if by protocol different address are defined, please any advice is well accepted
The next step is to create a c# app following https://www.gurux.fi/Gurux.DLMS.DynamicIP
GXDLMSDirector doesn't support dynamic IP addresses. You need to create own app that listens to incoming connections and then reads Logical Device Name and maps meter using the Logical Device Name.
GXDLMSReader cl1 = new GXDLMSReader(dlmsClient, cl, System.Diagnostics.TraceLevel.Verbose);
cl1.ReadAll(false);
//Create own thread for each meter if you are handling multiple meters simultaneously.
//new Thread(new ThreadStart(cl.ReadAll));
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
The meter must start the connection when you are using a public IP address in GPRS connections. It's a security option in GPRS networks and there is nothing that you can do for it.
You must use the static IP address to make this work like this, but static IP addresses are usually more expensive.
As u said dynamic IP address does not support DLMSDirector . I have own listener created through socketserver in java. i am able to read data from meter and keeping obicodes and data like Instantaneous and Load and Events and keeping in in one file in hexa fromat. is there any way to read that file using gurux library in java . Please see the attached file . Please reply me ASAP i am new to this meter.
I add the DLMS Director
I add the DLMS Director Connection Parameter
Hi,
Hi,
GXDLMSDirector doesn't support dynamic IP addresses. You need to create own app that listens to incoming connections and then reads Logical Device Name and maps meter using the Logical Device Name.
BR,
Mikko
Hi, thanks for your advice.
Hi, thanks for your advice.
In the picture below i try to open a connection, but i get an invalid connection exception...
Below there is my code, which is pretty much the same of the example in the tutorial https://www.gurux.fi/Gurux.DLMS.DynamicIP
private static void OnClientConnected(object sender, ConnectionEventArgs e)
{
Console.WriteLine("Client {0} is connected.", e.Info);
GXNet server = (GXNet)sender;
try
{
var IP_Port = e.Info.Split(':', StringSplitOptions.RemoveEmptyEntries);
using (GXNet cl = new GXNet(NetworkType.Tcp, IP_Port[0], int.Parse(IP_Port[1])))
{
GXDLMSSecureClient dlmsClient = new GXDLMSSecureClient()
{
Authentication = Gurux.DLMS.Enums.Authentication.HighGMAC,
ClientAddress = 1,
ServerAddress = 1,
UseLogicalNameReferencing = true,
InterfaceType = Gurux.DLMS.Enums.InterfaceType.WRAPPER,
};
dlmsClient.Ciphering.Security = Gurux.DLMS.Enums.Security.AuthenticationEncryption;
dlmsClient.Ciphering.SystemTitle = Encoding.ASCII.GetBytes("SACSACSA");
dlmsClient.Ciphering.AuthenticationKey = new byte[] { 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11, 0x00 };
dlmsClient.Ciphering.BlockCipherKey = new byte[] { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xF1 };
GXDLMSReader cl1 = new GXDLMSReader(dlmsClient, cl, System.Diagnostics.TraceLevel.Verbose);
cl1.ReadAll(false);
//Create own thread for each meter if you are handling multiple meters simultaneously.
//new Thread(new ThreadStart(cl.ReadAll));
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
This is the method that throw
This is the method that throw the exception
Hi,
Hi,
The meter must start the connection when you are using a public IP address in GPRS connections. It's a security option in GPRS networks and there is nothing that you can do for it.
You must use the static IP address to make this work like this, but static IP addresses are usually more expensive.
BR,
Mikko
Hi , As u said dynamic IP…
Hi ,
As u said dynamic IP address does not support DLMSDirector . I have own listener created through socketserver in java. i am able to read data from meter and keeping obicodes and data like Instantaneous and Load and Events and keeping in in one file in hexa fromat. is there any way to read that file using gurux library in java . Please see the attached file . Please reply me ASAP i am new to this meter.