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. No AARE Response Received

No AARE response received

By muhammad ahmed , 23 May, 2024
Forums
Gurux.DLMS

Hello Sir,

I have been stuck with a problem for a long time. I am trying to get the meter data using TCP/IP. I assigned this IP to the meter using the manufacturer-provided application: 13.201.58.127:9090. I am perfectly able to fetch data using the COM port in Gurux Director, but I am unable to do it with TCP/IP.

I created a server that listens to port 9090, on which I am sending the SNRM request and parsing the UA response. However, when sending the AARQ request, I am not receiving any AARE response. I am using the Gurux Python client to get the data.

Please tell me if I am doing anything wrong in the server configuration or using the Python client. I need your help. I am posting the response from the listening port server and the reply, as well as the Python client response and server code.

Please help me solve this issue.

Server Response:

Server listening on port 9090
Connection from ('13.201.58.127', 35706)
Sending SNRM request...
Waiting for UA response...
Raw UA response: 000100100001001f601da109060760857405080101be10040e01000000065f1f0400001e5dffff
Reading DLMS packet...
Parsing UA response...
Sending AARQ request...
AARQ packet sent, waiting for AARE response...
No AARE response received.
Connection to ('13.201.58.127', 35706) closed
_______________________________________________________________________

PYTHON CLIENT RESPONSE:

root@ip-172-31-44-127:~/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python# python3 main.py -h 13.201.58.127 -p 9090 -i WRAPPER -t Verbose
gurux_dlms version: 1.0.149
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Standard: Standard.DLMS
TX: 00:21:22 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 5D FF FF
RX: 00:21:22 7E A0 07 03 21 93 0F 01 7E
DisconnectRequest
Count
Ended. Press any key to continue.
_______________________________________________________________________

SERVER CODE :


import socket
import time
from gurux_dlms import GXDLMSClient, GXReplyData, GXByteBuffer, Authentication

def read_dlms_packet(client, data):
print("Reading DLMS packet...")
reply = GXReplyData()
try:
client.getData(data, reply)
except Exception as e:
print(f"Error reading DLMS packet: {e}")
return reply

def handle_client(client_socket):
client_address = 17 # Set according to your meter's specifications
server_address = 1 # Set according to your meter's specifications
client = GXDLMSClient(True, client_address, server_address, Authentication.LOW, b'\x00\x00\x00\x00\x00\x00\x00\x00')

try:
# Send SNRM request
print("Sending SNRM request...")
data = client.snrmRequest()
client_socket.sendall(data)

# Receive UA response
print("Waiting for UA response...")
reply = client_socket.recv(1024)
if not reply:
print("No UA response received.")
return
print(f"Raw UA response: {reply.hex()}")
ua_response = read_dlms_packet(client, reply)
print("Parsing UA response...")
client.parseUAResponse(ua_response)
except Exception as e:
print(f"Error during SNRM/UA exchange: {e}")
return

try:
# Send AARQ request
print("Sending AARQ request...")
for packet in client.aarqRequest():
client_socket.sendall(packet)
print("AARQ packet sent, waiting for AARE response...")

# Optional delay to ensure server has time to respond
time.sleep(1)

reply = client_socket.recv(1024)
if not reply:
print("No AARE response received.")
return
print(f"Raw AARE response: {reply.hex()}")
aare_response = read_dlms_packet(client, reply)
print("Parsing AARE response...")
client.parseAAREResponse(aare_response)
print("AARE response successfully parsed.")
except Exception as e:
print(f"Error during AARQ/AARE exchange: {e}")

def main():
HOST = '0.0.0.0' # Listen on all available network interfaces
PORT = 9090 # The port number to listen on

# Create a socket object
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

# Bind the socket to the host and port
server_socket.bind((HOST, PORT))

# Listen for incoming connections
server_socket.listen(5) # Queue up to 5 requests

print("Server listening on port", PORT)

try:
while True:
# Accept incoming connections
client_socket, address = server_socket.accept()
print(f"Connection from {address}")

# Handle client requests
handle_client(client_socket)

# Close the client socket
client_socket.close()
print(f"Connection to {address} closed")
except KeyboardInterrupt:
print("Server stopped")
finally:
server_socket.close()
print("Server socket closed")

if __name__ == "__main__":
main()

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hello, I don't know what…

Hello,

I don't know what meter you are using, but the meter returns HDLC frame for your WRAPPER frame. Try to change interface.
Try like this:

python3 main.py -h 13.201.58.127 -p 9090 -i HDLC -t Verbose

BR,
Mikko

muhammad ahmed

2 years 2 months ago

I am using a Holley meter…

I am using a Holley meter. After changing it to HDLC as you instructed, I have passed that stage, but now I am encountering this issue.
____________________________________________

SERVER RESPONSE :

Server listening on port 9090
Connection from ('13.201.58.127', 53556)
Sending SNRM request...
Raw UA response: 7ea0070321930f017e
Reading DLMS packet...
Sending AARQ request...
Sending request and waiting for response...
Raw response: 7ea0070321930f017e
Reading DLMS packet...
Error during DLMS communication: 'GXByteBuffer' object has no attribute 'extend'
Connection to ('13.201.58.127', 53556) closed
____________________________________________

Python CLIENT RESPONSE

root@ip-172-31-44-127:~/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python# python3 main.py -h 13.201.58.127 -p 9090 -i HDLC -t Verbose
gurux_dlms version: 1.0.149
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Standard: Standard.DLMS
TX: 14:33:01 7E A0 07 03 21 93 0F 01 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 14:33:17 7E A0 07 03 15 93 CD D0 7E 7E A0 2B 03 15 10 39 7E E6 E6 00 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 5D FF FF B3 E2 7E
DisconnectRequest

muhammad ahmed

2 years 2 months ago

And please also let me know…

And please also let me know if I am on the right path or not. Am I using the correct method for communication with their meter? We have to create our own server that will listen to specific IP addresses and handle all the requests for the server. Like I shared the code and assigned that IP to the meter, then hit that IP with the client.

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hi, Try to first read your…

Hi,

Try to first read your meter with GXDLMSDirector. One of your settings is different than the meter expects and the meter doesn't reply.

You need to find the correct settings. Do you have any documentation that might help you with that?

If you don't, add a hex trace from the first message that the manufacturer software sends. You can get that e.g. with WireShark. Only the first message is enough.

BR,
Mikko

muhammad ahmed

2 years 2 months ago

This is the first message…

This is the first message which we received when we listen to our port this will help ? or we have to do it with wire shark ?

Raw data: b'\x00\x01\x00\x01\x00\x11\x00\x12\xdd\x100000002898000018'

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hi, This is just the…

Hi,

This is just the beginning of the data, but I can see that the meter is using WRAPPER and ciphered connection. It might be that you need to establish the secured connection to the meter.

I believe that you need to establish secured connection to the meter. Try to use client address 0x1 and server address 0x1. Interface is probably the WRAPPER.

There are so many ways how meters are implementing this, that you must check this from the meter manual. There is no simple instructions what you should send when meter establish the connection to the server.

BR,
Mikko

muhammad ahmed

2 years 2 months ago

these are the logs which i…

these are the logs which i receive when i connect using COM port check it there is any thing which can help us ?

-S COM3:300:7EvenOne -i HdlcWithModeE -c 17 -a Low -P 00000000 -w 1 -f 128 -t Verbose
______________________________________
GXDLMSDirector 9.0.2404.1801
Log created 3:47:11 PM
15:47:14 Initializing serial connection.
15:47:15 IEC Sending:/?!<CR><LF>
15:47:16 HDLC received: /HLY5\2DTSD545<CR><LF>
-S COM3:300:7EvenOne -i HdlcWithModeE -c 17 -a Low -P 00000000 -w 1 -f 128 -t Verbose15:47:16 BaudRate is : 9600
3:47:16 PM Moving to mode E.
06 32 35 32 0D 0A
3:47:19 PM Send SNRM request.
7E A0 07 03 23 93 BF 32 7E
3:47:19 PM
7E A0 20 23 03 73 CB 2D 81 80 14 05 02 03 10 06 02 03 10 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E
15:47:19 Parsing UA reply succeeded.
3:47:19 PM Send AARQ request.
7E A0 44 03 23 10 56 B7 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 30 30 30 30 30 30 30 30 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 62 1E 5D FF FF 11 4C 7E
3:47:19 PM
7E A0 44 23 03 30 5C B6 E6 E7 00 61 36 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 88 02 07 80 89 07 60 85 74 05 08 02 01 BE 10 04 0E 08 00 06 5F 1F 04 00 00 18 1D 03 00 00 07 3A E8 7E
15:47:19 Parsing AARE reply succeeded.
15:47:21 --- Collecting objects. ---
3:47:21 PM Collecting objects
7E A0 19 03 23 32 DF EB E6 E6 00 C0 01 C1 00 0F 00 00 28 00 00 FF 02 00 91 53 7E
________________________________

Profile picture for user Kurumi

Kurumi

2 years 2 months ago

Hi, Connecting with a serial…

Hi,

Connecting with a serial port and TCP/IP connection are different things.

If I understand correctly your meter is connecting to the server (auto connect) and then you want to read data from the meter. It might be that you are using GPRS connection and your meter is using a dynamic IP address. If that is the case, read this:

https://www.gurux.fi/Gurux.DLMS.DynamicIP

I propose that you connect first to your meter using a direct TCP/IP connection. There are many settings and if any of them is different from what your meter expects, the meter will not respond to anything.

Meter manufacturers have implemented the auto connect differently and you need the meter documents that describe what you need to do.

BR,
Mikko

muhammad ahmed

2 years 1 month ago

Yes, you are right; my meter…

Yes, you are right; my meter is using a dynamic IP. I am creating my own server to handle dynamic addresses using sockets in Python. Since you have no examples involving dynamic IPs in Python, could you please clarify what I should expect to receive from e.getInfo()? I need to know what information to pass in the SNRM request or in CL which you are using in readMeter.

Additionally, should I send the SNRM request when dealing with a dynamic IP, or is it only necessary for static IPs?
try {
try (GXNet cl = server.attach(e.getInfo())) {
readMeter(cl);
}
} catch (Exception ex) {
System.out.println(ex.getMessage());
}

muhammad ahmed

2 years 1 month ago

this is what i receive in…

this is what i receive in log when i create dynamic ip server using sockets .what should i do next

Server listening on 0.0.0.0:9090
Connection established from 182.191.136.87:34944 to 0.0.0.0:9090
Initializing communication with device at 182.191.136.87:34944
Full received data: 0001000100110012DD1030303030303032383938303030303138
Extracted MSN hex before processing: 3030303032383938
MSN hex after reversing: 3839383230303030
MSN without reversing: 00002898
Decoded MSN (original order): 00002898
Decoded MSN (reversed order): 89820000
Sending command: 3030303030303030

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, I believe that you don't…

Hi,

I believe that you don't need to send SNRM. Some meters expect that you send AARQ, but some meters allow direct connection and this is the main problem. Only the meter manufacturer knows what you should send and what authentication levels you can use. I hope that the manufacturer has documented that, or it might take a long time to solve the correct values. I can help you to find correct settings if you have manufacturer application that can listen incoming connections and establish the connection if you share the Wireshark log.

If you don't have a manufacturer application you need to ask correct settings from the manufacturer.

BR,
Mikko

BR,
Mikko

muhammad ahmed

2 years 1 month ago

yes i have the applicaiton…

yes i have the applicaiton what do want me to do with it to find the correct setting to made the communication .and i believe this meter allow direct communication because i saw in there application there is nothing related to server address or client address there is just password option which is 00000000 but let me get the logs from wireshark please check if you could help us with that

Image

muhammad ahmed

2 years 1 month ago

these are some logs from the…

these are some logs from the wireshark
0000 00 0c 29 22 42 43 ac 84 c6 09 13 d6 08 00 45 00 ..)"BC........E.
0010 00 53 00 00 40 00 32 06 d6 86 8b 87 24 7b c0 a8 .S..@.2.....${..
0020 01 74 e7 3e 0d 10 0f 3d 56 71 32 15 e5 5c 50 18 .t.>...=Vq2..\P.
0030 fe 8d ec 46 00 00 17 03 03 00 26 0b c2 7d 3e 7a ...F......&..}>z
0040 a2 6b 44 77 73 86 71 a8 1c b2 9c b1 fd 23 bd c4 .kDws.q......#..
0050 2f 85 bd aa 7a 20 78 4d ee 2a 83 ff 1b 0a 2d 07 /...z xM.*....-.
0060 c6 .
Frame 121354: 269 bytes on wire (2152 bits), 269 bytes captured (2152 bits) on interface \Device\NPF_{0FD20B98-6D03-4D35-8F26-DAC1E2B303CF}, id 0
Interface id: 0 (\Device\NPF_{0FD20B98-6D03-4D35-8F26-DAC1E2B303CF})
Interface name: \Device\NPF_{0FD20B98-6D03-4D35-8F26-DAC1E2B303CF}
Interface description: Ethernet0
Encapsulation type: Ethernet (1)
Arrival Time: May 28, 2024 19:36:30.655953000 Pakistan Standard Time
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1716906990.655953000 seconds
[Time delta from previous captured frame: 0.000014000 seconds]
[Time delta from previous displayed frame: 0.000014000 seconds]
[Time since reference or first frame: 1744.522030000 seconds]
Frame Number: 121354
Frame Length: 269 bytes (2152 bits)
Capture Length: 269 bytes (2152 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:tcp:tls]
[Coloring Rule Name: TCP]
[Coloring Rule String: tcp]
Ethernet II, Src: VMware_22:42:43 (00:0c:29:22:42:43), Dst: Tp-LinkT_09:13:d6 (ac:84:c6:09:13:d6)
Destination: Tp-LinkT_09:13:d6 (ac:84:c6:09:13:d6)
Address: Tp-LinkT_09:13:d6 (ac:84:c6:09:13:d6)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: VMware_22:42:43 (00:0c:29:22:42:43)
Address: VMware_22:42:43 (00:0c:29:22:42:43)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 192.168.1.116, Dst: 139.135.36.123
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 255
Identification: 0xb341 (45889)
Flags: 0x40, Don't fragment
...0 0000 0000 0000 = Fragment Offset: 0
Time to Live: 128
Protocol: TCP (6)
Header Checksum: 0x0000 [validation disabled]
[Header checksum status: Unverified]
Source Address: 192.168.1.116
Destination Address: 139.135.36.123
Transmission Control Protocol, Src Port: 3344, Dst Port: 59198, Seq: 12126546, Ack: 2697730, Len: 215
Source Port: 3344
Destination Port: 59198
[Stream index: 0]
[Conversation completeness: Incomplete (12)]
[TCP Segment Len: 215]
Sequence Number: 12126546 (relative sequence number)
Sequence Number (raw): 848398845
[Next Sequence Number: 12126761 (relative sequence number)]
Acknowledgment Number: 2697730 (relative ack number)
Acknowledgment number (raw): 257585884
0101 .... = Header Length: 20 bytes (5)
Flags: 0x018 (PSH, ACK)
Window: 63398
[Calculated window size: 63398]
[Window size scaling factor: -1 (unknown)]
Checksum: 0x7310 [unverified]
[Checksum Status: Unverified]
Urgent Pointer: 0
[Timestamps]
[Time since first frame in this TCP stream: 1744.522030000 seconds]
[Time since previous frame in this TCP stream: 0.000014000 seconds]
[SEQ/ACK analysis]
[Bytes in flight: 26586]
[Bytes sent since last PSH flag: 215]
TCP payload (215 bytes)
Transport Layer Security
TLSv1.2 Record Layer: Application Data Protocol: Application Data
Content Type: Application Data (23)
Version: TLS 1.2 (0x0303)
Length: 210
Encrypted Application Data: 00000000000067466694053970c9225edc5033841fd9fca15cbfe51974b803bf3729dbb7…

Image

muhammad ahmed

2 years 1 month ago

I dont know that the…

I dont know that the previous logs were correct or not but these are some logs which i get from these software. when i read the meter using there software

[2024- 05-28 20:13:09] DCU [2898000015] is Online, IP: 154.80.63.141:46369
Receive From Client (2024-05-28 20:14:53) IP[192.168.1.116:55711]
66 0D 00 0D 00 66 21 0A 32 38 39 38 30 30 30 30 31 35 02 C0 01 81 00 01 00 00 2A 00 00 FF 02 00 9B 17
Send (2024-05-28 20:14:53)DCU: 2898000015 [2898000015]
00 01 00 11 00 01 00 38 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 30 30 30 30 30 30 30 30 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 FF FF
FF 28 00
[2024-05-28 20:14:55] [2898000015]Receive dIms data [startIndex:90 ;endIndexNextPosition: 90]
00 01 00 01 00 11 00 38 61 36 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 88 02 07 80 89 07 60 85 74 05 08 02 01 BE 10 04 0E 08 00 06 5F 1F 04 00 00 18 1D 03
00 00 67
Receive (2024-05-28 20:14:55)DCU: 2898000015 [2898000015]
00 01 00 01 00 11 00 38 61 36 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 88 02 07 80 89 07 60 85 74 05 08 02 01 BE 10 04 0E 08 00 06 5F 1F 04 00 00 18 1D 03
00 00 07
Send (2024-05- 28 20:14:55)DCU: 2898000015 [2898000015]
00 01 00 11 00 01 00 0D C0 01 81 00 01 00 00 2A 00 00 FF 02 00
[2024-05-28 20:14:561 [2898000015 Receive dlms data [startIndex: 120; endIndexNextPosition:1201
00 01 00 01 00 11 00 16 C4 01 81 00 04 10 56 45 58 32 33 30 32 38 39 38 30 30 30 30 31 35
Receive(2024-05-28 20:14: 56) DCU: 2898000015 [2898000015]
00 01 00 01 00 11 00 16 C4 01 81 00 0A 10 56 45 58 32 33 30 32 38 39 38 30 30 30 30 31 35
Send to Client (2024-05-28 20:14:56) IP[192.168.1.116:557111
66 16 00 16 00 66 21 0A 32 38 39 38 30 30 30 30 31 35 02 00 C4 01 81 00 04 10 56 45 58 32 33 30 32 38 39 38 30 30 30 30 31 35 17 17
[2024-05-28 20:14:56] DCU 2898000015 [2898000015]'s Schedule Completed ********
Schedule Description[Read Client Task by Meter Nol
Receive From Client (2024-05-28 20:14:56) IP[192.168.1.116:557111
66 0D 00 0D 00 66 21 0A 32 38 39 38 30 30 30 30 31 35 02 C0 01 81 00 01 00 00 60 01 00 FF 02 00 D1 17
Send (2024- 05-28 20:14:56) DCU: 2898000015 [2898000015]
00 01 00 11 00 01 00 0D C0 01 81 00 01 00 00 60 01 00 FF 02 00

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, You need to connect with…

Hi,

You need to connect with the settings:

Interface type: WRAPPER
client address: 0x11
Server address: 1
Authentication: Low
Password: 00000000

BR,
Mikko

muhammad ahmed

2 years 1 month ago

any what about the snrm aarq…

and what about the snrm aarq request ?do i need to send them ?

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, You must send AARQ and…

Hi,

You must send AARQ and handle AARE.

BR,
Mikko

muhammad ahmed

2 years 1 month ago

thank you for the quick…

thank you for the quick reply so i have to create a dynamic ip server using sockets or i have to only use GXnet to create it? after the connection i have to send the snrm request and handel aarq request right ? and can you also tell me what is tha data SNRM or AAQR is requesting so ill know i am doing it right ?

Profile picture for user Kurumi

Kurumi

2 years 1 month ago

Hi, You can use sockets or…

Hi,
You can use sockets or GXNet.

You need to send AARQ something like:

00 01 00 11 00 01 00 38 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 30 30 30 30 30 30 30 30 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 FF FF FF 28 00

Note! AARQ depends on the arguments used and it might be different.

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • 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

New forum topics

  • 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
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin