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. How To Run Python Frmaework In Windows?

how to run python frmaework in windows?

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 Ram , 16 July, 2019
Forums
Gurux.Serial

Im running my python library but im getting error like this
PFA

Image
Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

Check GetReadOut method. It reads all objects and attributes of each object.

BR,
Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,
C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python>main.py -S COM3 -g "0.0.40.0.2.255"
Traceback (most recent call last):
File "C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python\main.py", line 53, in main
ret = settings.getParameters(args)
File "C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python\TVMSettings.py", line 183, in getParameters
raise ValueError("Invalid Logical name or attribute index.")
ValueError: Invalid Logical name or attribute index.
Ended. Press any key to continue.

we are getting this error If we run with single Obis code without attribute, but we want to get all values related to that OBIS code.
Thanks

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,
We are getting OBIS codes from meter right.Is that OBIS codes are saved anywhere.For that we have any code?
Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

You need to add attribute index after the OBIS code. Like this:
0.0.40.0.2.255:2

You can save OBSIS codes to the file and read them when needed.

BR,
Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

We tried that also still we are getting the error. Like this:
C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python>main.py -S COM3 -g "0.0.40.0.2.255:2"
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Traceback (most recent call last):
File "C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python\main.py", line 79, in main
val = reader.read(settings.client.objects.findByLN(ObjectType.NONE, k), v)
File "C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python\TVMDLMSReader.py", line 287, in read
data = self.client.read(item, attributeIndex)[0]
File "C:\python3\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 925, in read
return self._read(item.name, item.objectType, attributeOrdinal)
AttributeError: 'NoneType' object has no attribute 'name'
DisconnectRequest
Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

There is no object "0.0.40.0.2.255: in the association view. You need to change the authentication level.

BR,

Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

where we need to change the authentication level? Directly while running we have to give otherwise we need to make changes in code. We gave like this:
C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python>main.py -S COM3-a low -P lnt1
Traceback (most recent call last):
File "C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python\main.py", line 53, in main
ret = settings.getParameters(args)
File "C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python\TVMSettings.py", line 121, in getParameters
parameters = TVMSettings.__getParameters(args, "h:p:c:s:r:it:a:p:wP:g:S:")
File "C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python\TVMSettings.py", line 103, in __getParameters
raise ValueError("Invalid parameter: " + args[index])
ValueError: Invalid parameter: low
Ended. Press any key to continue.

Thanks.

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

HI,

HI,

You must Give authentication level as "Low". You also need to change client address.
Something like:

main.py -S COM3-a Low -P lnt1 -c = 1

BR,
Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

We tried like u said but it's disconnecting, we are getting like:

C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master_old version\Gurux.DLMS.Client.Example.python>main.py -S COM3 -c 32 -a Low -P lnt1
Authentication: Authentication.LOW
ClientAddress: 0x20
ServerAddress: 0x1
in reader auth
Authentication.LOW
RX: 14:28:30 7E A0 10 41 03 52 47 E1 E6 E7 00 0E 06 03 02 91 24 7E
DisconnectRequest

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,
While reading data we are getting error something like:

Error! Index: 1 setValue
setValue
Traceback (most recent call last):
File "C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 365, in getReadOut
val = self.read(it, pos)
File "C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 263, in read
return self.client.updateValue(item, attributeIndex, reply.value)
File "C:\python3\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 727, in updateValue
target.setValue(self.settings, e)
File "C:\python3\lib\site-packages\gurux_dlms\objects\GXDLMSExtendedRegister.py", line 145, in setValue
super(GXDLMSExtendedRegister, self).setValue(settings, e)
File "C:\python3\lib\site-packages\gurux_dlms\objects\GXDLMSObject.py", line 262, in setValue
raise ValueError("setValue")
ValueError: setValue

once look into it.
Thanks

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,
Is it necessary to give Attribute index along with OBIS code in command prompt to get all attribute values of that OBIS code or else Is it sufficient to give only OBIS code.

Thanks
waiting for your fast rply

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi Ram,

Hi Ram,
ExtendedRegister issue is fixed. Get the latest version (1.0.27).

Attribute index is mandatory. You can modify the example for your needs if you don't want to give attribute index.

BR,
Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

For every OBIS code of 2nd attribute index we are getting error instead of values
something like:

C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>main.py -S COM3 -c 32 -s 1 -a Low -P lnt1 -g "0.0.94.91.10.255:2"
Authentication: Authentication.LOW
ClientAddress: 0x20
ServerAddress: 0x1
Traceback (most recent call last):
File "C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\main.py", line 77, in main
val = reader.read(settings.client.objects.findByLN(ObjectType.NONE, k), v)
File "C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 263, in read
return self.client.updateValue(item, attributeIndex, reply.value)
File "C:\python3\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 727, in updateValue
target.setValue(self.settings, e)
File "C:\python3\lib\site-packages\gurux_dlms\objects\GXDLMSProfileGeneric.py", line 380, in setValue
self.setBuffer(e)
File "C:\python3\lib\site-packages\gurux_dlms\objects\GXDLMSProfileGeneric.py", line 456, in setBuffer
raise ValueError("Read capture objects first.")
ValueError: Read capture objects first.

Thanks

Ram

6 years 8 months ago

For 3rd attribute index we

For 3rd attribute index we are getting object references instead of OBIS
Like:

C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>main.py -S COM3 -c 32 -s 1 -a Low -P lnt1 -g "0.0.94.91.10.255:3"
Authentication: Authentication.LOW
ClientAddress: 0x20
ServerAddress: 0x1
Index: 3 Value: (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFE9FBE48>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E92E8>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFE9FBEF0>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E91D0>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFEA0D278>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E9208>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFE9FB978>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E93C8>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFE9FBB38>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E96A0>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFE9FBBE0>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E9358>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFEA0D320>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E9128>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFEA0D5C0>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E9668>), (<gurux_dlms.objects.GXDLMSData.GXDLMSData object at 0x0000020AFE9FBF98>, <gurux_dlms.objects.GXDLMSCaptureObject.GXDLMSCaptureObject object at 0x0000020AFE9E9710>)
DisconnectRequest

Thnaks

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

while trying to upgrade the requirements we are getting error like:
C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>pip install -r requirements.txt
Requirement already satisfied: pytz==2019.2 in c:\python3\lib\site-packages (from -r requirements.txt (line 1)) (2019.2)
Requirement already satisfied: python-dateutil==2.8.0 in c:\python3\lib\site-packages (from -r requirements.txt (line 2)) (2.8.0)
Requirement already satisfied: gurux-common==1.0.13 in c:\python3\lib\site-packages (from -r requirements.txt (line 3)) (1.0.13)
Collecting gurux-dlms==1.0.27 (from -r requirements.txt (line 4))
ERROR: Could not find a version that satisfies the requirement gurux-dlms==1.0.27 (from -r requirements.txt (line 4)) (from versions: 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.0.11, 1.0.12, 1.0.14, 1.0.16, 1.0.17, 1.0.18, 1.0.19, 1.0.20, 1.0.21, 1.0.22, 1.0.23, 1.0.24, 1.0.25, 1.0.26)
ERROR: No matching distribution found for gurux-dlms==1.0.27 (from -r requirements.txt (line 4))

Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

GXDLMSCaptureObject contains a reference to an object. You can get OBSIS code from there.

Version 1.0.27 is interesting. I can see the version here:
https://pypi.org/project/gurux-dlms/

But when I run pip install --upgrade it updates to version 1.0.26.

Maybe they are making some improvements to pypi.org and we need to wait for a while.

BR,

Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

Is it possible to retrieve OBSIS code from GXDLMSCaptureObject? If possible how?

Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

It's something like this:

I'll create profile generic object here:
pg = GXDLMSProfileGeneric()

for k, v in pg.captureObjects:
print(k.logicalName)

BR,
Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

For every OBIS code of 2nd attribute index we are getting error instead of values
something like:

C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>main.py -S COM3 -c 32 -s 1 -a Low -P lnt1 -g "0.0.94.91.10.255:2"
Authentication: Authentication.LOW
ClientAddress: 0x20
ServerAddress: 0x1
Traceback (most recent call last):
File "C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\main.py", line 77, in main
val = reader.read(settings.client.objects.findByLN(ObjectType.NONE, k), v)
File "C:\Users\test.EMMYS1546\Downloads\Gurux.DLMS.Python-master (1)\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 263, in read
return self.client.updateValue(item, attributeIndex, reply.value)
File "C:\python3\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 727, in updateValue
target.setValue(self.settings, e)
File "C:\python3\lib\site-packages\gurux_dlms\objects\GXDLMSProfileGeneric.py", line 380, in setValue
self.setBuffer(e)
File "C:\python3\lib\site-packages\gurux_dlms\objects\GXDLMSProfileGeneric.py", line 456, in setBuffer
raise ValueError("Read capture objects first.")
ValueError: Read capture objects first.

Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,
You need to read capture objects first before you read profile generic buffer.

1. Read attribute 3. (capture objects)
2. Read attribute 2. (buffer)

BR,

Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

In get parameters function we added the code like below to get all attributes of OBSIS code, here we have fixed the attributes using range function but when we try with getattributeIndex function we are getting error. how to solve this issue.
elif it.tag == 'g':
# Get (read) selected objects.
for o in it.value.split(";,"):
tmp = o.split(":")
if len(tmp) != 2:
if len(tmp) == 1:
for i in range(1,8):
tmp.insert(1,i)
self.readObjects.append((tmp[0].strip(), int(tmp[1])))
else:
raise ValueError("Invalid Logical name or attribute index.")

Thanks

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

We are getting 2nd Attribute of OBIS like below:
C:\Users\test.EMMYS1546\Desktop\Gurux.DLMS.Python-master\Gurux.DLMS.Client.Example.python>main.py -S COM3 -c 32 -s 1 -a Low -P lnt1 -g "1.0.94.91.0.255:3;, 1.0.94.91.0.255:2"
Authentication: Authentication.LOW
ClientAddress: 0x20
ServerAddress: 0x1

Index: 2 Value: [<gurux_dlms.GXDateTime.GXDateTime object at 0x0000026CD2233048>, 0, 0, 0, 5551, 0, 0, 0, 0, 0, 0, 5001, 0, 0, 0, 2, 15820, 6, 2, 0, bytearray(b'\x07\xe3\t\x01\xff\x00\x00\xff\xff\x01J\x00'), 0, 0, 0, 0, 0, <gurux_dlms.GXDateTime.GXDateTime object at 0x0000026CD2233DA0>, 0, <gurux_dlms.GXDateTime.GXDateTime object at 0x0000026CD2233D68>, 0, 0, 0, 0, 99005, 99005, bytearray(b'\x00\x01\x01'), 99005, 99005, 99005, bytearray(b'\x01\x01\x01'), 99005, bytearray(b'\x01\x00\x00'), 0, bytearray(b'\x00\x00\x00'), 0, 0, 0, bytearray(b'\x00\x00\x00'), 0, bytearray(b'\x00\x00\x00'), 0, bytearray(b'\x00\x00\x00'), 0, bytearray(b'\x00\x00\x00'), 0, bytearray(b'\x00\x00\x00'), 0, bytearray(b'\x00\x00\x00'), 0, 0, 0, 0, 0, 0, 0, 0] DisconnectRequest

we are getting date.time object we are not getting values there, how and where to modify it.
Thanks

Ram

6 years 8 months ago

for some values we are

for some values we are getting bytearray why is it like that?

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

For GXDateTime use str() method to transform it into the string. You are receiving byte arrays because the meter is sending a value as byte array.

BR,

Mikko

Ram

6 years 8 months ago

what about reply 72

what about reply 72

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,

In get parameters function we added the code like below to get all attributes of OBSIS code, here we have fixed the attributes using range function but when we try with getattributeIndex function we are getting error. how to solve this issue.
elif it.tag == 'g':
# Get (read) selected objects.
for o in it.value.split(";,"):
tmp = o.split(":")
if len(tmp) != 2:
if len(tmp) == 1:
for i in range(1,8):
tmp.insert(1,i)
self.readObjects.append((tmp[0].strip(), int(tmp[1])))
else:
raise ValueError("Invalid Logical name or attribute index.")

Thanks
waiting for reply

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

I prose that you add a list of attributes what you want to read. Like this:
-g "0.0.1.0.0.255:1;0.0.1.0.0.255:2"

BR
Mikko

Ram

6 years 8 months ago

Hi Mikko,

Hi Mikko,
That is okay we are able to get values using attribute index.but we want to get all values directly using obis code.that is also we are able to do it.
But if we want to getattributeindextoread() function in gxdlmsSettings.py which package/library i need to import.
Thanks

Profile picture for user Kurumi

Kurumi

6 years 8 months ago

Hi,

Hi,

Amount of attributes depends on the object you want to read.
You need to create that object what you want to read first and then ask how many attributes there are.

BR,
Mikko

Pagination

  • First page
  • Previous page
  • Page 1
  • Page 2
  • 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