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. Problem Connecting To a Meter

Problem connecting to a meter

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 bleg , 26 December, 2018
Forums
General discussion

Hello Gurux.
I need to connect to a SamGas GPRS meter, and i think i need some expert's help.

The meter is GPRS-type. When it establishes a TCP/IP connection, i accept it at my server, open another listening socket, and pipe them together, so that i can use DLMS Director for further communication.
(I tested this scheme on gurux server example and it works fine)

Meter's companion documentation declares that Public Client (0x10) is restricted to local optical port only. So i guess I have no ability to connect to it. (I will try though, with little hope)

The Management client (0x01) is AES-128 GCM protected, and its Association is marked as Pre-established. All i got is the 128-bit key for management client (unique for every meter)

Here is what i try to read data from the meter using DLMS Director:
1. Server ID is not provided in companion documentation, so i try:
0x7E CALLING Physical Device Address
0x01 Management Logical Device Address

2. Client ID = (0x01) - Management Client

3. Security type:
It's not provided in companion documentation, but since it's AES-128 GCM, i set it to "Authorization & Encryption"
There are two fields: Authorization key and Block Cipher - so i put the 128bit key into both of them.
Is that correct thing to do?

4. Client System Title - provided by companion documentation (same for all meters)

5. Frame counter - I set the opion "Read automatically" and I put the LN of Frame counter Object, mentioned in companion documentation.

6. Server system title - this is tricky. Management client is described to have a pre-established AA. But public client is not allowed through GPRS, do i have any options to read system title somehow? I know how to generate it from meter's serial number, but i have several meters, and i have to distinguish them in advance.

Feeding the above options to DLMS Director - meter does not respond in DLMS terms (Only sends ACK to my TCP packets).

I tried above scheme with None security type. And the meter sent back a binary message 2B2B2B (do you know what it means?
The log is always like:
23:00:33 Initializing Network connection.
23:00:34 Send SNRM request.
7E A0 08 02 FD 03 93 2A EB 7E
23:00:39 Failed to receive reply from the device in given time.
23:00:39 Disconnect request
23:00:39 Send Disconnect request.
7E A0 08 02 FD 03 53 26 2D 7E
23:00:44 Failed to receive reply from the device in given time.

Kind regards.
Thank you for any thoughts on this.

Profile picture for user Kurumi

Kurumi

7 years 5 months ago

Problem connecting to a meter

Hi,

We'll have also SamGas meters at the office and you should be able to read them using Management client and serial port. It's also possible that it's changed, but we can read our meters.

Change authentication to GMAC.
Change Interface from HDLC to WRAPPER.

Also, make sure that you are using the right keys. There are three different keys.

Ciphering is making the meter reading more harder. If one of the values is not correct, the meter doesn't reply anything.

BR,
Mikko

bleg

7 years 5 months ago

Thank you for the answer.

Thank you for the answer.
I only have one key for AES. Can it be that this key is used in every place needed?

Also, I tried pre-established read, and this is what i get. Do you have any suggestions where to go from here?
GXDLMSDirector 8.1.1812.0702
Log created 20:48:50
21:00:55 Initializing Network connection.
21:00:55 09:00:55.335 Info Opening
21:00:55 09:00:55.341 Info Client Settings: Protocol Tcp Host: <myhost> Port: <myport>
21:00:55 09:00:55.347 Info Open
21:00:57 Read object type Data index: 1
00 01 00 01 00 01 00 14 C8 12 20 00 00 00 A5 94 5F D8 BD D2 2C 92 D6 E7 46 80 8D 4D
<WRAPPER len="1C" >
<TargetAddress Value="1" />
<SourceAddress Value="1" />
<PDU>
<glo_GetRequest Value="20000000A5945FD8BDD22C92D6E746808D4D" />
</PDU>
</WRAPPER>

21:00:57 09:00:57.824 Sent 00 01 00 01 00 01 00 14 C8 12 20 00 00 00 A5 94 5F D8 BD D2 2C 92 D6 E7 46 80 8D 4D
21:00:59 09:00:59.169 Received 00 01 00 01 00 01 00 03 D8 01 03
21:00:59 Received data:
00 01 00 01 00 01 00 03 D8 01 03
<WRAPPER len="B" >
<TargetAddress Value="1" />
<SourceAddress Value="1" />
<PDU>
<Data="0103" />
</PDU>
</WRAPPER>

Gurux.DLMS.GXDLMSException: Meter returns Service not allowed exception. Other reason
в GXDLMSDirector.GXDLMSCommunicator.Read(Object sender, GXDLMSObject obj, Boolean forceRead)
в GXDLMSDirector.MainForm.Read(Object sender, GXAsyncWork work, Object[] parameters)
21:01:03 09:01:03.583 Info Closing
21:01:03 09:01:03.583 Info Closed

Profile picture for user Kurumi

Kurumi

7 years 5 months ago

Problem connecting to a meter

Hi,

Block Cipher and Authentication keys are same in Italy standard. Change Security from Encryption to AuthenticationEncryption.

You need to read Frame Counter before connecting using Management. Now it's zero.

BR,

Mikko

bleg

7 years 5 months ago

Mikko, thank you for your time.

Debugging DLMS is a real pain.
I did read the invocation counter from the device using Public client.
Then changed the security to AuthenticationEncryption.

Below is what i got now.
Can you please explain what that could be?
Thank you again.

23:00:11 Initializing Network connection.
23:00:11 11:00:11.362 Info Opening
23:00:11 11:00:11.417 Info Client Settings: Protocol Tcp Host: ... Port: ...
23:00:11 11:00:11.417 Info Open
23:00:13 Read object type Data index: 1
00 01 00 01 00 01 00 20 C8 1E 30 00 00 01 EF 9D 46 88 96 3B 43 89 DD 99 6B D1 49 77 F3 92 69 23 5E 51 E0 BD C9 ED DA 65
<WRAPPER len="28" >
<TargetAddress Value="1" />
<SourceAddress Value="1" />
<PDU>
<glo_GetRequest Value="30000001EF9D4688963B4389DD996BD14977F39269235E51E0BDC9EDDA65" />
</PDU>
</WRAPPER>

23:00:13 11:00:13.994 Sent 00 01 00 01 00 01 00 20 C8 1E 30 00 00 01 EF 9D 46 88 96 3B 43 89 DD 99 6B D1 49 77 F3 92 69 23 5E 51 E0 BD C9 ED DA 65
23:00:15 11:00:15.342 Received 00 01 00 01 00 01 00 1F CC 1D 30 00 00 02 5E 1F F8 90 68 1E D9 A8 AE 77 FB 05 65 C5 A7 3B 14 3B C1 E1 3A 6F D0 69 FE
23:00:15 Received data:
00 01 00 01 00 01 00 1F CC 1D 30 00 00 02 5E 1F F8 90 68 1E D9 A8 AE 77 FB 05 65 C5 A7 3B 14 3B C1 E1 3A 6F D0 69 FE
<WRAPPER len="27" >
<TargetAddress Value="1" />
<SourceAddress Value="1" />
<PDU>
<glo_GetResponse Value="300000025E1FF890681ED9A8AE77FB0565C5A73B143BC1E13A6FD069FE" />
</PDU>
</WRAPPER>

System.ArgumentException: Invalid Command.
в GXDLMSDirector.GXDLMSCommunicator.Read(Object sender, GXDLMSObject obj, Boolean forceRead)
в GXDLMSDirector.MainForm.Read(Object sender, GXAsyncWork work, Object[] parameters)

Profile picture for user Kurumi

Kurumi

7 years 5 months ago

Problem connecting to a meter

Hi,

You are right on that debugging encrypted data is the real pain. Meter is answering something, but because I don't know the encryption keys, I don't know what meter replies.

One possibility is that you buy consulting services from. I can help you better using Teamviewer.

BR,

Mikko

bleg

7 years 5 months ago

Thank you Mikko.

Thank you Mikko.
I would very much like to have a consultancy.
Can you contact me in private (email) or i can give you a call.
BR

bleg

7 years 5 months ago

One last question:

One last question:
even with unparsable (yet) reply, the invocation counter on the device has incremented.
Is this any good sign?
BR,
Bleg

Profile picture for user Kurumi

Kurumi

7 years 5 months ago

Problem connecting to a meter

Hi,

Because invocation counter is increased and a reply is received, it seems that meter has accepted the request.

BR,

Mikko

bleg

7 years 4 months ago

thank you

thank you

  • 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