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. TCP Wrapper Meter Authentication and Nameplate Reading

TCP Wrapper Meter Authentication and Nameplate Reading

By niralldas8@gmail.com , 2 April, 2025
Forums
Gurux DLMS for Android

I am trying to connect to a TCP Wrapper meter but am facing issues with authentication and reading the meter nameplate details. Could you please clarify the authentication procedure for a wrapper meter? Is it the same as the HDLC settings, or does it require a different approach?

Currently, I am following this sequence:

1. SNRM

2. AARQ

3. Read Invocation

4. Increment Invocation Counter (+1)

5. Disconnect

6. SNRM

7. AARQ Increment IC (+1)

8. AARE Increment IC (+1)

9. getApplicationAssociationRequest(true) Increment IC (+1)

10. client.read(serialNoFetchedMeter, 2) Increment IC (+1)

Despite following these steps, I am unable to authenticate and retrieve the meter's nameplate details. I would appreciate any guidance on the correct procedure for authentication in wrapper mode.

Looking forward to your support.

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

Hi, Just change the…

Hi,

Just change the interface type from HDLC to WRAPPER and change the client and server addresses.

BR,
Mikko

niralldas8@gmail.com

1 year 2 months ago

Hi Sir, After Disconnect…

Hi Sir,
Thank You for you response.
After Disconnect Command, I am Adding meter properties :-
Interface Type - WRAPPER
Authentication - US (HIGH)
Client Address - 48 (30)
Physical Server - 1
Logical Server - 0
Auth key -
Block cipher key -
password -
system title - LTCLIENT
Security Suite - Suite0
Security - AuthenticationEncryption
Frame Counter - 0.0.43.1.3.255

In GXDLMS tool i am able to download but through mobile unable to download

Response:-
000100100001001F601DA109060760857405080101BE10040E01000000065F1F0400001E1DFFFF
000100010010002B6129A109060760857405080101A203020100A305A103020100BE10040E0800065F1F0400000010030C0007
00100100001000DC001C1000100002B0103FF0200
0001000100100009C401C100060000FFF6
Reading invocationCounter Value DLMS is 65526
00010010000100056203800100
bytesreceived1 is 0D
==> Skipping SNRM
AARQ - 000100300001005F605DA109060760857405080103A60A04084C54434C49454E548A0207808B0760857405080202AC1280105F5BD264A3095847B3894952FCB74F71BE230421211F300000FFF787AE65ABD510E46551AB9C89F3A8887297CD69531B4511A43DC6
AARE
000100010030006B6169A109060760857405080103A203020100A305A10302010EA40A04084C4E544100317E5D88020780890760857405080202AA1280106162636465666768696A6B6C6D6E6F70BE230421281F300000C830507051767CD3D97D3D3F81834EE8A9AF3BE8069D8CFFBCECFD3E

client.getIsAuthenticationRequired()==false
0001003000010020C81E300000FFF8043263775D1D291B73F6D6FECEF4F824917A417FE175534D92
No Response Received
Downloaded Failure3!!

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

Hi, There is an issue with…

Hi,

There is an issue with your meter, and it doesn't set the IsAuthenticationRequired flag to true.
Change this line:
if (mClient.getIsAuthenticationRequired()) {

to this:
if (mClient.getAuthentication().getValue() > Authentication.LOW.getValue()) {

This is also changed to the example.

BR,
Mikko

niralldas8@gmail.com

1 year 2 months ago

Hi Sir, Thank you for your…

Hi Sir,
Thank you for your response,
i am trying to read getApplicationAssociationRequest but getting error
inside the function here

if (client.getAuthentication().getValue() > Authentication.LOW.getValue()) {

System.out.printf("client.getIsAuthenticationRequired()==true\n");

for (byte[] it : client.getApplicationAssociationRequest()) {
command_obtained = Arrays.copyOfRange(it, 0, it.length);
break;
}

}

public final byte[][] getApplicationAssociationRequest() throws InvalidKeyException,
NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException,
IllegalBlockSizeException, BadPaddingException, SignatureException {

byte[] challenge = GXSecure.secure(settings, settings.getCipher(), ic,
settings.getStoCChallenge(), pw);

public static byte[] secure(final GXDLMSSettings settings, final GXICipher cipher,
final long ic, final byte[] data, final byte[] secret)
throws InvalidKeyException, NoSuchPaddingException, InvalidAlgorithmParameterException,
IllegalBlockSizeException, BadPaddingException, SignatureException {
try {

byte[] d;
if (settings.getAuthentication() == Authentication.HIGH) {
return aes1Encrypt(data, secret);
}
ic =65563
secret =[ 48, 77, 80, 48, 66, 67, 82, 70, 48, 49, 48, 51, 53, 56, 50, 48 ]
Data = null

java.lang.NullPointerException: Attempt to get length of null array

000100010030006B6169A109060760857405080103A203020100A305A10302010EA40A04084C4E544100317E5D88020780890760857405080202AA1280106162636465666768696A6B6C6D6E6F70BE230421281F300000C839C5B424BB85DCE7239D1540A113B8B5E0B023255C7D38075B2C3C

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

Hi, You didn't share the…

Hi,

You didn't share the block cipher and authentication keys, so I can't help you with this.

I believe that the data should be your password. Have you set the password?

BR,
Mikko

niralldas8@gmail.com

1 year 2 months ago

Hi Sir, I added password ,…

Hi Sir,
I added password , block cipher key and authentication key in my code.

i am getting StoC challenge null.

Password: 0MP0BCRF01035820
Block cipher key : 1234567890123456
Authentication key : 1234567890123456

Response:-
000100010030006B6169A109060760857405080103A203020100A305A10302010EA40A04084C4E544100317E5D88020780890760857405080202AA1280106162636465666768696A6B6C6D6E6F70BE230421281F300000C84F6B9314DE2601A6DEB8AD60051D511D7AE66F0355A2275D74C2E0
Total Packet Received!!
000100010030006B6169A109060760857405080103A203020100A305A10302010EA40A04084C4E544100317E5D88020780890760857405080202AA1280106162636465666768696A6B6C6D6E6F70BE230421281F300000C84F6B9314DE2601A6DEB8AD60051D511D7AE66F0355A2275D74C2E0
bytesreceived1 is 73
count4 is 5
invocationCounterValueDLMS is 65589
client.getIsAuthenticationRequired()==true
stoptimertask
Attempt to get length of null array
Downloaded Failure3!!

Profile picture for user Kurumi

Kurumi

1 year 2 months ago

Hi, You can establish the…

Hi,

You can establish the connection, but the next step fails.
Can you generate any message, or is this to getthe length of null array error returned?

What Android version are you using?

BR,
Mikko

niralldas8@gmail.com

1 year 2 months ago

Hi Sir, I am using Android…

Hi Sir,
I am using Android 13, 14 and 10 and i found that I am encountering an issue where the method settings.getStoCChallenge() returns null and could you please confirm whether I am following the correct sequence of steps for reading a ciphered smart meter for tcp wrapper?

niralldas8@gmail.com

1 year 2 months ago

Hi Sir, I recently faced an…

Hi Sir,
I recently faced an issue where settings.getStoCChallenge() was returning null, but I managed to fix that and sending the getapplicationassociation command and getting wrong response

GxDlms Tool -Log:-
Authenticating - 00 01 00 30 00 01 00 32 CB 30 30 00 01 00 A2 59 4D BF AB CE 59 F0 57 59 C5 DA B0 61 6D 7D F5 08 90 90 27 D3 8E 0E CD 35 B7 C4 C3 13 89 D9 0C 36 52 15 EA 3E 54 E8 DD 44 30 0C
Response - 00 01 00 01 00 30 00 2B CF 29 30 00 00 C8 93 6F 41 A7 CA D7 CA DD 4C 4C 65 F8 ED 79 0B 8C 48 83 8B 14 AD 4F BE C2 DD 30 95 5F 9D AB AE EA 2F E3 AB 13 0C
Read serial number - 00 01 00 30 00 01 00 20 C8 1E 30 00 01 00 6C B7 EB F2 FE 6A 0C 6D BD A7 D2 08 43 80 51 12 07 83 F2 8B EF 18 D9 84 FB 26

Android Log:-
Authentication - 0001003000010032CB3030000100BBDC099DEF54F6C20510B30F35360C34B2B7C5A332E98E4D804B181E56D963DACAEE97B5BA983127B24A053E
Response - 0001000100300017CF15300000C8A491273E2D860058F91606FC7A5673DFA0
Server did not accept CtoS.
Read serial number - 00 01 00 30 00 01 00 20 C8 1E 30 00 01 00 8E B3 50 DA 06 2B 7A 03 E8 51 24 8F 9D 81 3A 50 EB 38 2B 24 A5 E5 B3 C3 9E D7

BlockCipher key: 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36
Authentication Key:31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36
1: 00 01 00 01 00 30 00 17 CF 15 30 00 00 C8 A4 91 27 3E 2D 86 00 58 F9 16 06 FC 7A 56 73 DF A0
<WRAPPER len="17" >
<SourceAddress Value="1" />
<TargetAddress Value="30" />
<PDU>
<!-- Invocation Counter: 51364 -->
<!-- Decrypt data: C7 01 C1 FA
<ActionResponse>
<ActionResponseNormal>
# Priority: High, ServiceClass: Confirmed, Invoke ID: 1
<InvokeIdAndPriority Value="C1" />
<Result Value="OtherReason" />
</ActionResponseNormal>
</ActionResponse>
-->
<glo_ActionResponse Value="300000C8A491273E2D860058F91606FC7A5673DFA0" />
</PDU>
</WRAPPER>

Kindly help me..

niralldas8@gmail.com

1 year 2 months ago

Hi Sir, I am trying to send…

Hi Sir,

I am trying to send a disconnect command. However, I am not receiving any response from the meter. Could you please help me understand what might be going wrong or suggest what I should check?

00 01 00 30 00 01 00 05 62 03 80 01 00

Profile picture for user Kurumi

Kurumi

1 year 1 month ago

Hi, If the server didn't…

Hi,

If the server didn't acclept the challenge then the reason is that there is no collection to close and the meter doesn't send a reply.

BR,
Mikko

niralldas8@gmail.com

1 year 1 month ago

Hi Sir, Thank You for you…

Hi Sir,
Thank You for you reply,
I am trying to read billing profile data from meter but getting error as invalid command in android , but i am able to read in GXDLMS Tool .

Android Log
TX - 0001003000010020C81E3000010B0B75DBD9D2FE11A8AF1F291786BB5F8491B1C9B069A0CF5D7FBE
RX - 0001000100300305CC820301300000D240D241B8FE14F7AD76947620679E59BDF1C20E83E5D68C4C6D2FFF90B88FF07EAEF9977B628A0588D2745349C1BFEE4632A006D0AF93B1A4515786701ED574A0C3032EEF22056A204A56C341716ADCC76EEEC2B9B3C131459550AC065EB4C54DED9A92267C5F151521646D937EC4C8ED11E52EFD004DCA13584CCCD0AF58C52EC351B63CFFFEB60700791E1296AD7F5E2EB2F378F0E8A68C8BD39A73714C5EB3777C2F2CF65A54AAB18A64990385B875C3B1B7C288532B0FB8BE96E75F4D41F915A9514C762012F38C6BE65889312117A5E2B385F772788728B59AB8ADC3E2F9268297220D20A2273DDD93FED3C5AD9533E7CF2DBBC79F70FD5E20423CD56EB52496178CCCA3E28FE09F86A3D74E1C479FCA38E3D0F72A215C077D2803FC7F4005A017CA38C5DFFCAF18DF920088739AC06D9DA8F9CA70695721AD66C9F729C48614DAB67DF45B1A83B26520E912E4ABF3BFB54DA2ED0847B330E0AD7A8D96E0FC53F55B66C5D551CD12269D026A7B218ADA53EF84F7D261F30D7AB37147BD79A6BA133D6632FB1713162490D2053F855A4C62338D6D654EC4EAF01C9440EEF12F1BD43B2D4BFC586A7CDA2743529D246D4EC9C579A44C194A1A990E08A13AEBE1ADEA7CFF30DACBCCCE757930AF6AACD5223E0260C16B773838A3AFE369B3A5340FD270E703A1EB4347319CE4E367ABA7CE24623E8B12B065B73271A6D1709CF721BE009E833E110E59DD61D8CF059CF9230D4BDCACE1E85E08E5E66F886F7321E0F1B6146C2C9F4D1F880AF44AF17391F81884AA32A85D74CF3405F0B2DA5479B1632B99231FE767E998783EAF60BC766CC8C4631B50616D771714ADAE2BB8BD14873942E38A8774E38ABA84B794228569FD972A91490E6EA631FBDB028286A86B8C33F6C449907D3A2F5A69F57268A5419728E16103025A3FAE08675622E74487B69E1E88304050EF39675C07BD21C90CC259E2DAFDF98C7CEE6D3897B7E9FAADD7A09358E37AD9096A777230523B8940B44A912BE7C01ED5AE3F37785D5FACECC60668F89939D2AC80BFB90242085AD296E78C764ECE65AB8AAF31
TX - 000100300001001AC8183000010B0CA67491239F0DD9496B85B33171DD09B8B0ED05
RX - 00010001003002A9CC8202A5300000D2419908C7DAA2C0DC4B5C761BB43A47299BB4F30E91EEFC5696AC7B9F042B322F50C90B24375A0A9BA91189DFB2A3280915745EF084E4CB26D9F8FE0A7CCFFFBD373A7C8A0E8BDED571459318B6CB6BCFC1455A757D23130BD0E5712D5C8CE4A100CD3C6526CEB3678CE76497973300CD95976B5A50F295E001481BE2D8E99BBC680FB0C42828467529AEC5104F8F80674659C3D8B240DEE83C80C07D586B1981089FD6DC1A86EDBF520BB98EC199BCC013EA60BDDAECD40FF213D7AC1BADDE6AE8F1E21F9E59F4C28260A1C529E2CE71C4AC08A4F7C5C95B5BEC9DE26712207ABED8EB2CBF6955EFA9BFD3051FB6B25184BED77C6FE14B8F0A610C1128CC4049615BF1985BEBF116E126C0BB7D5812FB1630158F0AC0FC68A7F128CC7ACF243B805C474501F091D1818F30B211FB20682E03F109019D588E4AA9474943D0C925C69BB73FBFA3F195971B348417A5A62C3EA74204CA8A8915C2BC254A8C8859E49D69082E7A999106023EEBFC6FF8A879659F4CE7F10ECD786DCC141FCA63B311202883B98960FEB16E104608629F57490F8D64E621A8EB898BEB05D074E4328A5B1B55CF1303637F5A95BBF65883B9DDCFB2B6C09B2A5F399FFA2AC19A2F2AD86F564A391CC34897C79B641644F28803DBB7E8B6148AE94BAA682CB1E4DD854E7618337AE70AB0B797BE79FB0492424231E8269541095A9D263A6A56E9771DA713F6C73AD472E7F2B8FD99E643F66176D7E820B2E093BD89426B97B4A3E9590D0B20F0E573768A8BA80FCE9E92B81AE675A0BF0D8333409C33A0CA4DCD71A6058A22FD272B78029CB8DEA0FEF9CEDD9C4C939DF43A22E51BC20EEB5C0470463AA8040585BF4D510D0AFF1BCA059DBCC8305609BD71E4DAF2B0AFB3E0F5B9AD5FFE11D2414AC49DE964FC74D8FF06F50F11F53107A4BDD4149E61CB5FAF92B2F8EB
TX - 0001003000010020C81E3000010B0CA6779023980CD8F978C2C046AB78F947D3363CB1CBE0B7A6DD
RX - 00010001003000172E15300000D2427AB978A277CBB20F14EB00D57A1FE5FA
Invalid Command.

Profile picture for user Kurumi

Kurumi

1 year 1 month ago

Hi, This looks more like an…

Hi,

This looks more like an association view than billing profile data. I can't check what you try to read because you are using a different client system title, but the meter data is valid.

BR,
Mikko

niralldas8@gmail.com

1 year 1 month ago

Hi Sir, Hi Sir, I’m facing…

Hi Sir,
I’m facing an issue while reading billing scalar values (1.0.94.91.6.255). If the meter has a next block of data, the invocation counter increments by 1. However, after completing the read and accessing the same OBIS with attribute ID 2, the invocation counter needs to increment by 2 instead.

Additionally, when reading the billing profile data (1.0.98.1.0.255), the invocation counter needs to increment by 4. If I increment it by just 1, I receive the same response again.

BlockCipher key: 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36
Authentication Key:31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36
1: 00 01 00 30 00 01 00 20 C8 1E 30 00 01 0B 0B 75 DB D9 D2 FE 11 A8 AF 1F 29 17 86 BB 5F 84 91 B1 C9 B0 69 A0 CF 5D 7F BE
<WRAPPER len="20" >
<SourceAddress Value="30" />
<TargetAddress Value="1" />
<PDU>
<!-- Invocation Counter: 68363 -->
<!-- Decrypt data: C0 01 C3 00 07 01 00 5E 5B 06 FF 03 00
<GetRequest>
<GetRequestNormal>
# Priority: High, ServiceClass: Confirmed, Invoke ID: 3
<InvokeIdAndPriority Value="C3" />
<AttributeDescriptor>
# ProfileGeneric
<ClassId Value="0007" />
# 1.0.94.91.6.255
<InstanceId Value="01005E5B06FF" />
# CaptureObjects
<AttributeId Value="03" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>
-->
<glo_GetRequest Value="3000010B0B75DBD9D2FE11A8AF1F291786BB5F8491B1C9B069A0CF5D7FBE" />
</PDU>
</WRAPPER>
2: 00 01 00 30 00 01 00 1A C8 18 30 00 01 0B 0C A6 74 91 23 9F 0D D9 49 6B 85 B3 31 71 DD 09 B8 B0 ED 05
<WRAPPER len="1A" >
<SourceAddress Value="30" />
<TargetAddress Value="1" />
<PDU>
<!-- Invocation Counter: 68364 -->
<!-- Decrypt data: C0 02 C4 00 00 00 01
<GetRequest>
<GetRequestForNextDataBlock>
# Priority: High, ServiceClass: Confirmed, Invoke ID: 4
<InvokeIdAndPriority Value="C4" />
<BlockNumber Value="00000001" />
</GetRequestForNextDataBlock>
</GetRequest>
-->
<glo_GetRequest Value="3000010B0CA67491239F0DD9496B85B33171DD09B8B0ED05" />
</PDU>
</WRAPPER>
3: 00 01 00 30 00 01 00 20 C8 1E 30 00 01 0B 0C A6 77 90 23 98 0C D8 F9 78 C2 C0 46 AB 78 F9 47 D3 36 3C B1 CB E0 B7 A6 DD
<WRAPPER len="20" >
<SourceAddress Value="30" />
<TargetAddress Value="1" />
<PDU>
<!-- Invocation Counter: 68364 -->
<!-- Decrypt data: C0 01 C5 00 07 01 00 5E 5B 06 FF 02 00
<GetRequest>
<GetRequestNormal>
# Priority: High, ServiceClass: Confirmed, Invoke ID: 5
<InvokeIdAndPriority Value="C5" />
<AttributeDescriptor>
# ProfileGeneric
<ClassId Value="0007" />
# 1.0.94.91.6.255
<InstanceId Value="01005E5B06FF" />
# Buffer
<AttributeId Value="02" />
</AttributeDescriptor>
</GetRequestNormal>
</GetRequest>
-->
<glo_GetRequest Value="3000010B0CA6779023980CD8F978C2C046AB78F947D3363CB1CBE0B7A6DD" />
</PDU>
</WRAPPER>

Error -
4: 00 01 00 01 00 30 00 17 2E 15 30 00 00 D2 42 7A B9 78 A2 77 CB B2 0F 14 EB 00 D5 7A 1F E5 FA
<WRAPPER len="17" >
<SourceAddress Value="1" />
<TargetAddress Value="30" />
<PDU>
<!-- Invocation Counter: 53826 -->
<!-- Decrypt data: 0E 05 03 02
<ConfirmedServiceError>
<Service Value="05" />
<ServiceError>
<Service Value="ServiceUnsupported" />
</ServiceError>
</ConfirmedServiceError>
-->
<glo_GloConfirmedServiceError Value="300000D2427AB978A277CBB20F14EB00D57A1FE5FA" />
</PDU>
</WRAPPER>

Profile picture for user Kurumi

Kurumi

1 year 1 month ago

Hi, I don't believe that is…

Hi,

I don't believe that is the reason. If the Invocation Counter is used with ciphering and if the value is too small, the meter returns a ciphering error. The DLMS standard says that the IC is increased every time data is encrypted.

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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin