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. Trying To Get a Reading of a Landis+gyr E650

Trying to get a reading of a landis+gyr e650

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 ilhan , 14 January, 2020
Forums
Gurux.Serial

Hi,
I have tried to read out the Landys-Gyr E650, finding out it's a DLMS meter

I'm using the following hardware:

- Raspberry Pi 3B
- A RS485 cable connected to the meter, installed by the network operator.
- the RS485 cable connected through ch341-uart converter through usb on the raspberry Pi

Having cloned https://github.com/gurux/gurux.dlms.python and installed all the dependencies, I have tried to get it working through, but so far I get the following outputs:

```
~/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python $ python main.py -S /dev/ttyUSB0
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 17:13:41
DisconnectRequest
```

What else could I try ?

ilhan

6 years 2 months ago

I'm using a venv with Python3

I'm using a venv with Python3 and all the requirements for Gurux installed.

$ python --version
Python 3.6.9

~/dev/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python$

sudo python main.py -S /dev/ttyUSB0 -t Verbose -r sn -c 16 -a Low -P 00000000

[sudo] password for ilhan:
gurux_dlms version: 1.0.61
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.LOW
ClientAddress: 0x10
ServerAddress: 0x1
TX: 13:09:13 7E A0 07 03 21 93 0F 01 7E
RX: 13:09:13 7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 3E 07 04 00 00 00 01 08 04 00 00 00 01 07 22 7E
TX: 13:09:13 7E A0 44 03 21 10 E6 84 E6 E6 00 60 36 A1 09 06 07 60 85 74 05 08 01 02 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 30 30 30 30 30 30 30 30 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 1D FF FF 84 75 7E
RX: 13:09:13 7E A0 36 21 03 30 D7 60 E6 E7 00 61 28 A1 09 06 07 60 85 74 05 08 01 02 A2 03 02 01 01 A3 05 A1 03 02 01 0D BE 0F 04 0D 08 00 06 5F 04 00 18 02 20 09 60 FA 00 18 3A 7E
DisconnectRequest
TX: 13:09:13 7E A0 07 03 21 53 03 C7 7E
RX: 13:09:14 7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 3E 07 04 00 00 00 01 08 04 00 00 00 01 07 22 7E
Traceback (most recent call last):
File "main.py", line 84, in main
reader.readAll(settings.outputFile)
File "/home/ilhan/dev/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 487, in readAll
self.initializeConnection()
File "/home/ilhan/dev/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 304, in initializeConnection
self.client.parseAareResponse(reply.data)
File "/home/ilhan/.local/lib/python2.7/site-packages/gurux_dlms/GXDLMSClient.py", line 523, in parseAareResponse
self.isAuthenticationRequired = _GXAPDU.parsePDU(self.settings, self.settings.cipher, reply, None) == SourceDiagnostic.AUTHENTICATION_REQUIRED
File "/home/ilhan/.local/lib/python2.7/site-packages/gurux_dlms/_GXAPDU.py", line 641, in parsePDU
ret = _GXAPDU.parsePDU2(settings, cipher, buff, xml)
File "/home/ilhan/.local/lib/python2.7/site-packages/gurux_dlms/_GXAPDU.py", line 807, in parsePDU2
raise GXDLMSException(resultComponent, resultDiagnosticValue)
GXDLMSException: Access Error : Device

ilhan

6 years 2 months ago

I was able to get a meter

I was able to get a meter-values reading with .map110 with the same cable from a windows10 pc.

The link for the logs and the reading can be found here: https://blocklabnl-my.sharepoint.com/:f:/g/personal/ilhan_blocklab_nl/E…

I uploaded this as maybe the communication log might help with resolving how this smart meter need communication

Profile picture for user Kurumi

Kurumi

6 years 2 months ago

Hi,

Hi,

Install the latest version. 1.0.64.
BR,
Mikko

Profile picture for user Kurumi

Kurumi

6 years 2 months ago

Hi,

Hi,
This is fixed. Get the latest version. (1.0.64). internal property is changed to the method.

BR,
Mikko

ilhan

6 years 2 months ago

Yeah we have been getting a

Yeah we have been getting a bit further, getting some more readings now. Been also struggling with VirtualEnv, but that isn't our main issue.

With command:

sudo python main.py -S /dev/ttyUSB0 -t Verbose -r sn
This is the output:
https://pastebin.com/Vvs6PqXK

