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. Few Bugs Found In GuruxDLMS.c For Arduino

Few bugs found in GuruxDLMS.c for Arduino

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 Jeroen88 , 10 April, 2021
Forums
General discussion

Hi Mikko,

I found a few bugs in the GuruxDLMS.c library:

In gxsetmalloc.c at https://github.com/Gurux/GuruxDLMS.c/blob/4589a382593d5e6911586850fb2c7…
if (ret != DLMS_ERROR_CODE_UNAVAILABLE_OBJECT)
should be (I think)
if (ret == DLMS_ERROR_CODE_OK)
because cosem_createObject(class_id, &object) can also return other error codes. I am also surprised that this function gets executed (while retrieving the object list) because I am using SN and this line is part of the function cosem_parseLNObjects(dlmsSettings* settings, gxByteBuffer* data, objectArray* objects).

In helpers.c at https://github.com/Gurux/GuruxDLMS.c/blob/4589a382593d5e6911586850fb2c7…
#if defined(_WIN32) || defined(_WIN64) || defined(__linux__)
I changed it into
#if defined(_WIN32) || defined(_WIN64) || defined(__linux__) || defined(ESP32)
because I use that MCU

In variant.c at https://github.com/Gurux/GuruxDLMS.c/blob/4589a382593d5e6911586850fb2c7…
hlp_int64ToString(buff, 250, tmp.uiVal, 1)
should be
hlp_int64ToString(buff, 250, tmp.llVal, 1)

Best Jeroen

Profile picture for user Kurumi

Kurumi

5 years 2 months ago

Hi Jeroen,

Hi Jeroen,

Thank you for the hlp_int64ToString and cosem_createObject information. That is now updated.

If your meter is using a short name referencing cosem_parseSNObjects is called and not the cosem_parseSNObjects. Make sure that you haven't made any changes to the source code.

BR,
Mikko

Jeroen88

5 years 2 months ago

Hi Mikko,

Hi Mikko,

So say "If your meter is using a short name referencing cosem_parseSNObjects is called and not the cosem_parseSNObjects. Make sure that you haven't made any changes to the source code."

I do not understand your answer (because you say cosem_parseSNObjects twice)

The meter is using SN, but the (unmodified) code calls cosem_parseLNObjects, so the parsing for Logical Names. That surprises me, but maybe it is correct.

Profile picture for user Kurumi

Kurumi

5 years 2 months ago

Hi,

Hi,

Sorry, it's a typo. If your meter is using short name referencing it's calling cosem_parseSNObjects.
cosem_parseLNObjects is called when logical name referencing is used.

BR,
Mikko

  • 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