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
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
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.
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.
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.")
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.")
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
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.
Hi,
Hi,
Check GetReadOut method. It reads all objects and attributes of each object.
BR,
Mikko
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
Hi Mikko,
Hi Mikko,
Is it possible to retrieve OBSIS code from GXDLMSCaptureObject? If possible how?
Thanks
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
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
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
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
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
for some values we are
for some values we are getting bytearray why is it like that?
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
what about reply 72
what about reply 72
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
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
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
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