Skip to main content
Home
for DLMS smart meters

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
  • Gurux Club
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. EDMI Meter block Connection over TCP/IP

EDMI Meter block Connection over TCP/IP

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By sachinar007, 23 August, 2022
Forums
Gurux.Net

Hi Mikko,

We are using EDM meter over TCP/IP ie. interface as Wrapper. As per vendor he says that, the meter can support 3 active client connections.

Our application is multithreaded, so in a thread we connect meter, takes data and close it. While doing this we have observer that while initiating connection there is source and destination port. if the source port is changing as an when request is send to meter it consider new connection to meter and opens new client and so on. after it reaches max client count it blocks new connection to meter for inactivity time out.

we try to set it to minimum 3-5 seconds but after some time it blocks the connect for long time.

Can you please suggest me how to handled this issue. sharing you wireshark logs.

Image
Profile picture for user Kurumi

Kurumi

1 year 1 month ago

Hi,

Hi,

Are you calling disconnect before closing the connection?
Are you calling the Close-method for the media component?

BR,
Mikko

sachinar007

1 year 1 month ago

Hi Mikko,

Hi Mikko,

I am calling below function after every data fetch request. also in final block I check for the reader , client and media to close or assign null.

public void Close()
{
if (Media != null && Client != null)
{
try
{

GXReplyData reply = new GXReplyData();
try
{
//Release is call only for secured connections.
//All meters are not supporting Release and it's causing problems.
if (Client.InterfaceType == InterfaceType.WRAPPER ||
(Client.InterfaceType == InterfaceType.HDLC && Client.Ciphering.Security != Security.None))
{
ReadDataBlock(Client.ReleaseRequest(), reply);
}
}
catch (Exception ex)
{
//All meters don't support Release.
//Console.WriteLine("Release failed. " + ex.Message);
}
reply.Clear();
ReadDLMSPacket(Client.DisconnectRequest(), reply);
Media.Close();
}
catch
{

}
Media = null;
Client = null;
}
}

Profile picture for user Kurumi

Kurumi

1 year 1 month ago

Hi,

Hi,

I believe that you have a problem with your code. Check why the source port is changing. That should be the same at all times. It might be easier to find the reason if you try with one client.

BR,
Mikko

sachinar007

1 year 1 month ago

Hi Mikko,

Hi Mikko,

Just for you information, I have the smart meters also with the interface type as Wrapper. this meters are working with same logger only encryption part is additional.

In my application I am creating thread for each time it connect to meter, takes data and disconnect the meter. this is the life cycle of thread.
while next time for same meter, application initiate new thread follow the life cycle and exit. so on for all the meters configured in logger. This is working fine for other interface type also. No 2 or more thread can connect to singe meter at the same time. so if considering this it may be possible that source port change during communication.

Please suggest how handle this port changing issue. can we fix source port for each meters.

as you suggested, I have tried by using GuruxDirector it works fine for single meter at time ( connect, takes data and disconnect).

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

Fri, 09/22/2023 - 19:50
gurux.dlms.c 20230922.1
Mon, 09/18/2023 - 13:51
Gurux.DLMS.AMI4 4.0.2309.1801
Fri, 09/15/2023 - 12:00
gurux.dlms.c 20230915.1
Tue, 09/12/2023 - 11:10
Gurux.DLMS.AMI4 4.0.2309.1201
Fri, 09/08/2023 - 10:59
gurux.dlms.c 20230908.1

Open bugs

gurux.dlms.c
3
gurux.dlms.cpp
3
gurux.dlms.delphi
1

New forum topics

  • problem with date and time in ION
  • Permament rejected
  • DLMS- GMAC: SNRM, AARQ, AARE is responding but not able to decrypt the Authentication key received from the meter
  • List complete policy security configuration basic (configuration security))
  • Save Association view in database
More

Who's new

  • azcah
  • Robertciz
  • Ilushikqtg
  • Margaretyhs
  • Mariohag
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin