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. From Where To Start

From where to start

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 Bhavjinder Singh , 20 June, 2018
Forums
General discussion

Hi
I have to create android app which will read DLMS based meter data. Pls suggest me from where i can start. Im new in dlms protocol, first i have to prepare the communication between meter and mobile device. I'm not able to create the channel between meter and mobile through optical strobe

Regards
Bhavjinder Singh

Bhavjinder Singh

7 years 11 months ago

Select serial port first

Code is returning select serial port first in toast

Profile picture for user Kurumi

Kurumi

7 years 11 months ago

From where to start

Hi,
You need optical head or USB to serial port converter to read your meter. I believe you don't have that installed at the moment.

BR,

Mikko

Bhavjinder Singh

7 years 11 months ago

Im able to read data

Hi..
I'm able to read data, but now problem is how can convert byte array return by meter as a reply to actual data. If class id is 8 then i have to convert byte array to decimal value for datetime.

Bhavjinder Singh

7 years 11 months ago

Im able to read data

Mine problem is to interpret data returned by the meter.

Profile picture for user Administrator

Administrator

7 years 11 months ago

From where to start

Hello,

You should check those:
http://www.gurux.fi/DLMSCOSEMFAQ
http://www.gurux.fi/Gurux.DLMS.Client

Bhavjinder Singh

7 years 11 months ago

Getting data

Hi ..
Pls help me, i got the data in byte array for meter serial number and Clock. But both parameters have data type returned by meter is 'OCTETString' so now how can get the actual value, because for MSN is a ascii value and clock parameter is in decimal.

Bhavjinder Singh

7 years 11 months ago

Scaler unit

how to read Scaler unit of any particular parameter

Profile picture for user Kurumi

Kurumi

7 years 11 months ago

Reading data

Hi,

Date time is returned in OctectString. You need to convert it to the dateTime format.
GXDLMSClient.ChangeType -method.

Scaler and unit are in attribute index 3 of register object.

BR,
Mikko

Bhavjinder Singh

7 years 11 months ago

Thank you!

Hi Mikko,
First, Thank you!
Im able to get actual meter's datetime. But not able to figure out where is scalar and unit values.

Bhavjinder Singh

7 years 11 months ago

readObject(obj, it);

readObject(obj, it);
if (obj.getObjectType() == ObjectType.CLOCK) {
Object obj1 = GXDLMSClient.changeType((byte[]) obj.getValues()[1], DataType.DATETIME);
Log.i("Datetime", String.valueOf(obj1));
}

is this the right way? to get byte array of response

Profile picture for user Kurumi

Kurumi

7 years 11 months ago

Reading data

Hi,

If your object is clock it's done automatically.
GXDLMSClock c = new GXDLMSClock();
readObject(obj, 2);

BR,

Mikko

Bhavjinder Singh

7 years 11 months ago

Reading of register

Hi Mikko,
I want to read register parameter just say "Cumulative Energy – kWh" ...
I have initialise GXDLMSRegister("1.0.1.8.0.255"), im getting response from the meter but im getting NONE for the unit.

Profile picture for user Kurumi

Kurumi

7 years 11 months ago

Reading of register

Hi,

Try to read that with GXDLMSDirector. If the result is the same, your meter is set the unit to NONE.

BR,

Mikko

Bhavjinder Singh

7 years 11 months ago

Failed to recieve reply in given time

hi mikko
Im using GXDLMSDirector to read meter paramter, im getting this reply from meter in the trace:
29/06/2018 12:37:06 PM
<HDLC len="9" >
<TargetAddress Value="1" />
<SourceAddress Value="20" />
<FrameType Value="93" />
<Snrm>
</Snrm>
</HDLC>

29/06/2018 12:37:13 PM
<HDLC len="9" >
<TargetAddress Value="1" />
<SourceAddress Value="20" />
<FrameType Value="53" />
<DisconnectRequest>
</DisconnectRequest>
</HDLC>

Pls help

regards
Bhavjinder

Profile picture for user Kurumi

Kurumi

7 years 11 months ago

Failed to recieve reply in given time

Hi,

Try to change client address to 10.

BR,
Mikko

Bhavjinder Singh

7 years 11 months ago

Connection is permanently rejected. No reason is given.

Hi Mikko... below is the response im getting :
<HDLC len="9" >
<TargetAddress Value="1" />
<SourceAddress Value="20" />
<FrameType Value="93" />
<Snrm>
</Snrm>
</HDLC>

02/07/2018 12:13:41 PM
<HDLC len="1E" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="256" />
<MaxInfoRX Value="128" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>

02/07/2018 12:13:41 PM
<HDLC len="43" >
<TargetAddress Value="1" />
<SourceAddress Value="20" />
<FrameType Value="10" />
<PDU>
<AssociationRequest>
<ApplicationContextName Value="LN" />
<SenderACSERequirements Value="1" />
<MechanismName Value="Low" />
<CallingAuthentication Value="4142434430303031" />
<InitiateRequest>
<ProposedDlmsVersionNumber Value="06" />
<ProposedConformance>
<ConformanceBit Name="MultipleReferences" />
</ProposedConformance>
<ProposedMaxPduSize Value="FFFF" />
</InitiateRequest>
</AssociationRequest>
</PDU>
</HDLC>

02/07/2018 12:13:41 PM
<HDLC len="2C" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="30" />
<PDU>
<AssociationResponse>
<ApplicationContextName Value="LN" />
<AssociationResult Value="01" />
<ResultSourceDiagnostic>
<ACSEServiceUser Value="01" />
</ResultSourceDiagnostic>
<ConfirmedServiceError>
<Service Value="01" />
<ServiceError>
<Initiate Value="IncompatibleConformance" />
</ServiceError>
</ConfirmedServiceError>
</AssociationResponse>
</PDU>
</HDLC>

02/07/2018 12:13:41 PM
<HDLC len="1E" >
<TargetAddress Value="20" />
<SourceAddress Value="1" />
<FrameType Value="73" />
<PDU>
<Ua>
<MaxInfoTX Value="256" />
<MaxInfoRX Value="128" />
<WindowSizeTX Value="1" />
<WindowSizeRX Value="1" />
</Ua>
</PDU>
</HDLC>

Pls. help me...

Regards
Bhavjinder Singh

Bhavjinder Singh

7 years 11 months ago

Connection is permanently rejected. No reason is given.

im using GXDLMSDirector

Bhavjinder Singh

7 years 11 months ago

Scaler unit

Im getting scalar:1, unit:None what does this means.. im reading Instantaneous Frequency

Bhavjinder Singh

7 years 11 months ago

getting error "invalid structure" exception on readObject

if (obj instanceof GXDLMSProfileGeneric) {
try {
readObject((GXDLMSProfileGeneric) obj, 3);
GXReplyData reply_data = new GXReplyData();
byte[][] temp;
temp = mClient.read((GXDLMSProfileGeneric) obj, 2);
readDataBlock(temp, reply_data);
} catch (Exception e) {
e.printStackTrace();
}
}

Profile picture for user Kurumi

Kurumi

7 years 11 months ago

getting error "invalid structure" exception on readObject

Hi,

Are you reading profile generic or something else? Please, describe the problem better. I can't help if you copy only a few lines from the example.

BR,

Mikko

Bhavjinder Singh

7 years 11 months ago

Im reading profile

Hi Mikko,

Im reading profile FOR INSTANTANEOUS PARAMETERS... first im reading capture object
readObject((GXDLMSProfileGeneric) obj, 3);

but im getting error on the above line as "invalid structure"

Profile picture for user Kurumi

Kurumi

7 years 11 months ago

getting error "invalid structure" exception on readObject

Hi,

What meter are you trying to read? Can you post reply data from the meter? I can check it.
BR,

Mikko

Bhavjinder Singh

7 years 11 months ago

Hey Mikko,

Hey Mikko,
Mine problem is I dont know how to read profile generic.. below is the code i have write:
try {
//readObject((GXDLMSProfileGeneric) obj, 2);
GXReplyData reply_data = new GXReplyData();
byte[][] temp;
temp = mClient.read((GXDLMSProfileGeneric) obj, 3);
for (byte[] it : temp) {
readDataBlock(temp, reply_data);
}
byte[][] temp1 = mClient.read((GXDLMSProfileGeneric) obj, 2);
for (byte[] it : temp1) {
readDataBlock(temp1, reply_data);
}
} catch (Exception e) {
e.printStackTrace();
}

Pls guide me ...i will be very thankful to you

Regards
Bhavjinder Singh

  • 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