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. Object Not Subscriptable

Object not subscriptable

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 MartinK , 6 January, 2022
Forums
Gurux.DLMS

Dear all,
I am using Gurux DLMS as part of the "smartmeter-datacollector" Python software.
I am able to read messages from /dev/ttyUSB0, but after "DLMS packet complete and ready for parsing" the software crashes with a Python error "Object not subscriptable".

For code and message see my previously rosen issue here: https://github.com/Gurux/Gurux.DLMS.Python/issues/36

Any ideas or help?

Thanks

Martin

Profile picture for user Kurumi

Kurumi

4 years 5 months ago

Hi,

Hi,

Your data in the bytearray looks strange. What meter are you trying to read? Is this error happening with the client example?

BR,
Mikko

MartinK

4 years 5 months ago

I try to read an Austrian

I try to read an Austrian Landis+Gyr e450 meter.
I try to use Smartmeter Datacollector 1.0.1 (https://github.com/scs/smartmeter-datacollector) which relies on Gurux DLMS 1.0.107.
I also got a decrypt key (2 actually, decrypt+auth keys) from my grid operator. I set the decrypt key in the config file of smartmeter-datacollector.

Here's a sample packet and the error again:

DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 7B E3 BD 82 01 03 30 00 06 DD 47 60 62 98 7B 48 2B 68 B1 E5 17 93 F1 16 46 F1 59 0B 0F 41 10 78 73 44 1C 0A 39 F3 A1 B1 80 3A 9F 41 3C 56 10 6B 33 2E 5D FE BB F6 4A BA 7C A5 69 2E FE F1 CF 73 D0 D4 68 E8 E4 88 B7 A8 4E 69 CA 77 CA 67 95 65 43 1C 0D 95 7D 9C 3F 4C ED B1 D0 84 41 8C 8C D7 3E 47 05 1D 10 A0 D8 75 81 18 28 44 66 7A B4 76 8D 09 7E
DEBUG:smartmeter:More DLMS data expected. Not yet ready to be parsed.
DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 7B E3 BD 82 01 03 30 00 06 DD 47 60 62 98 7B 48 2B 68 B1 E5 17 93 F1 16 46 F1 59 0B 0F 41 10 78 73 44 1C 0A 39 F3 A1 B1 80 3A 9F 41 3C 56 10 6B 33 2E 5D FE BB F6 4A BA 7C A5 69 2E FE F1 CF 73 D0 D4 68 E8 E4 88 B7 A8 4E 69 CA 77 CA 67 95 65 43 1C 0D 95 7D 9C 3F 4C ED B1 D0 84 41 8C 8C D7 3E 47 05 1D 10 A0 D8 75 81 18 28 44 66 7A B4 76 8D 09 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A 32 FB C0 29 F9 E3 0B 3C 60 09 57 5B 83 40 AF AD ED 6F 87 2C 24 51 4A 1A 00 2E AB EE BA 77 6D D3 E2 EF 39 0D 50 C5 1E B5 F6 77 94 9D 09 7C 19 6C 0E C8 59 31 C5 66 61 2C 18 86 2A E2 3D D7 DB 0C E4 2B E7 A4 5D 34 98 7D 46 78 14 35 72 6B AB CF 44 CE EE BF C5 A6 05 42 D0 88 AB BB 44 56 85 36 3B 6A 3F D7 CA 32 33 A5 8E 3E 8D 41 68 3F 7B 53 0A 79 AB F2 B3 22 5A 2D 47 89 DC 8C 7E
DEBUG:smartmeter:More DLMS data expected. Not yet ready to be parsed.
DEBUG:smartmeter:HDLC Buffer: 7E A0 8B CE FF 03 13 EE E1 E6 E7 00 E0 40 00 01 00 00 77 DB 08 4C 47 5A 67 73 7B E3 BD 82 01 03 30 00 06 DD 47 60 62 98 7B 48 2B 68 B1 E5 17 93 F1 16 46 F1 59 0B 0F 41 10 78 73 44 1C 0A 39 F3 A1 B1 80 3A 9F 41 3C 56 10 6B 33 2E 5D FE BB F6 4A BA 7C A5 69 2E FE F1 CF 73 D0 D4 68 E8 E4 88 B7 A8 4E 69 CA 77 CA 67 95 65 43 1C 0D 95 7D 9C 3F 4C ED B1 D0 84 41 8C 8C D7 3E 47 05 1D 10 A0 D8 75 81 18 28 44 66 7A B4 76 8D 09 7E 7E A0 8B CE FF 03 13 EE E1 E0 40 00 02 00 00 7A 32 FB C0 29 F9 E3 0B 3C 60 09 57 5B 83 40 AF AD ED 6F 87 2C 24 51 4A 1A 00 2E AB EE BA 77 6D D3 E2 EF 39 0D 50 C5 1E B5 F6 77 94 9D 09 7C 19 6C 0E C8 59 31 C5 66 61 2C 18 86 2A E2 3D D7 DB 0C E4 2B E7 A4 5D 34 98 7D 46 78 14 35 72 6B AB CF 44 CE EE BF C5 A6 05 42 D0 88 AB BB 44 56 85 36 3B 6A 3F D7 CA 32 33 A5 8E 3E 8D 41 68 3F 7B 53 0A 79 AB F2 B3 22 5A 2D 47 89 DC 8C 7E 7E A0 30 CE FF 03 13 86 F8 E0 C0 00 03 00 00 1F 27 6C 2B FD B6 56 6F 75 A4 3B CD D3 BC E8 B6 73 00 88 44 99 20 3C 2F 7D 16 AE 21 F5 FC 94 57 F7 D0 7E
DEBUG:smartmeter:DLMS packet complete and ready for parsing.
INFO:root:App shutting down now.
Traceback (most recent call last):
File "/home/pi/.local/bin/smartmeter-datacollector", line 14, in <module>
app.main()
File "/home/pi/.local/lib/python3.9/site-packages/smartmeter_datacollector/app.py", line 69, in main
asyncio.run(build_and_start(app_config), debug=debug_mode)
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.9/site-packages/smartmeter_datacollector/app.py", line 27, in build_and_start
await asyncio.gather(
File "/home/pi/.local/lib/python3.9/site-packages/smartmeter_datacollector/smartmeter/meter.py", line 46, in start
await self._serial.start_and_listen()
File "/home/pi/.local/lib/python3.9/site-packages/smartmeter_datacollector/smartmeter/serial_reader.py", line 45, in start_and_listen
self._callback(data)
File "/home/pi/.local/lib/python3.9/site-packages/smartmeter_datacollector/smartmeter/meter.py", line 57, in _data_received
dlms_objects = self._parser.parse_to_dlms_objects()
File "/home/pi/.local/lib/python3.9/site-packages/smartmeter_datacollector/smartmeter/hdlc_dlms_parser.py", line 84, in parse_to_dlms_objects
parsed_objects = self._client.parsePushObjects(self._dlms_data.value[0])
File "/home/pi/.local/lib/python3.9/site-packages/gurux_dlms/GXDLMSClient.py", line 1257, in parsePushObjects
classID = tmp[0]
TypeError: 'int' object is not subscriptable

Profile picture for user Kurumi

Kurumi

4 years 5 months ago

Hi,

Hi,

Your meter doesn't send the list of the objects as a first parameter. For this reason, you can't use parsePushObjects. You can show data as XML or print it like in this example:

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

BR,
Mikko

MartinK

4 years 5 months ago

Thanks a lot for this

Thanks a lot for this important information!

  • 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