With command :
sudo python3 main.py -S /dev/ttyUSB0 -r sn

This is the output:
https://pastebin.com/bNGMMHpH

What are the Unknown objects and the Scalar issues ?

To clarify, I'm using the `Gurux.DLMS.Client.Example.python` folder for testing all of this. Looking forward to your support. Thank you.

Profile picture for user Kurumi

Kurumi

6 years 2 months ago

Hi,

Hi,

Unknown objects are manufacturer defined custom interfaces.
Those interfaces are not defined on the standard. Meter manufacturers usually don't use them anymore because it breaks the compatibility.

We'll make simulated device from your log and check this scaler issue.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

6 years 2 months ago

Hi,

Hi,

There is a version 1.0.66 where this is fixed.

BR,
Mikko

ilhan

6 years 2 months ago

Hi Mikko,

Hi Mikko,

Great news, finally we are able to get a reading.

sudo python3 main.py -S /dev/ttyUSB0 -r sn
https://pastebin.com/S95zzt0T

Have a hard time understanding the context in the messages, what the readings are.

Furthermore the read and write denied messages, what are these about, am I missing something.

Do you have any examples if I wanted to build an API around this ?

Best, Ilhan

ilhan

6 years 2 months ago

Furthermore with Low

Furthermore with Low autgentication I get

sudo python3 main.py -S /dev/ttyUSB0 -r sn -a Low -P 00000000
gurux_dlms version: 1.0.66
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.LOW
ClientAddress: 0x10
ServerAddress: 0x1
Standard: Standard.DLMS
DisconnectRequest
Traceback (most recent call last):
File "main.py", line 98, in main
reader.readAll(settings.outputFile)
File "/home/ilhan/dev/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 504, in readAll
self.initializeConnection()
File "/home/ilhan/dev/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 314, in initializeConnection
self.client.parseAareResponse(reply.data)
File "/home/ilhan/.local/lib/python3.6/site-packages/gurux_dlms/GXDLMSClient.py", line 527, in parseAareResponse
self.isAuthenticationRequired = _GXAPDU.parsePDU(self.settings, self.settings.cipher, reply, None) == SourceDiagnostic.AUTHENTICATION_REQUIRED
File "/home/ilhan/.local/lib/python3.6/site-packages/gurux_dlms/_GXAPDU.py", line 641, in parsePDU
ret = _GXAPDU.parsePDU2(settings, cipher, buff, xml)
File "/home/ilhan/.local/lib/python3.6/site-packages/gurux_dlms/_GXAPDU.py", line 807, in parsePDU2
raise GXDLMSException(resultComponent, resultDiagnosticValue)
gurux_dlms.GXDLMSException.GXDLMSException: Access Error : Device reports a hardware fault.
Ended. Press any key to continue.

Profile picture for user Kurumi

Kurumi

6 years 2 months ago

Hi,

Hi,

You need to change client address. I can't remember what L+G is using. It might be 17.
Try with this:

sudo python3 main.py -S /dev/ttyUSB0 -r sn -a Low -P 00000000 -c 17

BR,

Mikko

tracker

6 years 2 months ago

In reply to Furthermore with Low by ilhan

Did you get this to work with

Did you get this to work with that small usb stick.. have the same.. trying to connect it trought raspberry pi to my landis&gyr e450...

ilhan

6 years 2 months ago

In reply to Did you get this to work with by tracker

No, an exsys adapter was

No, an exsys adapter was bought for rs485 usb

ilhan

6 years ago

Hi Mikko,

Hi Mikko,

Remember the cheap rs485 extension in which I started the topic with, at home I get it working. I'm really starting to think it's the smart meter that is the production has a bad rs485 connection that isn't working. I had again no luck with the Exsys rs485 usb on the location.

I still need your support on the following errors below, I know you gave me already in your latest post advice on how to deal with the errors but it's not helping:

So when I do the most simple command in Gurux.DLMS.Client.Example.python$ sudo python3 main.py -S /dev/ttyUSB0 -r sn I get the following output https://paste.ubuntu.com/p/6Bm5cs5kDZ/

I get the following errors: Access Error : Device reports Read-Write denied.

With the command you gave, it is not reading it at all: python3 main.py -S /dev/ttyUSB0 -r sn -a Low -P 00000000 -c 17 the output is here: https://paste.ubuntu.com/p/SyHRNDCkZb/

Is this because the client address is wrong or the password ?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi Ilhan,

Hi Ilhan,

Read-Write error is coming because those objects are not configured or implemented totally.
The reason might be either. password or client address can be wrong.

BR,
Mikko

ilhan

6 years ago

Ok thank you,

Ok thank you,
If I'm looking to just get the latest generated energy (solar) from a meter every 5 minutes, how woudl I go about this with the python library?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi Ilhan,

Hi Ilhan,

You need to know the object type and the logical name of the object. Then create a scheduler that makes a connection to the meter and collects data. There is -g parameter in the client example that reads wanted object using logical name and attribute index. Check that.

BR,
Mikko

ilhan

6 years ago

The is a great option to have

The is a great option to have in the Client software. I'm trying to read the following logical names, not sure if I'm doing the attribute index right:

-------- Reading 3 8224 Ch. 1 Sum Li Active power+ (QI+QIV) Time integral 1 Rate 0 (0 is total)
Index: 1 Value: 1.1.1.8.0.255
Index: 3 Value: 0.1, Unit.ACTIVE_ENERGY
Error! Index: 2 Access Error : Device reports Read-Write denied.
Access Error : Device reports Read-Write denied.
-------- Reading 3 8392 Ch. 1 Sum Li Active power- (QII+QIII) Time integral 1 Rate 0 (0 is total)
Index: 1 Value: 1.1.2.8.0.255
Index: 3 Value: 0.1, Unit.ACTIVE_ENERGY
Error! Index: 2 Access Error : Device reports Read-Write denied.
Access Error : Device reports Read-Write denied.

python3 main.py -S /dev/ttyUSB0 -r sn -g "1.1.1.8.0.255:1"

gurux_dlms version: 1.0.79
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Standard: Standard.DLMS
Unknown object : 10006 16
Unknown object : 10002 232
Unknown object : 10080 336
Unknown object : 10014 1976
Unknown object : 10017 2048
Unknown object : 10020 2184
Unknown object : 10018 2216
Unknown object : 10100 26400
Unknown object : 10040 2248
Unknown object : 10660 2496
Unknown object : 10010 33632
Unknown object : 10010 33688
Unknown object : 10010 33744
Unknown object : 10010 33800
Unknown object : 10010 33856
Unknown object : 10010 33912
Unknown object : 10010 33968
Unknown object : 10010 34024
Unknown object : 10011 34080
Unknown object : 10051 34136
Unknown object : 10050 34192
Unknown object : 10010 34248
Unknown object : 10010 34304
Unknown object : 10016 34360
Unknown object : 10023 34744
Unknown object : 10023 34872
Unknown object : 10025 42528
Unknown object : 10025 42600
Unknown object : 10025 42672
Unknown object : 10025 42744
Unknown object : 10025 42816
Unknown object : 10025 42888
Unknown object : 10025 42960
Unknown object : 10021 20000
Unknown object : 10022 43032
Unknown object : 10022 43096
Unknown object : 10022 43160
Unknown object : 10022 43224
Unknown object : 10022 43288
Unknown object : 10022 43352
Unknown object : 10022 43416
Unknown object : 10022 43480
Unknown object : 10022 43544
Unknown object : 10022 43608
Unknown object : 10022 43672
Unknown object : 10022 43736
Unknown object : 10022 43800
Unknown object : 10022 43864
Unknown object : 10022 43928
Unknown object : 10022 43992
Index: 1 Value: 1.1.1.8.0.255
DisconnectRequest
Ended. Press any key to continue.

From 1 up the errors just keep getting worse. Any ideas?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi Ilhan,

Hi Ilhan,

Those are not errors. Meter is implementing non-standard interfaces and client don't know what to do with them. You can just ignore Unknown objects.

You are now reading attribute index #1 and it's local name. Change index to #2 if you want to read value.

BR,
Mikko

ilhan

6 years ago

Hi Mikko,

Hi Mikko,

I get the following with the index of two:

python3 main.py -S /dev/ttyUSB0 -r sn -g "1.1.1.8.0.255:2"
gurux_dlms version: 1.0.79
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Standard: Standard.DLMS
Unknown object : 10006 16
Unknown object : 10002 232
Unknown object : 10080 336
Unknown object : 10014 1976
Unknown object : 10017 2048
Unknown object : 10020 2184
Unknown object : 10018 2216
Unknown object : 10100 26400
Unknown object : 10040 2248
Unknown object : 10660 2496
Unknown object : 10010 33632
Unknown object : 10010 33688
Unknown object : 10010 33744
Unknown object : 10010 33800
Unknown object : 10010 33856
Unknown object : 10010 33912
Unknown object : 10010 33968
Unknown object : 10010 34024
Unknown object : 10011 34080
Unknown object : 10051 34136
Unknown object : 10050 34192
Unknown object : 10010 34248
Unknown object : 10010 34304
Unknown object : 10016 34360
Unknown object : 10023 34744
Unknown object : 10023 34872
Unknown object : 10025 42528
Unknown object : 10025 42600
Unknown object : 10025 42672
Unknown object : 10025 42744
Unknown object : 10025 42816
Unknown object : 10025 42888
Unknown object : 10025 42960
Unknown object : 10021 20000
Unknown object : 10022 43032
Unknown object : 10022 43096
Unknown object : 10022 43160
Unknown object : 10022 43224
Unknown object : 10022 43288
Unknown object : 10022 43352
Unknown object : 10022 43416
Unknown object : 10022 43480
Unknown object : 10022 43544
Unknown object : 10022 43608
Unknown object : 10022 43672
Unknown object : 10022 43736
Unknown object : 10022 43800
Unknown object : 10022 43864
Unknown object : 10022 43928
Unknown object : 10022 43992
Traceback (most recent call last):
File "main.py", line 99, in main
val = reader.read(settings.client.objects.findByLN(ObjectType.NONE, k), v)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 324, in read
self.readDataBlock(data, reply)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 182, in readDataBlock
self.readDLMSPacket(data, reply)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 119, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 173, in readDLMSPacket2
raise GXDLMSException(reply.error)
gurux_dlms.GXDLMSException.GXDLMSException: Access Error : Device reports Read-Write denied.
DisconnectRequest
Ended. Press any key to continue.

With Index of 3 I get the following:

python3 main.py -S /dev/ttyUSB0 -r sn -g "1.1.1.8.0.255:3"
gurux_dlms version: 1.0.79
gurux_net version: 1.0.17
gurux_serial version: 1.0.14
Authentication: Authentication.NONE
ClientAddress: 0x10
ServerAddress: 0x1
Standard: Standard.DLMS
Unknown object : 10006 16
Unknown object : 10002 232
Unknown object : 10080 336
Unknown object : 10014 1976
Unknown object : 10017 2048
Unknown object : 10020 2184
Unknown object : 10018 2216
Unknown object : 10100 26400
Unknown object : 10040 2248
Unknown object : 10660 2496
Unknown object : 10010 33632
Unknown object : 10010 33688
Unknown object : 10010 33744
Unknown object : 10010 33800
Unknown object : 10010 33856
Unknown object : 10010 33912
Unknown object : 10010 33968
Unknown object : 10010 34024
Unknown object : 10011 34080
Unknown object : 10051 34136
Unknown object : 10050 34192
Unknown object : 10010 34248
Unknown object : 10010 34304
Unknown object : 10016 34360
Unknown object : 10023 34744
Unknown object : 10023 34872
Unknown object : 10025 42528
Unknown object : 10025 42600
Unknown object : 10025 42672
Unknown object : 10025 42744
Unknown object : 10025 42816
Unknown object : 10025 42888
Unknown object : 10025 42960
Unknown object : 10021 20000
Unknown object : 10022 43032
Unknown object : 10022 43096
Unknown object : 10022 43160
Unknown object : 10022 43224
Unknown object : 10022 43288
Unknown object : 10022 43352
Unknown object : 10022 43416
Unknown object : 10022 43480
Unknown object : 10022 43544
Unknown object : 10022 43608
Unknown object : 10022 43672
Unknown object : 10022 43736
Unknown object : 10022 43800
Unknown object : 10022 43864
Unknown object : 10022 43928
Unknown object : 10022 43992
Index: 3 Value: 0.1, Unit.ACTIVE_ENERGY
DisconnectRequest
Ended. Press any key to continue.

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

Please, don't post data that is not needed (Unknown object, etc).
You don't have access rights to the register value. Try to change the authentication level to Low.

ilhan

6 years ago

Ok, I'll get back on get the

Ok, I'll get back on get the right index value, right now another pressing issue. Currently at the office of the DSO that prepare the meters.

At the moment I'm looking to a meter that has the following index a 1.8.1 a value of 03107kWh, I'm hooked to it with a rs485 cable.

I cannot get the any value out, while calling the overal

Index: 1 Value: 1.1.1.8.1.255
Index: 3 Value: 0.1, Unit.ACTIVE_ENERGY
Error! Index: 2 Access Error : Device reports Read-Write denied.
Access Error : Device reports Read-Write denied.

Is this an Authentication issue ? I've tried with -a Low -P 00000000, but it errors out.

ilhan

6 years ago

I have asked the DSO about

I have asked the DSO about authenticaiton and they are saying that is should be no issue with the standard password of 00000000

This is the output of a whole Gurux Client:

https://paste.ubuntu.com/p/pvHtsHMhK3/

I need the the following values:
1.1.2.8.0.255
1.1.1.8.0.255

Do these need programming for your side ?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

sudo python3 main.py -S /dev/ttyUSB0 -r sn -c AKS_THIS_FROM_THE_MANUFACTURER -s 1 -a Low -P 00000000

If this is Indian meter, AKS_THIS_FROM_THE_MANUFACTURER is 32.

Note! Client example can handle only string passwords. If 00000000 is hex string you must hard code it.

BR,

Mikko

ilhan

6 years ago

Hi again,

Hi again,

You mean hardcoding the following line in GXsettings.py:

elif it.tag == 'P':
# Password
self.client.password = it.value

to:

self.client.password = 00000000 ?

Furthermore does -c require additional steps other than filling in Authentication or Encrypted after the parameter?
I'm from the Netherlands, sure they are not Indian meters, but also the DSO and Manufacturer, don't know much about the authentication, so if you have any idea's how to get past this, please let me know. Thank you so far for helping me out.

Profile picture for user Kurumi

Kurumi

6 years ago

Hi,

Hi,

Try with this:

self.client.password = GXByteBuffer.hexToBytes("00000000")

Try with this to use Low authentication:
-c 17

Note! 'c' and 'C' are doing different things. 'c' changes client address and that is what you need to do.

BR,

Mikko

ilhan

6 years ago

That didn't work. Trying to

That didn't work. Trying to find the -c value from the manual:

For point-to-point connections, the device does not need to be specially addressed. However, with multi-drop, all devices connected to a bus system (RS485 or CS) must have their own address for individual access. This address is called the physical device address. In fact, even two physical device addresses are used, one for the IEC protocol (IEC device address) and the other for the DLMS protocol (HDLC device address). Unless otherwise specified on the order, the following parameter values are set as defaults for these physical device addresses:

- Physical IEC device address = serial number (printed on face plate of device), e.g. 73852799.
- Physical HDLC device address = last 4 digits of serial number plus 1000 (because with dlms the range of addresses is limited and some addresses are reserved), e.g. 3799 for a serial number 73852799 (2799 + 1000 = 3799).

The serial number of the meter I'm trying to read is 50399974, this is the NO written on the meter and not on the modem module attached to it.

Tried IEC:
python3 main.py -S /dev/ttyUSB0 -a Low -c 50399974 -i

DisconnectRequest
Traceback (most recent call last):
File "main.py", line 104, in main
reader.readAll(settings.outputFile)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 504, in readAll
self.initializeConnection()
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 304, in initializeConnection
self.initializeOpticalHead()
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 201, in initializeOpticalHead
raise Exception("Failed to received reply from the media.")
Exception: Failed to received reply from the media.

And the HDLC: python3 main.py -S /dev/ttyUSB0 -a Low -c 0974

DisconnectRequest
Traceback (most recent call last):
File "main.py", line 104, in main
reader.readAll(settings.outputFile)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 504, in readAll
self.initializeConnection()
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 306, in initializeConnection
data = self.client.snrmRequest()
File "/home/pi/.local/lib/python3.7/site-packages/gurux_dlms/GXDLMSClient.py", line 458, in snrmRequest
return GXDLMS.getHdlcFrame(self.settings, Command.SNRM, data)
File "/home/pi/.local/lib/python3.7/site-packages/gurux_dlms/GXDLMS.py", line 745, in getHdlcFrame
secondaryAddress = cls.getAddressBytes(settings.clientAddress, 1)
File "/home/pi/.local/lib/python3.7/site-packages/gurux_dlms/GXDLMS.py", line 694, in getAddressBytes
bb.setUInt8(tmp)
File "/home/pi/.local/lib/python3.7/site-packages/gurux_dlms/GXByteBuffer.py", line 217, in setUInt8
self.setUInt8(item, self.size)
File "/home/pi/.local/lib/python3.7/site-packages/gurux_dlms/GXByteBuffer.py", line 222, in setUInt8
self._data[index] = item
ValueError: byte must be in range(0, 256)

Profile picture for user Kurumi

Kurumi

6 years ago

Hi Ilhan,

Hi Ilhan,

There is a misunderstanding. If you want to use meter address then you can give it using -n parameter.
-n 50399974

If you can connect without authentication you don't need to change server address.
You need to give the correct password, authentication level and client address.

I propose that you try to connect with GXDLMSDirector first.
Select L+G as manufacturer and set the correct password.

I don't know is 00000000 hex or not. You just need to try to find the correct parameters.

BR,
Mikko

ilhan

6 years ago

Hi Kurumi,

Hey Mikko,

Did some research with the Map110 software and back with some details:
With map110 you need different client levels that correspond the different client addresses. With [0] I cannot get any data out, with level [1] I can get the meter values out. Level 1 has client address 32

I have taken screenshots of the settings, downloaded the logs and the corresponding values.
Please see this link for the meter-values logs and attachments of the settings:
https://blocklabnl-my.sharepoint.com/:f:/g/personal/ilhan_blocklab_nl/E…

Client [1] requires a low level authentication that requires a password: See the attachments:
-Device Settings - Access Levels
- authentication level - Client 1 Data Collection - secret string

Coming back to Gurux.Client my command after some playing around I found the one that works:

sudo python3 main.py -S /dev/ttyUSB0:9600:8None1 -r sn -c 32 -s 1 -a Low -P 00000000

-------- Reading 3 8224 Ch. 1 Sum Li Active power+ (QI+QIV) Time integral 1 Rate 0 (0 is total)
Index: 1 Value: 1.1.1.8.0.255
Index: 3 Value: 0.1, Unit.ACTIVE_ENERGY
Index: 2 Value: 2356106.5
-------- Reading 3 8392 Ch. 1 Sum Li Active power- (QII+QIII) Time integral 1 Rate 0 (0 is total)
Index: 1 Value: 1.1.2.8.0.255
Index: 3 Value: 0.1, Unit.ACTIVE_ENERGY
Index: 2 Value: 18221626.2

I get the values I need, so this already a great achievement!

They however have a different decimal point then the Map110:
1-1:1.8.0,2356","1065,kWh,Active energy import +A (QI+QIV),Energy Total
1-1:2.8.0,18221","6262,kWh,Active energy export -A (QII+QIII),Energy Total

1st reads 2356kWh, 2nd 18221 kWh.
The comma after those are the decimals of kWh.Why is the format different ?
We can figure a way out with this though
_______________________________________________________________________

Now coming to the real meter that is connected to solar panels, I can access it remotely with a PI.

With the same command : sudo python3 main.py -S /dev/ttyUSB0:9600:8None1 -r sn -c 32 -s 1 -a Low -P 00000000

I get the following output:

Data send failed. Try to resend 1/3
Data send failed. Try to resend 2/3
RX: 14:54:15
DisconnectRequest
Traceback (most recent call last):
File "main.py", line 104, in main
reader.readAll(settings.outputFile)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 504, in readAll
self.initializeConnection()
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 308, in initializeConnection
self.readDLMSPacket(data, reply)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 119, in readDLMSPacket
self.readDLMSPacket2(data, reply)
File "/home/pi/Gurux.DLMS.Python/Gurux.DLMS.Client.Example.python/GXDLMSReader.py", line 170, in readDLMSPacket2
raise e
File "/home/pi/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.

Any idea's why ?

Profile picture for user Kurumi

Kurumi

6 years ago

Hi Ilhan,

Hi Ilhan,

We are showing the value that is read from the meter.
2356106.5 Wh
Map is shown it as kWh
2356kWh

Multiple the value by 1000 and you get kWh.

Check your baud rate. Are you using a serial port or optical port with PI?

BR,
Mikko

ilhan

6 years ago

All solved `python3 main.py

All solved `python3 main.py -S /dev/ttyUSB0:9600:8None1 -r sn -c 32 -s 1 -a Low -P 00000000 -g 1.1.2.8.0.255:2`

does the trick now, seems that the rs485 cable wasn't placed well. Thank you for your support.

Profile picture for user Kurumi

Kurumi

5 years 12 months ago

Hi Ilhan,

Hi Ilhan,

Thanks for letting me know the reason. Cables are causing most of the problems. Happy coding.

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