Hi. Great to see Gurux.DLMS now available for .NET Core.
But I can't get it to work right now.
I made a simple .NET Core console app using VS2017.
Get the Gurux.Common, Gurux.DLMS and Gurux.Net via NuGet.
And use a slightly modification of GXDLMSReader taken from the client example for .NET Framework.
Here is my code
================
var Manufacturers = new GXManufacturerCollection();
GXManufacturerCollection.ReadManufacturerSettings(Manufacturers);
var man = Manufacturers.FindByIdentification("lgz");
var dlms = new Gurux.DLMS.Secure.GXDLMSSecureClient();
dlms.CustomObisCodes = man.ObisCodes;
var media = new Gurux.Net.GXNet(Gurux.Net.NetworkType.Tcp, "192.168.0.120", 6001);
media.Open();
var reader = new GXDLMSReader(dlms, media, TraceLevel.Info);
reader.InitializeConnection();
reader.GetAssociationView(false);
if (reader != null)
{
reader.Close();
}
================
The code above works perfectly for .NET Framework.
But for .NET core, it stuck at the line InitializeConnection.
Here is the error detail
System.Net.Sockets.SocketException
HResult=0x80004005
Message=A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
Source=Gurux.Net
StackTrace:
at Gurux.Net.GXNet.Send(Object data, String receiver)
Any suggestion or any client example for .NET Core specifically?
Thanks.
I can use GXDLMSDirector to read the meter. IP and port is correct.
The same code in .NET Framework also works fine.
Has problem only when use .NET Core.
No matter I run VS2017 (15.7.3) as admin or normal user.
Gurux.DLMS for .NET Core failed to initialize net connection
Hi,
This is tested in Windows and it works without problems. What operating system you are using?
BR,
Mikko
It is Windows 10 Pro
It is Windows 10 Pro build 1709.
I'd placed a sample project for further investigation here if you like
https://1drv.ms/u/s!AnPKv5Tv5gkOlrxVct1llMmE61WKVg
Gurux.DLMS for .NET Core failed to initialize net connection§
Hi,
Can you connect with GXDLMSDirector? Check your IP address and port number.
BR,
Mikko
Yes
I can use GXDLMSDirector to read the meter. IP and port is correct.
The same code in .NET Framework also works fine.
Has problem only when use .NET Core.
No matter I run VS2017 (15.7.3) as admin or normal user.
Gurux.DLMS for .NET Core failed to initialize net connection
Hi,
We made one change to Gurux.Net component.
Update version to 8.1.1808.701.
Let me know if you still have problems.
BR,
Mikko
Splendid!
The updated version works perfectly.
Thanks to you guys.