Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

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

Breadcrumb

  1. Home
  2. Forums
  3. Reading Dynamic IP Meter

Reading Dynamic IP meter

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 Remith , 13 May, 2020
Forums
Gurux DLMS for Java

Hi,
I am trying to setup a HES by following https://www.gurux.fi/Gurux.DLMS.DynamicIP

I am able to receive Heartbeat, push data . Also able to read meter by attaching to the GXNet.
But the problem is when I am making a separate thread for reading the meter, meter connection getting lost. I have tried so many ways to fix this problem. Still not able resolve. I have given the sample coding part below.

@Override
public void onClientConnected(Object sender, ConnectionEventArgs e) {
System.out.println(String.format("Client '%1$s' is connected.", e.getInfo()));
GXNet server = (GXNet) sender;
try {
try (GXNet cl = server.attach(e.getInfo())) {
readMeter(cl);//THIS WILL WORK. Its not a thread
// new ReadMeter(cl).start(); This will disconnect the meter from the server.
}
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

You will release the connection right away.
You need to move this inside of the thread:

try (GXNet cl = server.attach(e.getInfo())) {
}
Now connection is released when you leave the function.

BR,
Mikko

Remith

6 years ago

Hi,

Hi,
I got it what you said. Thanks for the clarity.
But my doubt is how I can read multiple meter connections same time if I hold this connection?
How I can do on Demand request to read a meter with this logic ?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

Each incoming connection has own TCP/IP port. Or are you using UDP?

BR,
Mikko

Remith

6 years ago

Hi,

Hi,
We are using TCP. The point you said I have understood. My problem is technical.
As per your documentation I have created the below Listener.

public static class ServerListner implements IGXMediaListener, IGXNetListener {

My doubt is, if 100 meter connects in the same time to our server, will it create 100 instance of above Listener?
If I hold the one meter connection for onDemand, all other 99 meter will be accepted by the server in the same time?
Currently I have only one meter for testing. So practically couldn't check.

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

It will create 100 instances from this. There are no delays.

BR,
Mikko

Remith

6 years ago

Thank you very much Mikko..

Thank you very much Mikko..
I will keep this in mind and continue with other works.
I have one more very small doubt(Please don't tell me to create new topic).
In dynamic IP meter can we set different push server address into meter?(Currently heartbeat and push receiving in same server)

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

It depends on the meter, but usually, you can. Try to change the destination attribute from Push setup and see what happens.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin