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. Gurux.dlms.java

gurux.dlms.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 C dV , 29 July, 2021
Forums
Gurux DLMS for Java

Hi,

Ive been trying to re create the code Under the README for the gurux.dlms.client.example.java/
but I can't get the code compiled. I've never used Github before either so maybe 'm looking in the wrong place or overlooking a download for the source files.

I'm just trying to establish a connection to my meter and then read data from it. I've already connected to the meter using GXDLMSDirector but I want to get that data automatically every half hour. Any suggestions or can you possibly point me in the right direction please.

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,
You didn't tell what compiler you are using, but if you are using Eclipse, you need to select "Import" and then "Existing Maven Project".

You need to install maven before you can build this.

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

My apologies.

My apologies.

I'm using NetBeans but I tried to build it as a Java SE application.
do I need to install Maven using NetBeans or is it already built in.
Should I instead try to compile it as a Java Application using Maven?

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

No problems. I haven't use NetBeans for a while, but if I remember right you need to install the plugin for maven to NetBeans.

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

Hi,

Hi,

I Have NetBeans and I've got maven installed. I have gurux.dlms-4.0.26.jar as a dependency and can import GXDLMSClient into my code. I'm trying to follow the example code on http://www.gurux.fi/Gurux.DLMS.Client but can't get it to compile. the readDLMSPacket method is giving me problems and its being used in quite a lot of operations. do you maybe have some insight on what I'm doing wrong. For a few days now I just cannot get the code compiled.

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

Run this:

mvn clean package

It will download all needed packages and build the project. There are also other dependencies than gurux.dlms.

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

I've done this and that's why I am confused because it still is not compiling. after running mvn clean package is when I can see the.jar under dependencies in the projects tree view of netBeans. With this I'm assuming that it was compiled but I'm in the same place as when I just manually imported the jar life as a library without using maven. Is there maybe a complete piece of code that returns something when run just so I can test whether or not everything (maven and netbeans) is working as its supposed to

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

I just test this with the clean PC. I installed Java and Eclipse 12.4. Then Selected "Open Project" and selected folder where gurux.dlms.client.example.java is. It seems that the maven plugin is not needed anymore.
Then I selected "Clean and Build". Everything worked without problems or errors.

What is the error that you are receiving?

BR,
Mikko

C dV

4 years 10 months ago

HI,

HI,

There's no errors in the code or anything and when I build it using command line there's no problems.
I'm getting Plugin (Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved) when i say clean and build in netbeans . even if I create a new Maven project I get the same Issue Is it maybe an issue with how I've installed maven?

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

This is maven issue. Can you un-install Netbeans and then install the latest version? Maybe it helps?`
BR,
Mikko

C dV

4 years 10 months ago

HI,

HI,
I was using an old netbeans the last one oracle released I uninstalled it and installed the latest version of Apache netbeans and I can compile fine but now there's an error when i run sampleclient.java (Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0) is this still the IDE is it possibly that i have 2 mavens installed one externally installed and one that is installed by default with the IDE.

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

I'm sorry, but I can't help with this one. It worked without problems with a clean PC. I hope that you can solve this.

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

Hi Mikko,

Hi Mikko,

Ive devcided to use eclipse and now there's no issues .Another question, when I run sampleclient in gurux.dlms.client.example whats supposed to happen all I see is the Settings.showhelp() output . Where do i set my parameters I thought maybe in the console but after running the program terminates.

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

If you are running an application from the eclipse you can set correct parameters when you select "Debug As" and "Debug Parameters" from the pop-up menu.

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

Hi,

Hi,

I can run it now but all I see is communication Logs, I'm assuming its taking long because its reading the association view. is it possible for me to just get a value from a certain logical or short name to save time? Sorry for all the questions I'm very new to how smart meters work and this protocol seems very complex.

also i get a few errors in the console when running but they're all the same.
(Aug 03, 2021 12:11:35 PM gurux.dlms.GXDLMSClient parseLNObjects INFO: Unknown object : 10056 0.1.240.6.0.255)
is this just an item that is not in my meters association view?

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

Unknown object means that this is manufacturer specific object and it's not defined in DLMS standard. The structure and the meaning of the object are unknown.

You can read values without reading the association view. Comment association view (or save it to the file) and add objects what you want to read. You need to know the object type and logical name.

You can save the association view using -o parameter.

BR,
Mikko

C dV

4 years 10 months ago

Hi Mikko,

Hi Mikko,

Does the -o parameter write data about the association view into a xml file that is then read by GXDLMSObjectCollection? I'm getting an exception (ParseError at [row,col]:[1,1]).
and because of this another exception is triggered saying premature end of file. My file that I point to using the -o parameter is empty, is this the cause?

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

I believe that is the reason. You must give association file parameter like this:

-o out.xml

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

HI,

HI,

Can the file be anywhere or must it be is the same directory as the project?

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

It can be anywhere you like if you give the path.

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

Hi,

Hi,

I think I'm missing something here. the file that the -o parameter is pointing to is not supposed to be empty right? Meaning I should copy the data of the association view into there but how do I do that.

or am I completely misunderstanding what the purpose of that -o parameter is.

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi,

Hi,

-o will save and load the association view to the file, so you don't need to read it from the meter. It makes reading much faster. Something like this:

-o association.xml

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi, by Kurumi

Hi,

Hi Mikko,

I've tried everything with my arguments to try and get just one item instead of the association view.
is there maybe a way to save the association view to an XML file using GXDLMSDirector and then I can just point to that file using -o in eclipse?

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

Hi C dV,

Hi C dV,

I notest that association view is not read again if association file is corrupted. This is now fixed. Get the latest version from the client example and try again.

BR,
Mikko

C dV

4 years 10 months ago

In reply to Hi C dV, by Kurumi

Hi Mikko,

Hi Mikko,

The latest version fixes the problem. Thanks for the help it is very much appreciated.

  • 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