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. I Am Trying To Read Meter By Using Your Python Sdk Facing Issues

I am trying to read meter by using your python sdk facing issues

By srikanthj , 12 September, 2024
Forums
Gurux.DLMS

Below error i am getting

root@arm:~/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python# python3 main.py -S /dev/ttymxc2:9600:8None1 -i WRAPPER -d India -t Verbose
gurux_dlms version: 1.0.158
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: 0
ClientAddress: 0x10
ServerAddress: 0x1
Standard: 1
TX: 14:05:00 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 40 1E 5D FF FF
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 14:05:15
DisconnectRequest
Traceback (most recent call last):
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/main.py", line 112, in main
reader.readAll(settings.outputFile)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 532, in readAll
self.initializeConnection()
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 311, in initializeConnection
self.readDataBlock(self.client.aarqRequest(), reply)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 179, in readDataBlock
self.readDataBlock(it, reply)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 182, in readDataBlock
self.readDLMSPacket(data, reply)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 118, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 169, in readDLMSPacket2
raise e
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 162, in readDLMSPacket2
raise TimeoutException("Failed to receive reply from the device in given time.")
gurux_common.TimeoutException.TimeoutException: Failed to receive reply from the device in given time.
Ended. Press any key to continue.

Profile picture for user Kurumi

Kurumi

1 year 9 months ago

Hi, Your settings are…

Hi,

Your settings are different than the meter expects. Try with this:

python3 main.py -S /dev/ttymxc2:9600:8None1 -d India -t Verbose

BR,
Mikko

srikanthj

1 year 9 months ago

Hi Mikko i tried with the…

Hi Mikko

i tried with the command what you suggested but sill the issue is same . You can see below logs

root@arm:~/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python# python3 main.py -S /dev/ttymxc2:9600:8None1 -d India -t Verbose
gurux_dlms version: 1.0.158
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: 0
ClientAddress: 0x10
ServerAddress: 0x1
Standard: 1
TX: 13:21:37 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: 13:21:52
DisconnectRequest
Traceback (most recent call last):
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/main.py", line 112, in main
reader.readAll(settings.outputFile)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 532, in readAll
self.initializeConnection()
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 306, in initializeConnection
self.readDLMSPacket(data, reply)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 118, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 169, in readDLMSPacket2
raise e
File "/root/Gurux-reading/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 162, in readDLMSPacket2
raise TimeoutException("Failed to receive reply from the device in given time.")
gurux_common.TimeoutException.TimeoutException: Failed to receive reply from the device in given time.
Ended. Press any key to continue.

BR,
Srikanth

Profile picture for user Kurumi

Kurumi

1 year 8 months ago

Hi Srikanth, Check your baud…

Hi Srikanth,

Check your baud rate. The meter should reply if the baud rate is correct and your cable is connected correctly.

BR,
Mikko

srikanthj

1 year 8 months ago

Hi Mikko with same baudrate…

Hi Mikko

with same baudrate i am getting response from gurux director. I am able to read all profiles.

Regards,
srikanth

Profile picture for user Kurumi

Kurumi

1 year 8 months ago

Hi Srikanth, You are now…

Hi Srikanth,

You are now using the Public Client and I believe that you need to change the client address and authentication level to see all profiles.

You can see the correct command line arguments when you select the meter in GXDLMSDirector.

BR,
Mikko

srikanthj

1 year 7 months ago

Hii Mikko, Now, i am able to…

Hii Mikko,

Now, i am able to communicating meter with python SDK. SO after initializeConnection is there any feature in your SDK like whatever the OBIS code if we give from command line meter should responds to that particualr OBIS code.
Because here SDK is reading all parameters. So can you please help regarding this as soon as possible.

Regards,
Srikanth

srikanthj

1 year 7 months ago

Hi Mikko, Any update…

Hi Mikko,

Any update regarding above comment. I want to read particular particular OBIS code only .So what ever the OBIS i will give from commnad line meter should give response of that OBIS Code only. Please help regarding this.

Regards,
Srikanth

srikanthj

1 year 7 months ago

Hello Mikko In GXDLMSReader…

Hello Mikko

In GXDLMSReader.py i included below piece of code that i got it from one of your forum.

def readAll(self, outputFile):
try:
read = False
self.initializeConnection()

# OBIS Clock
d = GXDLMSRegister("1.0.32.7.0.255")
self.read(d, 2)

self.getReadOut()
self.getProfileGenerics()

if outputFile:
self.client.objects.save(outputFile)

except (KeyboardInterrupt, SystemExit):
self.media = None
raise
finally:
self.close()

and in main.py i modified like below

settings.media.open()
reader.initializeConnection()
reader.readAll(settings.outputFile) -------- directly i am calling this then i am getting below logs

gurux_dlms version: 1.0.158
gurux_net version: 1.0.19
gurux_serial version: 1.0.20
Authentication: 0
ClientAddress: 0x10
ServerAddress: 0x1
Standard: 1
TX: 13:23:46 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 40 1E 5D FF FF
RX: 13:23:51 00 01 00 01 00 10 00 2B 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 00 10 02 00 00 07
Standard: 1
TX: 13:23:51 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 40 1E 5D 02 00
RX: 13:23:56 00 01 00 01 00 10 00 2B 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 00 10 02 00 00 07
TX: 13:23:56 00 01 00 10 00 01 00 0D C0 01 C1 00 03 01 00 20 07 00 FF 02 00
RX: 13:24:01 00 01 00 01 00 10 00 05 C4 01 C1 01 0B
DisconnectRequest
TX: 13:24:01 00 01 00 10 00 01 00 09 62 03 80 01 00 03 80 01 00
Data length is 5and there are 127 bytes.
RX: 13:24:06 00 01 00 01 00 10 00 05 63 03 80 01 00 00 01 00 01 00 40 00 72 DB 08 45 45 4D 30 30 30 30 33 67 20 00 00 01 1D B9 97 0C 21 9F 47 E1 98 C8 5F 34 F6 F7 9C B6 AA 3D E4 66 66 A9 A7 0A 6D 0C 34 B6 D4 38 5D 44 01 8E 74 C7 47 15 94 EB D0 C3 BE C7 B7 DF 62 DA 08 30 45 9D 40 5C A0 2B CB 1E B6 06 33 A5 10 21 71 43 26 F3 04 9A DF 92 44 77 A6 3A 80 8C 2E DF 14 5A B5 BA 12 C0 5A 21 C8 E2 F9 70 8F 97 9B 41 42 C8 D0
Access Error : Device reports a unavailable object.
Ended. Press any key to continue.

so can you please help regarding this

Profile picture for user Kurumi

Kurumi

1 year 7 months ago

Hi, You need to know what…

Hi,

You need to know what COSEM objects your meter is implementing.
Reading association view you can get all the objects, but adding them manually is more effective way as you already discovered:

d = GXDLMSRegister("1.0.32.7.0.255")
self.read(d, 2)

Read the value with GXDLMSDirector and then add the COSEM object that you want to read.

https://gurux.fi/Gurux.DLMS.Objects

BR,
Mikko

srikanthj

1 year 6 months ago

Hii Mikko, I am receiving…

Hii Mikko,

I am receiving below packet
[[<gurux_dlms.GXDateTime.GXDateTime object at 0xb5ca7170>, 0.0, 0.0, 0.0, 0.0]]

can you help me how to convert this "<gurux_dlms.GXDateTime.GXDateTime>" to date and time . i need to print this as particualr date&time.

And one more thing i need in python Gurux DLMS SDK how to enable keep alive for initial connection.

Please respond for above mentioned issues as soon as possible .

Regards,
Srikanth

Profile picture for user Kurumi

Kurumi

1 year 6 months ago

Hi, You need to loop the…

Hi,

You need to loop the buffer rows and columns. Check this example.

https://github.com/Gurux/Gurux.DLMS.Python/blob/f0424203b37d6e64e5231d1…

BR,
Mikko

srikanthj

1 year 6 months ago

Hi Mikko, Thank you for…

Hi Mikko,
Thank you for quick response. I got below output

07 E8 0B 0B 01 0B 2E 00 00 01 4A 00 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | /99 18:30:00:000000 | 0.0 | /99 18:30:00:000000 | 75 | 0.0 | 0.0

reading with Gurux Dlms director tool getting exact time but with SDK it's 07 E8 0B 0B 01 0B 2E 00 00 01 4A 00 not a correct time .

and Give me any idea for KEEP ALIVE for initial connection

Regards,
Srikanth

Profile picture for user Kurumi

Kurumi

1 year 6 months ago

Hi, You need to loop the…

Hi,

You need to loop the profile generic buffer and you can see the correct data.
Now you can see the date-time in bytes.

The keep alive is not needed if you read the data and close the connection. If you want to keep the connection up you must read something e.g. every 30 seconds.

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