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. GXDLMSNotify.parsePush() Dosen't Work For All Push Message Types

GXDLMSNotify.parsePush() dosen't work for all push message types

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 pramodahanya , 18 December, 2018
Forums
Gurux DLMS for Java

We have a problem while parsing the push Interval_1(0.1.25.9.0.255) message. The error we get is "[B cannot be cast to [Ljava.lang.Object;". On debugging we identified that the ordering of the objects is important. The method GXDLMSNotify.parsePush(final Object[] data) expects the first object in the data to be an ObjectArray(data[0]) but in our case, for Push Interval_1 message from the meter it is a byte array and here the class cast exception is thrown. The parsing is working fine for installation case.
Below are the messages received from the meter for OnInstallation and Interval_1 and their xml translations.

Push On Installation

00 01 00 01 00 66 00 9E 0F 00 00 00 28 0C 07 E2 0C 12 02 10 20 3A 0B FF C4 00 02 04 01 04 02 04
12 00 28 09 06 00 07 19 09 00 FF 0F 02 12 00 00 02 04 12 00 28 09 06 00 07 19 09 00 FF 0F 01 12
00 00 02 04 12 00 30 09 06 00 00 19 07 00 FF 0F 04 12 00 00 02 04 12 00 01 09 06 00 00 2A 00 00
FF 0F 02 12 00 00 09 06 00 07 19 09 00 FF 01 02 09 10 FD 8D 1A 2E 4B C6 00 00 2E 44 FD FF FE 28
2C AA 09 10 FE 80 00 00 00 00 00 00 2E 44 FD FF FE 28 2C AA 09 10 44 4E 56 31 32 33 34 35 36 37
38 39 30 31 32 33

<WRAPPER len="166" >
<TargetAddress Value="1" />
<SourceAddress Value="102" />
<PDU>
<DataNotification>
<LongInvokeIdAndPriority Value="40" />
<!--2018-12-18 16:32:58-->
<DateTime Value="07E20C120210203A0BFFC400" />
<NotificationBody>
<DataValue>
<Structure Qty="4" >
<Array Qty="4" >
<Structure Qty="4" >
<UInt16 Value="40" />
<!--0.7.25.9.0.255-->
<OctetString Value="0007190900FF" />
<Int8 Value="2" />
<UInt16 Value="0" />
</Structure>
<Structure Qty="4" >
<UInt16 Value="40" />
<!--0.7.25.9.0.255-->
<OctetString Value="0007190900FF" />
<Int8 Value="1" />
<UInt16 Value="0" />
</Structure>
<Structure Qty="4" >
<UInt16 Value="48" />
<!--0.0.25.7.0.255-->
<OctetString Value="0000190700FF" />
<Int8 Value="4" />
<UInt16 Value="0" />
</Structure>
<Structure Qty="4" >
<UInt16 Value="1" />
<!--0.0.42.0.0.255-->
<OctetString Value="00002A0000FF" />
<Int8 Value="2" />
<UInt16 Value="0" />
</Structure>
</Array>
<!--0.7.25.9.0.255-->
<OctetString Value="0007190900FF" />
<Array Qty="2" >
<OctetString Value="FD8D1A2E4BC600002E44FDFFFE282CAA" />
<OctetString Value="FE800000000000002E44FDFFFE282CAA" />
</Array>
<!--DNV1234567890123-->
<OctetString Value="444E5631323334353637383930313233" />
</Structure>
</DataValue>
</NotificationBody>
</DataNotification>
</PDU>
</WRAPPER>

Push Interval 1:
00 01 00 01 00 66 00 9E 0F 00 00 00 29 0C 07 E2 0C 12 02 10 21 05 15 FF C4 00 02 03 09 06 00 01
19 09 00 FF 01 05 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01
00 01 08 01 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 08 02 FF 0F 02 12 00 00 02 04 12 00
03 09 06 01 00 02 08 01 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02 08 02 FF 0F 02 12 00 00
01 01 02 05 09 0C 07 E2 0C 12 02 00 00 00 00 00 00 00 06 00 00 14 02 06 00 00 14 9D 06 00 00 12
2F 06 00 00 12 6B

<WRAPPER len="166" >
<TargetAddress Value="1" />
<SourceAddress Value="102" />
<PDU>
<DataNotification>
<LongInvokeIdAndPriority Value="41" />
<!--2018-12-18 16:33:05-->
<DateTime Value="07E20C120210210515FFC400" />
<NotificationBody>
<DataValue>
<Structure Qty="3" >
<!--0.1.25.9.0.255-->
//For OnInstallation case this value is after the array. We also tried manually putting this value after the array but we got class cast exception for datetime(obis code-0.0.1.0.0.255)
<OctetString Value="0001190900FF" />
<Array Qty="5" >
<Structure Qty="4" >
<UInt16 Value="8" />
<!--0.0.1.0.0.255-->
<OctetString Value="0000010000FF" />
<Int8 Value="2" />
<UInt16 Value="0" />
</Structure>
<Structure Qty="4" >
<UInt16 Value="3" />
<!--1.0.1.8.1.255-->
<OctetString Value="0100010801FF" />
<Int8 Value="2" />
<UInt16 Value="0" />
</Structure>
<Structure Qty="4" >
<UInt16 Value="3" />
<!--1.0.1.8.2.255-->
<OctetString Value="0100010802FF" />
<Int8 Value="2" />
<UInt16 Value="0" />
</Structure>
<Structure Qty="4" >
<UInt16 Value="3" />
<!--1.0.2.8.1.255-->
<OctetString Value="0100020801FF" />
<Int8 Value="2" />
<UInt16 Value="0" />
</Structure>
<Structure Qty="4" >
<UInt16 Value="3" />
<!--1.0.2.8.2.255-->
<OctetString Value="0100020802FF" />
<Int8 Value="2" />
<UInt16 Value="0" />
</Structure>
</Array>
<Array Qty="1" >
<Structure Qty="5" >
<!--2018-12-18 00:00:00-->
<OctetString Value="07E20C120200000000000000" />
<UInt32 Value="5122" />
<UInt32 Value="5277" />
<UInt32 Value="4655" />
<UInt32 Value="4715" />
</Structure>
</Array>
</Structure>
</DataValue>
</NotificationBody>
</DataNotification>
</PDU>
</WRAPPER>

Profile picture for user Kurumi

Kurumi

7 years 5 months ago

GXDLMSNotify.parsePush() dosen't work for all push message types

Hi,

We have updated the notification example. Get the latest version.

BR,

Mikko

pramodahanya

7 years 5 months ago

Parsing the xml to GXDLMSObject list

Hi Mikko,
is there any way to parse the XML string returned by the translator into the GXDLMSObject list like how we used to get in parse push.
I have tried using the GXDLMSClient.parseObjects method but this returns invalid response. The code fails at line 1048 in GXDLMSCLient.parseLNObjects where it is checking if the buffer is starting with 0x01 but in my case, it is starting with 0x02. Below is the buffer data for the Push Interval_1 message.
02 03 09 06 00 01 19 09 00 FF 01 05 02 04 12 00 08 09 06 00 00 01 00 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 08 01 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 08 02 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02 08 01 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02 08 02 FF 0F 02 12 00 00 01 01 02 05 09 0C 07 E2 0C 13 03 00 00 00 3A FF C4 00 06 00 00 1D D4 06 00 00 1E C3 06 00 00 12 2F 06 00 00 12 6B

Profile picture for user Kurumi

Kurumi

7 years 5 months ago

Parsing the xml to GXDLMSObject list

Hi,
Problem with Push messages is that data can be anything. The structure of Push message is not defined. Data of your push message is below.
You can try to do following.
After you have call GetData, you can get values, but at the moment you need to create COSEM objects by your self. I'll add this to the worklist, but it's released after the New Year.

BR,
Mikko
client.getData(reply, data);

printData(data.getValue());

<Structure Qty="03" >
<!--0.1.25.9.0.255-->
<OctetString Value="0001190900FF" />
<Array Qty="05" >
<Structure Qty="04" >
<UInt16 Value="0008" />
<!--0.0.1.0.0.255-->
<OctetString Value="0000010000FF" />
<Int8 Value="02" />
<UInt16 Value="0000" />
</Structure>
<Structure Qty="04" >
<UInt16 Value="0003" />
<!--1.0.1.8.1.255-->
<OctetString Value="0100010801FF" />
<Int8 Value="02" />
<UInt16 Value="0000" />
</Structure>
<Structure Qty="04" >
<UInt16 Value="0003" />
<!--1.0.1.8.2.255-->
<OctetString Value="0100010802FF" />
<Int8 Value="02" />
<UInt16 Value="0000" />
</Structure>
<Structure Qty="04" >
<UInt16 Value="0003" />
<!--1.0.2.8.1.255-->
<OctetString Value="0100020801FF" />
<Int8 Value="02" />
<UInt16 Value="0000" />
</Structure>
<Structure Qty="04" >
<UInt16 Value="0003" />
<!--1.0.2.8.2.255-->
<OctetString Value="0100020802FF" />
<Int8 Value="02" />
<UInt16 Value="0000" />
</Structure>
</Array>
<Array Qty="01" >
<Structure Qty="05" >
<!--12/19/2018 1:00:00 AM-->
<OctetString Value="07E20C13030000003AFFC400" />
<UInt32 Value="00001DD4" />
<UInt32 Value="00001EC3" />
<UInt32 Value="0000122F" />
<UInt32 Value="0000126B" />
</Structure>
</Array>
</Structure>

pramodahanya

7 years 5 months ago

Thank You Mikko

Thank You Mikko

pramodahanya

7 years 5 months ago

Dear Mikko, You have

Dear Mikko, You have mentioned that you will be providing a solution to create COSEM objects. If possible could you please do share a rough timeline and what COSEM objects are you planning on supporting.
Thank You
Pramod

Profile picture for user Kurumi

Kurumi

7 years 5 months ago

Parsing the xml to GXDLMSObject list

Hi,

We are testing the new version at the moment. I believe that it's released the latest next Monday.
BR,
Mikko

pramodahanya

7 years 5 months ago

Thanks for the update Mikko

Thanks for the update Mikko

rudreshmr@gmail.com

4 years 10 months ago

Which API is used to parse

Which API is used to parse this incoming ciphered message? I am trying with java API not getting the proper response with DLMS Translator. (Here Meter is server(pushes the data, Ciphered packet), and I am writing client code which listens udp channel and need to parse). please let me know the API, so I can use to parse this DLMS object.

Profile picture for user Kurumi

Kurumi

4 years 10 months ago

In reply to Which API is used to parse by rudreshmr@gmail.com

Hi rudreshmr,

Hi rudreshmr,

Please, create a new topic if you have a new question. I'll answer your question after you have created a new topic.

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