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. Failed To Receive Reply From The Device In Given Time

Failed to receive reply from the device in given time

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 Badi3 , 11 October, 2016
Forums
Gurux.DLMS

Hi all,

I'm trying to connect to the CX2000 Meter but I always occur an issue in the AARQ request.

Please find below the log:

15:17:59 Initializing Network connection.
15:18:01 Send SNRM request.
7E A0 08 02 21 05 93 56 95 7E
15:18:02 Received data
7E A0 21 05 02 21 73 80 BC 81 80 14 05 02 00 F0 06 02 00 F0 07 04 00 00 00 01 08 04 00 00 00 01 48 DC 7E
15:18:02 Parsing UA reply.<CR><LF>81 80 14 05 02 00 F0 06 02 00 F0 07 04 00 00 00 01 08 04 00 00 00 01
15:18:02 Parsing UA reply succeeded.
15:18:02 Send AARQ request
7E A0 45 02 21 05 10 93 9E E6 E6 00 60 36 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 53 41 47 30 30 30 30 33 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 FE 1F FF FF 31 24 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
15:18:23 Failed to receive reply from the device in given time.
System.Exception: Failed to receive reply from the device in given time.

Could you help me please.

Thanks a lot

Profile picture for user Kurumi

Kurumi

9 years 8 months ago

CX2000

Hi,

We do not have your meter so I can't test this, but usually one of following settings is wrong.
Password, Server Address, Client Address or Use Logical name referencing.

Can you connect without authentication (None)? If you can, then I believe that your client address is wrong. Client address is changing when authentication level changes.

BR,
Mikko

BR,
Mikko

Badi3

9 years 8 months ago

In reply to CX2000 by Kurumi

Hi Mikko,

Hi Mikko,

Thank you for your reply.

I think that this issue is caused from authentification. In fact, I have to use the MD5 one.

Vould you send me an example of .obx file where password is hashed with MD5?

thanks.

BR,
Badi3

Profile picture for user Kurumi

Kurumi

9 years 8 months ago

In reply to Hi Mikko, by Badi3

CX2000

Hi,

You can create new OBIS file or select MD5 to authentication level.
Then just add password and it's done.

BR,
Mikko

Badi3

9 years 8 months ago

In reply to CX2000 by Kurumi

Hi,

Hi,
Thank you for your reply.

I am using the project gurux.dlms.client.example.java and I updated the passowrd and set the authentification type to MD5 but it doesn't work.

Can I send you the class to double check please?

Thank you in advance.

BR,
Badi3

Profile picture for user Kurumi

Kurumi

9 years 8 months ago

CX2000

Hi,

Can we access your meter using Internet? Send email to me if we can we can try to check this.

BR,
Mikko

Badi3

9 years 8 months ago

In reply to CX2000 by Kurumi

Hi,

Hi,
Unfortunately the IP is not a public address.

Share me your e-mail and I'll send you the needed informations.

Thanks a lot.

Regards,

Badi3

9 years 8 months ago

Hi,

Hi,
Below my main class:

package gurux.dlms.client;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.PrintWriter;

import gurux.common.IGXMedia;
import gurux.dlms.enums.Authentication;
import gurux.dlms.manufacturersettings.GXManufacturer;
import gurux.dlms.manufacturersettings.GXManufacturerCollection;
import gurux.dlms.secure.GXDLMSSecureClient;
import gurux.net.GXNet;
import gurux.net.enums.NetworkType;
import gurux.terminal.GXTerminal;

public class sampleclient {

public static void main(String[] args) {
GXCommunicate com = null;
PrintWriter logFile = null;
try {
logFile = new PrintWriter(
new BufferedWriter(new FileWriter("logFile.txt")));

com = getManufactureSettings(args);
// If help is shown.
if (com == null) {
return;
}
com.initializeConnection();
com.readAllObjects(logFile);
} catch (Exception e) {
System.out.println(e.toString());
} finally {
if (logFile != null) {
logFile.close();
}
try {
///////////////////////////////////////////////////////////////
// Disconnect.
if (com != null) {
com.close();
}
} catch (Exception Ex2) {
System.out.println(Ex2.toString());
}
}
System.out.println("Done!");
}

static GXCommunicate getManufactureSettings(String[] args)
throws Exception {
IGXMedia media = new GXNet();
GXCommunicate com;
String path = "ManufacturerSettings";
try {
if (GXManufacturerCollection.isFirstRun(path)) {
GXManufacturerCollection.updateManufactureSettings(path);
}
} catch (Exception ex) {
System.out.println(ex.toString());
}
// 4059 is Official DLMS port.
String id = "SAG", host = "197.26.18.67", port = "4059", pw = "SAG00003";
boolean trace = false, iec = true;
Authentication auth = Authentication.HIGH_MD5;
int startBaudRate = 9600;
String number = null;
for (String it : args) {
String item = it.trim();
if (item.compareToIgnoreCase("/u") == 0) {
// Update
// Get latest manufacturer settings from Gurux web server.
GXManufacturerCollection.updateManufactureSettings(path);
} else if (item.startsWith("/m=")) {
// Manufacturer
id = item.replaceFirst("/m=", "");
} else if (item.startsWith("/h=")) {
// Host
host = item.replaceFirst("/h=", "");
} else if (item.startsWith("/p=")) {
// TCP/IP Port
media = new gurux.net.GXNet();
port = item.replaceFirst("/p=", "");
} else if (item.startsWith("/sp=")) {
// Serial Port
if (media == null) {
media = new gurux.serial.GXSerial();
}
port = item.replaceFirst("/sp=", "");
} else if (item.startsWith("/n=")) {
// Phone number for terminal.
media = new GXTerminal();
number = item.replaceFirst("/n=", "");
} else if (item.startsWith("/b=")) {
// Baud rate
startBaudRate = Integer.parseInt(item.replaceFirst("/b=", ""));
} else if (item.startsWith("/t")) {
// Are messages traced.
trace = true;
} else if (item.startsWith("/s=")) {
// Start
String tmp = item.replaceFirst("/s=", "");
iec = !tmp.toLowerCase().equals("dlms");
} else if (item.startsWith("/a=")) {
// Authentication
auth = Authentication.valueOf(
it.trim().replaceFirst("/a=", "").toUpperCase());
} else if (item.startsWith("/pw=")) {
// Password
pw = it.trim().replaceFirst("/pw=", "");
} else {

return null;
}
}
if (id.isEmpty() || port.isEmpty()
|| (media instanceof gurux.net.GXNet && host.isEmpty())) {

return null;
}
////////////////////////////////////////
// Initialize connection settings.
if (media instanceof GXNet) {
GXNet net = (GXNet) media;
net.setPort(Integer.parseInt(port));
net.setHostName(host);
net.setProtocol(NetworkType.TCP);
}
else {
throw new Exception("Unknown media type.");
}
GXDLMSSecureClient dlms = new GXDLMSSecureClient();
GXManufacturerCollection items = new GXManufacturerCollection();
GXManufacturerCollection.readManufacturerSettings(items, path);
GXManufacturer man = items.findByIdentification(id);
System.out.println("man**** "+man);
if (man == null) {
throw new RuntimeException("Invalid manufacturer.");
}
dlms.setObisCodes(man.getObisCodes());
com = new GXCommunicate(5000, dlms, man, iec, auth, pw, media);
com.Trace = trace;

dlms.setClientAddress(16);
dlms.setServerAddress(1);
return com;
}
}

Badi3

9 years 8 months ago

In reply to Hi Mikko, by Badi3

Hi,

Hi,
Below my obx file in which I put my config.
I used GXDLMSDirector and connection works fine!
So, I tried to put the same config in the obx file but it doesn't work too.

<?xml version="1.0" encoding="utf-8"?>
<GXManufacturer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
<Identification>SAG</Identification>
<Name>SAGEMCOM</Name>
<NetworkType>TCP</NetworkType>
<UseLN>true</UseLN>
<InactivityMode>None</InactivityMode>
<WaitTime>7000</WaitTime>
<ObisCodes>
<GXObisCode>
<LogicalName>0.0.1.0.0.255</LogicalName>
<Interface>Clock</Interface>
<ObjectType>8</ObjectType>
<Attributes />
</GXObisCode>
</ObisCodes>
<StartProtocol>DLMS</StartProtocol>
<Settings>
<GXAuthentication>
<Type>HIGH_MD5</Type>
<ClientID xsi:type="xsd:unsignedByte">2</ClientID>
<Password>SAG00003</Password>
</GXAuthentication>
</Settings>
<ServerSettings>

<GXServerAddress>
<HDLCAddress>0</HDLCAddress>
<Formula />
<PhysicalAddress xsi:type="xsd:unsignedByte">16</PhysicalAddress>
<LogicalAddress>1</LogicalAddress>
</GXServerAddress>
<GXServerAddress>
<HDLCAddress>1</HDLCAddress>
<PhysicalAddress xsi:type="xsd:unsignedByte">16</PhysicalAddress>
<LogicalAddress>1</LogicalAddress>
</GXServerAddress>
<GXServerAddress>
<HDLCAddress>2</HDLCAddress>
<PhysicalAddress xsi:type="xsd:unsignedByte">16</PhysicalAddress>
<LogicalAddress>1</LogicalAddress>
</GXServerAddress>

</ServerSettings>
</GXManufacturer>

Any Help please?!!

BR,
Badi3

  • 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