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. Step By Step To Compile Gurux DLMS For Java

Step by Step to compile gurux DLMS for java

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 jenmaster , 20 July, 2018
Forums
Gurux DLMS for Java

Rgds Gurux,
I have downloaded gurux dlms for java. Actually, I am new in java programming.
Can you give me guidance step by step to compile gurux dlms for java until the software run ?

thank

Profile picture for user Kurumi

Kurumi

7 years 10 months ago

Step by Step to compile gurux DLMS for java

Hi,

You need to install Java and Mavan on your PC.
Check more info from here:
https://maven.apache.org/install.html

BR,

Mikko

jenmaster

7 years 10 months ago

In reply to Step by Step to compile gurux DLMS for java by Kurumi

Hi Mikko,

Hi Mikko,
Thanks for the reply. What should the IDE that you recommended to compile gurux DLMS java ?

Profile picture for user Kurumi

Kurumi

7 years 10 months ago

Step by Step to compile gurux DLMS for java

Hi,

Eclipse or NetBeans.

BR,

Mikko

jenmaster

7 years 10 months ago

In reply to Hi Mikko, by jenmaster

Next Step to compile

I have been succeeded to compile gurux.dlms.client.example.java using eclipse. Output of console window as like below

GuruxDlmsSample reads data from the DLMS/COSEM device.
GuruxDlmsSample -h [Meter IP Address] -p [Meter Port No] -c 16 -s 1 -r SN
-h host name or IP address.
-p port number or name (Example: 1000).
-S serial port.
-i IEC is a start protocol.
-a Authentication (None, Low, High).
-P Password for authentication.
-c Client address. (Default: 16)
-s Server address. (Default: 1)
-n Server address as serial number.
-r [sn, sn] Short name or Logican Name (default) referencing is used.
-w WRAPPER profile is used. HDLC is default.
-t [Error, Warning, Info, Verbose] Trace messages.
-g "0.0.1.0.0.255:1; 0.0.1.0.0.255:2" Get selected object(s) with given attribute index.
Example:
Read LG device using TCP/IP connection.
GuruxDlmsSample -r SN -c 16 -s 1 -h [Meter IP Address] -p [Meter Port No]
Read LG device using serial port connection.
GuruxDlmsSample -r SN -c 16 -s 1 -sp COM1 -i
Read Indian device using serial port connection.
GuruxDlmsSample -S COM1 -c 16 -s 1 -a Low -P [password]

What I should do next so the software can read a meter?

jenmaster

7 years 10 months ago

In reply to Step by Step to compile gurux DLMS for java by Kurumi

Next Step to compile

I have been succeeded to compile gurux.dlms.client.example.java using eclipse. Output of console window as like below

GuruxDlmsSample reads data from the DLMS/COSEM device.
GuruxDlmsSample -h [Meter IP Address] -p [Meter Port No] -c 16 -s 1 -r SN
-h host name or IP address.
-p port number or name (Example: 1000).
-S serial port.
-i IEC is a start protocol.
-a Authentication (None, Low, High).
-P Password for authentication.
-c Client address. (Default: 16)
-s Server address. (Default: 1)
-n Server address as serial number.
-r [sn, sn] Short name or Logican Name (default) referencing is used.
-w WRAPPER profile is used. HDLC is default.
-t [Error, Warning, Info, Verbose] Trace messages.
-g "0.0.1.0.0.255:1; 0.0.1.0.0.255:2" Get selected object(s) with given attribute index.
Example:
Read LG device using TCP/IP connection.
GuruxDlmsSample -r SN -c 16 -s 1 -h [Meter IP Address] -p [Meter Port No]
Read LG device using serial port connection.
GuruxDlmsSample -r SN -c 16 -s 1 -sp COM1 -i
Read Indian device using serial port connection.
GuruxDlmsSample -S COM1 -c 16 -s 1 -a Low -P [password]

What I should do next so the software can read a meter?

Profile picture for user Kurumi

Kurumi

7 years 10 months ago

Next Step to compile

Hi,

Run app and give needed parameters.

java -jar gurux.dlms.client.example.java.jar -h IpaddressOfTheMeter -p port number -r sn or ln

BR,

Mikko

subramanian ve…

6 years 4 months ago

Hi Mikko,

Hi Mikko,

Thanks for the reply. Could you kindly help on the below questions:

1) Is the Gurux.Client code is a single threaded model OR can my Thread Application be able to connect multiple IP's at same time using this gurux.client

2) How do we differentiate the LOAD_SURVEY vs DAY_SURVEY vs BILLING_SURVEY? Is it only by input arguments it differs or we have to write seperate code for these SURVEYS?

Profile picture for user Kurumi

Kurumi

6 years 4 months ago

Hi,

Hi,

You need to create own instance for each client. The reason for this is that data is not necessarily come in one packet. There is also connection depends settings. Example frame counters that are increased every time you send a message.

Profile generic data is handled in the same way. The content of the data is different.

BR,
Mikko

subramanian ve…

6 years 4 months ago

Hi Mikka,

Hi Mikka,

Thanks. We are able to setup locally. But when we try to connect the working STATIC IP through our command line method there are no response. Its connecting with Authentication: None, ClientAddress etc, but there are no response further. Its in Hung state.
The command used is: java -jar gurux.client.sample.jar -h StaticIP -p port -r sn

Profile picture for user Kurumi

Kurumi

6 years 4 months ago

Hi,

Hi,

Check that your IP address and port number are correct. Check also your firewall settings.
There is no difference are you connecting using the local or static IP address.

BR,

Mikko

subramanian ve…

6 years 3 months ago

Hi Mikko, I could able to

Hi Mikko, I could able to connect using GXDLMSDirector and could fetch data. PFA screen shot below.

But if i try the same using command line arguments, I am getting the below time out error message.
java -jar gurux.client.jar -h 117.231.125.245 -p 4059 -c 16 -s 1 -r sn
Authentication: None
ClientAddress: 0x10
ServerAddress: 0x1
Connection timed out: connect

If i compare the screen shot below, I need to feed values for the below fields. How do i that through the command arguments.

Start protocol: DLMS
Manufacturer: Indian Standard
Interface: WRAPPER
Media: Net

These are the mandate fields to fetch the data. Please provide your valuable thoughts.

Image
Profile picture for user Kurumi

Kurumi

6 years 3 months ago

Hi,

Hi,

You command line string is like this:
java -jar gurux.client.jar -h 117.231.125.245 -p 4059 -c 16 -s 1 -w

BR,
Mikko

epdcldlms

5 years 11 months ago

In reply to Next Step to compile by Kurumi

Hi,

Hi,
can you please tell me how to pass these parameter through eclipse ide,
how to add security to this.

epdcldlms

5 years 11 months ago

Hi Kurumi,

Hi Kurumi,

while running the client application i got bellow response
can you please check this
Authentication: None
ClientAddress: 0x11
ServerAddress: 0x1
Standard: DLMS
Data send failed. Try to resend 1/3
java.lang.RuntimeException: Invalid connection.
Invalid connection.
at gurux.net.GXNet.send(GXNet.java:409)
at gurux.dlms.client.GXDLMSReader.readDLMSPacket(GXDLMSReader.java:272)
at gurux.dlms.client.GXDLMSReader.readDataBlock(GXDLMSReader.java:365)
at gurux.dlms.client.GXDLMSReader.readDataBlock(GXDLMSReader.java:351)
at gurux.dlms.client.GXDLMSReader.initializeConnection(GXDLMSReader.java:597)
at gurux.dlms.client.GXDLMSReader.readAll(GXDLMSReader.java:1014)
at gurux.dlms.client.sampleclient.main(sampleclient.java:146)

Akash kumar

5 years 3 months ago

I am new to Gurux library for

I am new to Gurux library for Android plateform , can you please guide where to start and how to create a basic demo. I have android studio installed and related package implemented but dont know what to do now. can i create client and server on mobile?

Profile picture for user Kurumi

Kurumi

5 years 3 months ago

Hi Akash,

Hi Akash,

Please, create a new topic if you have a new question. I'm not receiving notifications from old topics like this. I accidentally notest your question.

There is only a client-side implemented for Android.

BR,
Mikko

aeeccims@tnebnet.org

4 years 8 months ago

In reply to Hi Mikka, by subramanian ve…

Hi

Hi

I tried to connect client through client java jar as below:

IP : Client IP (meter IP)
port: mteter port

But error is throwing.

Kindly provide procedure to debug as what is blocking what and how to unblock.

Thank you in advance.

C:\Apache-Tomcat-8.5.32\webapps>java -jar gurux.dlms.client.example.java-0.0.1-SNAPSHOT.jar -h 10.254.0.207 -p 2028 -r ln
Connect using network connection gurux.net.GXNet@19469ea2
Authentication: None
ClientAddress: 0x10
ServerAddress: 0x1
Connection refused: connect

C:\Apache-Tomcat-8.5.32\webapps>java -jar gurux.dlms.client.example.java-0.0.1-SNAPSHOT.jar -h 10.254.0.207 -p 55341 -r ln
Connect using network connection gurux.net.GXNet@19469ea2
Authentication: None
ClientAddress: 0x10
ServerAddress: 0x1
Connection refused: connect

C:\Apache-Tomcat-8.5.32\webapps>java -jar gurux.dlms.client.example.java-0.0.1-SNAPSHOT.jar -h 10.254.0.207 -p 55341 -r ln
Connect using network connection gurux.net.GXNet@19469ea2
Authentication: None
ClientAddress: 0x10
ServerAddress: 0x1
Connection timed out: connect

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

In reply to Hi by aeeccims@tnebnet.org

Hi,

Hi,

Please, add new questions to the end. Sometimes I don't notest them if they are added in the middle.
Connection refused is coming because you can't connect to the meter IP address. Make sure that your meter is using a static address and it's the correct one. Check your port. You are using two different ports here and the meter doesn't reply if it's wrong.

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