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. Node
  3. How To Interface The Meter(client) and Server(script) Using TCP ?

How to interface the meter(client) and server(script) using TCP ?

By ERAIYARUL K , 16 February, 2024
Forums
Gurux.Net

Hi All,
Now the meter act as client . I need to host server and communicate with meter , when the meter is connected. How to handshake,read and write with device?.Can u help me?

Profile picture for user Kurumi

Kurumi

2 years 7 months ago

Hi, Communication depends is…

Hi,

Communication depends is your meter connecting to the server using auto-connect or sending push messages.

https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSAutoConnect
https://www.gurux.fi/Gurux.DLMS.Objects.GXDLMSPushSetup

You can use Gurux open-source libraries to handle meter connections or push messages. If you want to know how to implement handshake, etc, DLMS Greeen Book defines that. It's no possible to tell easily.

BR,
Mikko

ERAIYARUL K

2 years 7 months ago

Hi Thanks for reply I…

Hi
Thanks for reply
I complete the below process to connect with client meter and server
1)create the server:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as server_socket:
server_socket.bind((HOST, PORT))
2)listen the meter(client)
conn, addr = server_socket.accept()
executor.submit(handle_connection, conn, addr)
3)calling the function and create a client object ,trace and invocationCounter
client = GXDLMSSecureClient(True)
media = conn
reader = GXDLMSReader(client,media,trace,invocationcounter)
reader.initializeConnection()
here i got issue to handshake,read and write with client meter .Media object is issue for me and i can't able to send and receive the data from media object. Can u help me with sample code in python ?

Profile picture for user Kurumi

Kurumi

2 years 7 months ago

Hi, At first, you need to…

Hi,

At first, you need to check that your meter uses auto-connect as I described earlier.
You need to create GXNet media component and use it like this:

media = GXNet(NetworkType.TCP, None, 4000)
media.server = True
client = GXDLMSSecureClient(True)
reader = GXDLMSReader(client,media,trace,invocationcounter)

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin