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. 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 3 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 3 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 3 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

  • 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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin