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. Handshake With GXSocket

Handshake with GXSocket

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.

Profile picture for user tbvk
By tbvk , 20 February, 2023
Forums
Gurux DLMS for Java

(Related to https://gurux.fi/forum/20511)

This is my current process, the code is here (https://paste.debian.net/1270708/) if needed:

handleTCP(): Enter
GXSocket: receive(gurux.common.ReceiveParameters@2315b761) (returning false)
[GXDLMSReader] succeded receive()?: false
Data send failed. Try to resend 1/3
TX: 11:21:52.877 7E A0 07 03 21 93 0F 01 7E
[ConnThread/onTrace] Just traced: 41.13.28.143:40566 [B@169bce7f
GXSocket: Just sent: [126, -96, 7, 3, 33, -109, 15, 1, 126]
GXSocket: receive(gurux.common.ReceiveParameters@2315b761) called
handleTCP(): Count byte: 0
handleReceivedData(): Enter
GXSocket: getEop() called (returning null)
GXSocket: getIsSynchronous() called (returning false)
GXSocket: getSyncBase() called (returning gurux.common.GXSynchronousMediaBase@58d9a169)
[ConnThread/onTrace] Just traced: 41.13.28.143:40566 [B@151b59a1
[ConnThread/onReceived] Just received [Data: 00 01 00 01 00 01 00 16 0A 02 10 43 4C 45 31 30 35 34 32 32 39 30 30 30 33 30 39 00 18 89, From: /41.13.28.143:40566]
handleTCP(): Enter

The bytes the meter sends upon connect seem to be:

Just received [Data: 00 01 00 01 00 01 00 16 0A 02 10 43 4C 45 31 30 35 34 32 32 39 30 30 30 33 30 39 00 18 89, From: /41.13.28.143:40566]

Anything meaningful?

---

It may be wrong in some places but I'm trying to get an idea of how to implement our own IGXMedia.

The Socket passed into it comes from ServerSocket.accept() in another Java file (just for reference).

There may very well be authentication problems but in our code via GXDLMSReader we would expect those to appear then, it seems to get stuck initializing the connection.

Profile picture for user Kurumi

Kurumi

3 years 3 months ago

Hi, Your meter is using…

Hi,

Your meter is using WRAPPER and your listener is using HDLC framing.
Data that you are sending is WRAPPER frame that contains information from the connecting meter.

<WRAPPER len="16" >
<SourceAddress Value="1" />
<TargetAddress Value="1" />
<PDU>
<Data="0A0210434C4531303534323239303030333039001889" />
</PDU>
</WRAPPER>

I don't know what meter you are using, but I believe that you need to wait until the meter has send identification message. Then connect using client address 1 and meter address 1.

I'm not quite sure what the data is. Usually there is a Logical Device name (FLAG id + serial number), but I don't know what this is.

BR,
Mikko

Profile picture for user tbvk

tbvk

3 years 3 months ago

I decoded the hex…

I decoded the hex representation of the bytes into ASCII (above) and I got something that looked like this (with some nonprintable characters/invalid sequences):

CLE1054229000309

(It's a clou meter by the way).

---

I hjave switched to `InterfaceType.WRAPPER` and will see what happens (if anything). It's an ongoing project to be able to have our meters connect over TCP in such a manner (having a GXDLMSReader instance associated per socket) hence any help is always appreciated :)

Profile picture for user tbvk

tbvk

3 years 3 months ago

In reply to Hi, Your meter is using… by Kurumi

Any idea as to how to decode…

Any idea as to how to decode wrapper correctly. Does GuruX support it?

  • 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