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. DLMS Meter Communication Using Java

DLMS Meter Communication Using 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 kumarsoft.parveen , 28 September, 2019
Forums
Gurux DLMS for Java

Dear Sir,
This is parveen from panchkula. i have start a project in DLMS meter reading. My project architecture is following:-

1) DLMS Meters with RF Modules/GPRS connectivity
2) DCU connect with meters using RF modules and send data on server using GPRS mode on a specific TCP/IP port.
3) A Desktop application will run on server and Read data from TCP/IP port and store it into database.
4) A another application will get data from database and after decode it will store decoded data on another database.
5) On Server their will be a website for user . Web site will be use for create demands on DLMS meters and display data on website reports.

We are using ipv6 on DLMS meters and protocol is DLMS2 in energy meters.

I hope you understand the architecture of application.

Now my concern is i want to develop a desktop application which will run on server, Read raw data from database table , decode that data and store into in database. you just help me to provide DLMS Decode library build in java and tell me how i will use it. Raw data is in Encoded form please explain how i will decode it and store it into database.

Please help me out in this. I am using My Eclipse IDE 2019 4.0

kumarsoft.parveen

6 years 8 months ago

Hello Sir,

Hello Sir,
Please revert. its urgent

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi Kumarsoft,

Hi Kumarsoft,

We are not working on Saturday and Sunday.

You should check gurux.dlms.client.example.java. I believe it's what you are looking for.
You can get it here:
https://github.com/Gurux/Gurux.DLMS.java

BR,
Mikko

kumarsoft.parveen

6 years 8 months ago

In reply to Hi Kumarsoft, by Kurumi

Ok, Thanks for your revert

Ok, Thanks for your revert sir,
I have already download but i don't know how i will execute it. I need a dll file which accept only security key , auth key, and encripted data and gives me the output. I also want to know how we can send and receive the command on DLMS meter. I am using my eclipse but i don't know how to run the project.

i have data plz check.
0001 0001 0040 0059 DB08 414D 4530 3030 3033 4E20 0000 000E BA89 5500 9E9E 53AE 1604 92EA 2985 72C6 3EBE 8ED8 6675 590C 5388 3D71 53CD 7228 A2B5 AF99 D4BF 765D F491 9CB1 E76A A1C0 3F17 F27F 72E7 BECE 1F06 C2CF 5F16 64FB DA6F A3D1 9EDB 7A0B 29

this frame is encrepted

auth key is TexasInstruments
and security key is TexasInstruments
please resolve and revert me.

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

It's a maven project. Import it as maven project and you can debug it.
You can use GXDLMSTranslator to convert data to XML format. Like this:

http://www.gurux.fi/GuruxDLMSTranslator?translate=0001000100400059DB084…

BR,

Mikko

kumarsoft.parveen

6 years 8 months ago

In reply to Ok, Thanks for your revert by kumarsoft.parveen

Dear Sir,

Dear Sir,
you just convert data packet into xml. i want to know how i will decode it. Please decrypt it first after that decode. Please explain me how can i decode this data using your API. please explain sir.
0001 0001 0040 0059 DB08 414D 4530 3030 3033 4E20 0000 000E BA89 5500 9E9E 53AE 1604 92EA 2985 72C6 3EBE 8ED8 6675 590C 5388 3D71 53CD 7228 A2B5 AF99 D4BF 765D F491 9CB1 E76A A1C0 3F17 F27F 72E7 BECE 1F06 C2CF 5F16 64FB DA6F A3D1 9EDB 7A0B 29

kumarsoft.parveen

3 years 9 months ago

Hi,

Hi,
I have imported it as a maven project. Now please guide what is the next step for communication with meter. My meter is connecting using GXDLMSDirector using TCP/IP with IPV6. My meter is encryption enabled and working on wrapper. Please tell me the next step how i can download my Number Plate of my meter.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

There are several different parameters and if one of them is different from what the meter expects the connection fails.
Download GXDLMSDirector and try to connect with it. It will show the command line parameters so it's easier for you to connect.

Try to connect without an encrypted connection first. It's easier in that way. Change interface from HDLC to WRAPPER.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Its ok. But i want to know

Its ok. But i want to know what is the starting step which i use to run the application in java.
I am easily connect with meter using GXDLMSDirector.
Which java file i run first for connect.
In which file i set parameter for connect with meter.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

Download client example and give command line parameters that GXDLMSDirector is showing when you select the meter.

https://github.com/Gurux/gurux.dlms.java/tree/master/gurux.dlms.client…

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Hi Mikko,

Hi Mikko,
Thanks for replying. I already downloaded this example. In gurux.dlms.client.example.java there are for java files like GXDLMSReader.java, GXDLMSSecureClient2.java ,sampleclient.java and Settings.java file. From these files sampleclient.java having main function. after running this file i got below output.

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.
-a Authentication (None, Low, High, HighMd5, HighSha1, HighGMac, HighSha256).
-P Password for authentication.
-c Client address. (Default: 16)
-s Server address. (Default: 1)
-n Server address as serial number.
-l Logical Server address.
-r [sn, ln] Short name or Logical Name (default) referencing is used.
-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.
-C Security Level. (None, Authentication, Encrypted, AuthenticationEncryption or DigitallySigned)
-V Security Suite version. (Default: Suite0). (Suite0, Suite1 or Suite2)
-K Used Key agreement scheme (OnePassDiffieHellman or StaticUnifiedModel).
-v Invocation counter data object Logical Name. Ex. 0.0.43.1.1.255
-I Auto increase invoke ID
-o Cache association view to make reading faster. Ex. -o C:\device.xml
-T System title that is used with chiphering. Ex -T 4775727578313233
-A Authentication key that is used with chiphering. Ex -A D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF
-B Block cipher key that is used with chiphering. Ex -B 000102030405060708090A0B0C0D0E0F
-D Dedicated key that is used with chiphering. Ex -D 00112233445566778899AABBCCDDEEFF
-d Used DLMS standard. Ex -d India (DLMS, India, Italy, SaudiArabia, IDIS)
-E Export client and server certificates from the meter. Ex -E 0.0.43.0.0.255.
-R Generate new client and server certificates and import them to the server. Ex. -R 0.0.43.0.0.255.
-i Used communication interface. Ex. -i WRAPPER.
-m Used PLC MAC address. Ex. -m 1.
-W General Block Transfer window size.
-w HDLC Window size. Default is 1
-f HDLC Frame size. Default is 128
-L Manufacturer ID (Flag ID) is used to use manufacturer depending functionality. -L LGZ
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 -S COM1 -i
Read Indian device using serial port connection.
GuruxDlmsSample -S COM1 -c 16 -s 1 -a Low -P [password]

Now please tell where i can put command line parameters. Please help me out.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

If you are running this from the eclipse, select "Debug as" and "Debug configuration...". Then add those parameters to the "Arguments" tab.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Got it. I have 2 meter. One

Got it. I have 2 meter. One is without Authentication and another is with Authentication. I am able to connect with without Authentication meter after passing the arguments. But i am unable to connect with Authentication meter after passing the arguments. I am getting the error
"Invalid parameter: India"
I am able to connect with GXDLMSDirector with Authentication. I just copy the command line parameters from GXDLMSDirector and past it in arguments tab.

Please guide me where i am doing wrong.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

I believe that you haven't add -d before India.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Thanks. Code is working fine.

Thanks. Code is working fine. If i add some code from my side like decoded data insert in database then which file i use or i create my standalone java file.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

You need to use them all. It's easiest if you modify the example for your needs.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Is any normal and encrypted

Is any normal and encrypted java decode packet file available. If yes then please let me know

kumarsoft.parveen

3 years 9 months ago

I need a packet decoder both

I need a packet decoder both normal or encrypted. Is there code available in java in which i insert received packet as it is and i received decoded or decrypted data.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

They are both in the same jar package. I need to warn you that DLMS is not an easy protocol. There is no simple frame (packet) that you send and get a reply. The PDU may come in multiple parts and each PDU might come in multiple frames (packets).

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Please give me a simple

Please give me a simple example to decode small packet

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

You can use GuruxDLMSTranslator for that. Online version is available here:
http://www.gurux.fi/GuruxDLMSTranslator

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Hi Mikko,

Hi Mikko,
Downloading is working. Please tell me how i can decode normal DLMS packets or Encrypted packets Or provide me any reference from there i can learn and decode data packets. Or provide me any other solution.

I want when i receive packet i just decode it on same time and extract meaning full information.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

There is no simple answer to that. DLMS is a very complicated protocol. You need to read following standards:

IEC 62056-42 Physical Layer Services and Procedures for Connection-Oriented Asynchronous Data Exchange
IEC 62056-46 Data link layer using HDLC protocol
IEC 62056-47 COSEM transport layers for IPv4 networks
IEC 62056-53 COSEM application layer
IEC 62056-61 OBIS Object identification system
IEC 62056-62 Interface objects

I strongly prose that you use Gurux open-source libraries.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

This is very time consuming.

This is very time consuming. Is there any alternate or any service provide by you regarding decode received packet data. If any then please tell me.

Also tell me the which Gurux open-source libraries are present to decode the data.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

It's not just decoding the packet data. You must establish the connection for the meter and handle all cases. Reading DLMS meters is not an easy task.

You can use Java, C#, python, ANSI C or ANSI C++ programming languages.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Is there any paid service

Is there any paid service which can help me to decode all received packet data or provide me java code in which i insert received packet and that code revert me decoded data.

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

This is possible to do. Send an email to me so we can talk more about this option.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Hi,

Hi,
Is there any code in java which can set the configurations in dlms meters. Also tell me where we use gurux.dlms.xmlClient,
gurux.dlms.simulator.java,
gurux.dlms.server.example.java

Provided by you.

My email id is [email removed]

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

The client example is a good starting point. You can use it to do everything that you want to do.
You will use GXDLMSClient to communicate with the meter.

BR,
Mikko

kumarsoft.parveen

3 years 9 months ago

Hi,

Hi,
Using Java client example i am able to downloads all from meters using command line argument but if i want to download only Inst data or billing data then what will be the command line string

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

You can read single attributes with -g argument. I have to say that this is only an example and I believe that the best way is if you modify it for your needs. You need to give start and end time for read rows by range method and that is not in command line parameters. Check this out:

https://github.com/Gurux/gurux.dlms.java/blob/250a86fda9ec481aabf485fca…

BR,
Mikko

kumarsoft.parveen

2 years 6 months ago

I have imported it in…

I have imported it in eclipse and code is working fine. I have create a connection using GXDLMSDirector , copy data from commend line and put it in Arguments in eclipse while running sipleclient.java. Smart Meter is communicating fine.

Now i want to know how can i download Complete Meter Inst data, Billing data, load profile data , event data, block load survey data in single single command and what parameters i will us in cmd line for doing this downloading task.

Profile picture for user Kurumi

Kurumi

2 years 6 months ago

Hi, You can use the client…

Hi,

You can use the client example to read your meter.

https://github.com/Gurux/gurux.dlms.java/tree/master/gurux.dlms.client…

Then you need to read only the needed values and save them to thee database.

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