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. The Client Example

The client example

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 Lukáš Cu , 3 December, 2021
Forums
Gurux DLMS for Java

I am fairly fresh in java in general.
I imported DLMS from github to eclipse and i dont get connection in the default state.
The client responds with
showhelp() function and thats it
The Readme file on github says that i need to set device parameters and alter the code further. But I have no clue where do i put those pieces of code for it to work.

The whole repository is already imported. But a step by step guide on how to actually get a DLSM connection from that point would be very very useful.

Any help would be appreciated. Thank you.

Profile picture for user Kurumi

Kurumi

4 years 7 months ago

Hi Lukáš,

Hi Lukáš,

If one of DLMS parameters is wrong the meter doesn't reply. Unfortunately, parameters depend on the meter and manufacturer.

Try to set TCP/P port or serial port as a parameter and let's hope that meter is using the default parameters.

You can give TCP parameters like:
-h YOUR_METER_IP_ADDRESS - p METER_PORT

and serial port like:

-P COM1

BR,
Mikko

Lukáš Cu

4 years 7 months ago

I have already solved the

I have already solved the issue. But thank you very much. The repository is a great one.

Profile picture for user Kurumi

Kurumi

4 years 7 months ago

Hi,

Hi,
Thank you for letting me know. I'm sorry about the slow reply but yesterday was Finland's Independence Day and it was a public holiday.

BR,
Mikko

Sandeep Shaw

4 years 5 months ago

Using the below code to write

Using the below code to write time into the Meter

val item: GXDLMSAutoAnswer =
settings.client.objects.findByLN(ObjectType.AUTO_ANSWER,"0.0.1.0.0.255" )

item.listeningWindow.add(
AbstractMap.SimpleEntry<GXDateTime, GXDateTime>(
GXDateTime(-1, -1, -1, 6, -1, -1, -1),
GXDateTime(-1, -1, -1, 8, -1, -1, -1)
)
)
val mData = settings.client.write(item, 2)
for(i in 0 until mData.size){
reader?.readDLMSPacket(mData.get(i), GXReplyData())
}

I am unable to cast GXDLMSObject to GXDLMSAutoAnswer getting the below error even though I am connected to the meter
java.lang.NullPointerException: null cannot be cast to non-null type

Please help
Thanks in Advance

Profile picture for user Kurumi

Kurumi

4 years 5 months ago

In reply to Using the below code to write by Sandeep Shaw

Dear Sandeep Shaw,

Dear Sandeep Shaw,

Create a new topic if you have a new question.
http://gurux.fi/ForumRules

Create a new topic and I'll answer your question there.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200
  • Mon, 06/15/2026 - 08:52
    gurux.dlms.c 9.0.2606.1501

New forum topics

  • Service not known error on gprs communication
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • @Hmd- several '.
  • Dawsontot
  • Jerrylam
  • qvlLdJweKzGUYaSOVS
  • LindanEt
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin