Skip to main content
Home
for DLMS smart meters

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Custom Socket Adapter IGXMedia

Custom socket adapter IGXMedia

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, 13 February, 2023
Forums
Gurux DLMS for Java

SO I have put toghether a system whereby I can have several meters connect over TCP to a ServerSocket, I then do `Socket socket = servSock.accept()` to dequeue each Socket connection.

After this I will then create a `new GXSocket(Socket)` and pass in the `Socket` object. This is a new type I made which implements the `IGXMedia` interface, a lot of the code I needed I copied from GXNet. So this GXSocket has a built-in receiver thread which then manioulates the buffer the `GXSynchronousMediaBase` is attached to, allow the `receive()` method to work. Sending is more simple, just used the sending code from GXNet too.

My question is around the handshake process that occurs when a meter connects to US instead of the other way round (where we connect to it and then do a handshake). Do you have any information on this process to enlighten me as we really need this to work.

Profile picture for user Kurumi

Kurumi

2 years 4 months ago

Hi, You need to do a…

Hi,

You need to do a handshake when the meter establishes the connection in the same way as you do when you connect for the meter.

BR,
Mikko

Profile picture for user tbvk

tbvk

2 years 4 months ago

Perfect, thank you very much…

Perfect, thank you very much. I will post a related follow-up question later.

Profile picture for user tbvk

tbvk

2 years 4 months ago

In reply to Hi, You need to do a… by Kurumi

This is my current process,…

This is my current process, I can post the code if need be:

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?

Profile picture for user tbvk

tbvk

2 years 4 months ago

In reply to This is my current process,… by tbvk

Here is the code (this time…

Here is the code (this time I made sure the paste would not expire) for GXSocket:

https://paste.debian.net/1270708/

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.

  • Log in or register to post comments
  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 07/09/2025 - 16:41
    Gurux.Serial.Android 2.0.13
  • Wed, 07/09/2025 - 12:07
    gurux.dlms.c 9.0.2507.0901
  • Sat, 07/05/2025 - 15:04
    Gurux.DLMS.Python 1.0.188
  • Tue, 07/01/2025 - 10:09
    Gurux.DLMS.Python 1.0.187
  • Tue, 07/01/2025 - 09:54
    gurux.dlms.c 9.0.2507.0101

New forum topics

  • Authentication issues (AARQ) with WASION IM300
  • Regarding the dlms android project
  • Unable to read attribute =3 (1.0.94.91.0.255) IC=7 for Indian Metering, while I'm able to read attribute 3 for other Profile generic class
  • Register Activation class (class_id = 9) attribute index 3 data is not visible
  • Load profile
More

Who's new

  • ClarkKent
  • manurdevang
  • Ali Ali
  • nabeell
  • Mostafa
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin