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. Node
  3. Metcom MCS301 ProfileGeneric ReadRowsByRange Not Working

Metcom MCS301 ProfileGeneric readRowsByRange not working

By Slavo , 3 December, 2024
Forums
Gurux.DLMS

Hi I'm new here and want to ask you, why reading ProfileGeneric with method readRowsByRange is not working for Metcom MCS301?
Method readRowsByEntry is working ok.
I think it is in datetime formatting, because data comming from meter are like this:

11/24/24 02:00:00 | 743 | 62682
11/25/24 02:00:00 | 750 | 62976
11/25/24 02:00:00 | 750 | 62976
11/26/24 02:00:00 | 756 | 63983
11/26/24 02:00:00 | 756 | 63983

But when I try to format it like this, tyhis error appears:

python : Traceback (most recent call last):
At line:1 char:1
+ python main3.py ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

File "main3.py", line 95, in main
cells = reader.readRowsByRange(profile, dt_from, dt_to)
File "C:\Users\Administrator\Documents\Gurux.DLMS.Python\Gurux.DLMS.Client.Example.python\GXDLMSReader.py", line 358, in readRowsByRange
data = self.client.readRowsByRange(pg, start, end)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gurux_dlms\GXDLMSClient.py", line 1381, in readRowsByRange
_GXCommon.setData(self.settings, buff, DataType.OCTET_STRING, start)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gurux_dlms\internal\_GXCommon.py", line 1378, in setData
cls.setDateTime(settings, buff, value)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\gurux_dlms\internal\_GXCommon.py", line 1560, in setDateTime
d = int(dt.value.utcoffset().seconds / 60)
AttributeError: 'NoneType' object has no attribute 'seconds'

Thx a lot.

Profile picture for user Kurumi

Kurumi

1 year 9 months ago

Hi, You have given None…

Hi,

You have given None value to the start or end time. Check the client example:

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

BR,
Mikko

Slavo

1 year 9 months ago

Hi, everything works fine…

Hi, everything works fine.
My mistake - switched start and end date.
Thanks for your answer.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin