Hello, I'm trying to connect to a meter I tried using GXDLMSDirector and it's connecting
but when I use the gurux library for C# and I connected using the same parameters I get this error
Opening serial port...
Port opened: COM7
Connecting to meter...
Standard: DLMS
IEC Sending:/?!
IEC received: /ISk8\2MIE5E-300
Connection failed:
System.Exception: Unknown baud rate.
at Gurux.DLMS.Reader.GXDLMSReader.InitializeOpticalHead() in C:\Users\user\source\repos\Meter\Meter\GXDLMSReader.cs:line 775
at Gurux.DLMS.Reader.GXDLMSReader.InitializeConnection() in C:\Users\user\source\repos\Meter\Meter\GXDLMSReader.cs:line 856
at Program.Main() in C:\Users\user\source\repos\Meter\Testing\Test5.cs:line 55
Disconnecting from the meter.
Release from the meter.
Connection closed.
I tried connecting a different meter using my C# code and it's connecting no problem
parameters used in both
BaudRate 300
Client address 1
Physical address 17
Logical address 1
InterfaceType HDLCWithModeE
Authentication Low
Timeout 5000
same password
Hi, Thank you for pointing…
Hi,
Thank you for pointing this out.
Iskraemeco use baud-rate 57600 in new meters. This is updated to client example. Get the latest version.
https://github.com/Gurux/Gurux.DLMS.Net/blob/3c44a52bd01fc853ea2ac8098d…
Regards,
Mikko
Yeah, I noticed that and…
Yeah, I noticed that and added it myself. Thank you so much for keeping up with the forum!
I have another problem now. There is a meter that I’m trying to connect to, but with my C# code it only connects successfully the first time. After that, I have to restart my program before I can connect to the meter again.
However, when I use GXDLMSDirector, it keeps connecting consistently without any problems. I tried looking through the GXDLMSDirector GitHub repository to understand what is different between it and the client example, but the code is quite complicated for me to follow.
I also noticed that when I connect to the meter and don’t send any requests for a long time, the next read request sometimes just times out. I saw that GXDLMSDirector has a `KeepAlive()` function.
How could I implement something similar in my reader script? Could `KeepAlive()` be related to the connection issue I’m having?
Hi, The meter has an…
Hi,
The meter has an inactivity timeout. The meter closes the connection if you don't read anything for the given time period.
You can read the inactivity timeout from the IEC HDLC Setup or just read something from the meter. The best way to read data from the meter is to close the connection after reading. Then reconnect before the next read.
https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSIecHdlcSetup
You need to read something during the inactivity timeout.
Regards,
Mikko