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. Reading Meter Data Through Java Client

Reading meter data through Java client

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 aeeccims@tnebnet.org , 17 October, 2021
Forums
Gurux DLMS for Java

Hi

I am new to DLMS meter reading subject.

I wrote a java program to read the socket and able to read the meter data which pushed in regular intervals in plain text.

However, the other meter data are designed to be fetched from meter after hand shaking with modem as below: And i am able to get the reply from modem as "PMOK". After that I have to send command to meter (modem is made transparent) . Here I struck. I initiated a client java passing the modem ip and port and not getting result.

C:\Apache-Tomcat-8.5.32\webapps>java NewClass
It is now : Sun 2021.10.17 at 10:36:53 PM IST
Accepted Client Address - 10.254.0.207Meter IP:10.254.0.207port52968
Client Says :*STATUS,ONLINE,INST,#
Server Says : *PULLMODE#@01@
Waiting
false
false

Says : +++*STATUS,ONLINE,NOIN,#
Says :*PM@01@OK#*STATUS,OFFLINE,NOIN,#
Says : *PULLMODE#@01@ // From HES to Modem
Waiting
true
Server Says >>>: *PM@01@OK#*STATUS,OFFLINE,NOIN,# // From Modem to HES
true
////////////////////////////////////////////////
In other Command prompt run the following:

C:\Apache-Tomcat-8.5.32\webapps>java -jar gurux.dlms.client.example.java.jar -h 10.254.0.207 -a Low -P PRIDE -r sn -t Verbose -p 52968 -c 16 -s 1
Connect using network connection gurux.net.GXNet@19469ea2
Authentication: Low
ClientAddress: 0x10
ServerAddress: 0x1
Connection refused: connect
///////////////////////////////////////////////////

I thought if the modem sends ":*PM@01@OK#" , I can initiate the client program from the java application to get reading of meters . Is it in right direction?

Guidance is requested to proceed further.

Profile picture for user Kurumi

Kurumi

4 years 7 months ago

Hi,

Hi,

Connection refused: connect means that your TCP/IP port is wrong. You need to check it.

BR,
Mikko

aeeccims@tnebnet.org

4 years 7 months ago

Hi

Hi
Accepted Client Address - 10.254.0.207 IP:10.254.0.207 port: 52968

The ip >>> Modem ip received that was connected.
port >> Modem IP received that was connected.

Is it correct or something else

Profile picture for user Kurumi

Kurumi

4 years 7 months ago

Hi,

Hi,

The error message is clear:
Connection refused: connect

The client can't establish the connection to the given port number.
What kind of modem you are using? Is it connected to the serial port or are you accessing it by TCP/IP address?

BR,
Mikko

MrSupe

4 years 2 months ago

How to set timeout (in java

How to set timeout (in java package) to kill process in case to last long time?
Thanks
Peter.

Profile picture for user Kurumi

Kurumi

4 years 2 months ago

In reply to How to set timeout (in java by MrSupe

Hi Peter,

Hi Peter,

Please, create a new topic if you have a new question. I'll answer your question then.
https://www.gurux.fi/ForumRules

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