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. Simple Python Code Example Needed

Simple Python code example needed

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 riyazshaikh16in , 7 October, 2019
Forums
Gurux.DLMS

Simple Python code example needed
Hello all

I am interested in experimenting with DLMS/COSEM component but I am having a little trouble using the sample code as I am not so experienced in Python

The idea is simply to readout a given data from a DLMS based meter using the optical comm. (e.g. "voltage on L1 ..")

I m interested to know how to use available class and modules of GXDLMS + GXserial for reading and writing

I would very much appreciate if someone could post a simple and specific code example written in Python 3.x using the component just for this purpouse.

Thanks in advance

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

You can't just get a readout in DLMS. Download GXDLMSDirector and use it to get familiar with DLMS.
You need to know OBIS code and interface type to read value from the meter.

This client example does exactly what you want to do. It reads all the data from the meter.
You can modify it so it reads only values that you want to.

https://github.com/Gurux/Gurux.DLMS.Python/tree/master/Gurux.DLMS.Clien…

BR,
Mikko

riyazshaikh16in

6 years 8 months ago

Hi kurumi,

Hi kurumi,
Thank you very much for your quick response and input for my query, I m using similar tool to read energy meter and familiar with DLMS OBIS codes and various associations used in it, Now I am trying to explore meter reading and testing via python scripting and need your valuable inputs to use gurux_dlms package and it's various module; for that I need your support in creating scripts.

Please Help Thanks
regards

riyazshaikh16in

6 years 8 months ago

can anybody share a simple

can anybody share a simple code (python)
for ex. Reading clock without any security using command from gurux_dlms package.
1. port setting
2. association
3. then readout

Thanks in advance
regards

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

All settings depend from the manufacturer. Try to run Gurux.DLMS.Client.Example.python with parameter:

python main.py -S COM_PORT.

Update COM_PORT to serial port what you are using.

BR,
Mikko

riyazshaikh16in

6 years 8 months ago

thanx,

thanx,
I've tried but found error:

$ python main.py -S COM3
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 19:03:39
DisconnectRequest
Segmentation fault

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

Can you run this with -t Verbose parameter and post trace here?
Can you connect to this meter with GXDLMSDirector?

BR,

Mikko

jaafarsd

6 years 7 months ago

Hello, Mikko and Riyaz, I am

Hello, Mikko and Riyaz, I am also getting a similar error. My problem is that I am having trouble getting even the settings from my manufacturer (EDMI). Please do you have such settings for low or No authentication access for EDMI MK6E meters!

BR,
Jaafar

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hi,

Hi,

Install GXDLMSDirector and try to read your meter with that. If you can't read it verify from meter vendor that your meter is supporting DLMS. There are versions from EDMI MK6E that don't support DLMS.

BR,

Mikko

jaafarsd

6 years 7 months ago

In reply to Hi, by Kurumi

Hello Mikko,

Hello Mikko,

I have installed GXDLMSDirector and I am still unable to connect to both EDMI MK6E and Actaris SL7000 and even ACE6000 from Itron. All the meters are DLMS complaint. it says so on the front panel of the meters. I figure I must be doing something wrong. I am trying to connect using an optical probe on COM10. I can read the meters through the manufacturers software (EDMI & Ace Pilot)

BR,
Jaafar

Profile picture for user Kurumi

Kurumi

6 years 7 months ago

Hello Jaafar,

Hello Jaafar,

Try to change the start protocol from IEC to DLMS. Can you see what baud-rate you are using in Ace Pilot or EDMI?

BR,
Mikko

janenarong

6 years 5 months ago

Hello Kurumi

Hello Kurumi
PS C:\Users\Janenarong\Desktop\BANPU_PROJECT\Gurux.DLMS.Python-master\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python> python .\main.py -S COM3 -t Verbose
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
TX: 18:57:15 7E A0 07 03 21 93 0F 01 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 18:57:30
DisconnectRequest

Please help me. How to use your Gurux.DLMS.Python
BR
Janenarong

janenarong

6 years 5 months ago

In reply to Hello Jaafar, by Kurumi

Hello Kurumi

Hello Kurumi
PS C:\Users\Janenarong\Desktop\BANPU_PROJECT\Gurux.DLMS.Python-master\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python> python .\main.py -S COM3 -t Verbose
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
TX: 18:57:15 7E A0 07 03 21 93 0F 01 7E
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 18:57:30
DisconnectRequest

Please help me. How to use your Gurux.DLMS.Python
BR
Janenarong

Profile picture for user Kurumi

Kurumi

6 years 5 months ago

Hi Janenarong,

Hi Janenarong,

Please, if you have a new question, create a new topic. I'll help you there.

BR,
Mikko

pylalu

6 years 1 month ago

Hello everyone,

Hello everyone,

Does someone help me to find server SM DLMS/COSEM simulator example in Python? I want to start to develop my own DLMS/COSEM client using Python, but still I don't have my own Smart Meter device.

Thanks in advance.
Pyla

Profile picture for user Kurumi

Kurumi

6 years 1 month ago

In reply to Hello everyone, by pylalu

Hi pylalu,

Hi pylalu,

Please, create a new topic if you have a new question. I'll answer your question there.
BR,
Mikko

Leonid

3 years 9 months ago

Good afternoon!!! You

Good afternoon!!! You provided a good link for reading parameters. And it is possible with the help of this example to calculate PROFILE_GENERIC with the time interval I need. I make a request (python main.py -S com1 -r sn -g 1.0.99.1.0:2) I get
raise Exception("Unknown logical name:" + k)
Exception: Unknown logical name:1.0.99.1.0
Looking forward to your help!! Thank you!

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

In reply to Good afternoon!!! You by Leonid

Hi,

Hi,

Please, create a new topic if you have a new question. I'll answer your question there.

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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin