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. Unable To Read Data.

Unable to Read data.

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 Mithun Tiruvedula , 11 March, 2021
Forums
Gurux DLMS for Java

Hi all,

I'm relatively new to DLMS and associated development. I'm trying to build a Tridium Niagara driver for DLMS. I am using the sources from
https://mvnrepository.com/artifact/org.gurux/gurux.dlms/4.0.24
https://mvnrepository.com/artifact/org.gurux/gurux.net/1.0.21
https://mvnrepository.com/artifact/org.gurux/gurux.common/1.0.17
in my own project directory as I want to make changes to the library and use it accordingly.
PFA my project structure (projectStructure.png).
I am using the simulated server from https://github.com/Gurux/gurux.dlms.java/tree/master/gurux.dlms.server… as the meter.

I was able to read data from the server perfectly when I used the jars alone (maven dependency download and build) instead of adding the souces to my project. However, since I included the sources I am having a couple of errors:

1. Compile error in gurux\dlms\asn\GXPkcs8.java (https://github.com/Gurux/gurux.dlms.java/blob/aa4fd90704cdf87add5f14af8…) line 112. The error is as follows:
"Usage of API documented as @since 1.9+" in intelliJ.

To cirumvent this compiler error I changed the line from
PKCS8EncodedKeySpec ecpks = new PKCS8EncodedKeySpec(data, tmp.get(0).toString());
to
PKCS8EncodedKeySpec ecpks = new PKCS8EncodedKeySpec(data);
which led a sucessfull compilation and then to error 2 listed below.

2. After compilation, my module could connect to the server successfully but could not read any attributes, as every read call would lead to the error https://github.com/Gurux/gurux.dlms.java/blob/aa4fd90704cdf87add5f14af8… (line 273)
"Failed to receive reply from the device in given time." in the client side (my module).
And the error on server side had many along the lines of
Invalid HDLC Frame: d6 Expected: b6
Invalid HDLC Frame: d6 Expected: b6
Invalid HDLC Frame: f8 Expected: b6
Invalid HDLC Frame: f8 Expected: b6
Invalid HDLC Frame: 1a Expected: b6

Am I doing something wrong here? Any help would be deeply appriciated!!
Should I post the complete rx tx logs?

Thanks and regards,
Mithun
Leanovate Solutions

Image

Mithun Tiruvedula

5 years 3 months ago

The compiler error in more

The compiler error in more detail

gurux\dlms\asn\GXPkcs8.java:124: error: constructor PKCS8EncodedKeySpec in class PKCS8EncodedKeySpec cannot be applied to given types;
PKCS8EncodedKeySpec ecpks = new PKCS8EncodedKeySpec(data, tmp.get(0).toString());
^
required: byte[]
found: byte[],String
reason: actual and formal argument lists differ in length

Profile picture for user Kurumi

Kurumi

5 years 3 months ago

Hi,

Hi,

You are using Java source code and because you seems to use Android Studio I believe that Android is better for you.
https://github.com/Gurux/Gurux.DLMS.Android

BR,
Mikko

Mithun Tiruvedula

5 years 2 months ago

Hi,

Hi,

I am actually using Intellij as an IDE and Gradle to build the jar, similar to Android, but different from Android as this is a regular Java SE JAR, not an APK, and runs in Tridium Niagara (a regular Java environment).

The compile error does not occur when I use the org.gurux *JARs* from Maven instead of the *sources*.
Nevertheless, on your suggestion, I will try the android package and comment how it goes!

Thanks,
Mithun,
Leanovate Solutions

  • 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