Skip to main content
Home
for DLMS smart meters

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Read Push Messages

Read Push messages

By dtrt, 24 April, 2023
Forums
Gurux.DLMS

Hi,

first of all I'm not sure, if I use the correct forum. I posted already the same question but could not find it later, strange. So a new try:

I want to read push messages with an ESP32. I started with the example for Arduino pushListener in the GuruxDLMS.c branch. I know that the software receives messages, but nothing is decoded, nothing printed.
I was able to use the python Push.Listener on windows (MacOS and Linux fails) and it printed the decoded values, without any additional configuration. (except for the serial line interface)
0.8.25.9.0.255 1: 0.8.25.9.0.255
1 0.0.96.1.0.255 2: 61773732
3 1.0.1.7.0.255 2: 78
3 1.0.2.7.0.255 2: 0
3 1.0.3.7.0.255 2: 0
3 1.0.4.7.0.255 2: 11
3 1.1.1.8.0.255 2: 4812
3 1.1.2.8.0.255 2: 0
3 1.1.5.8.0.255 2: 0
3 1.1.6.8.0.255 2: 0
3 1.1.7.8.0.255 2: 0
3 1.1.8.8.0.255 2: 1404

So I wonder, how to setup the pushListener on C.

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, Check this example. It…

Hi,

Check this example. It does what you want to do:
https://github.com/Gurux/GuruxDLMS.c/tree/master/GuruxDLMSPushExample

BR,
Mikko

dtrt

3 years 1 month ago

Hi Mikko, thanks for your…

Hi Mikko,

thanks for your hint.
I wonder if your example proposal is the better approach, when my target plattform is Arduino ESP32.
After I set the client address to 0x33FF
I see the debug message "data complete", but the next check for data.moreData returns 4( DLMS_DATA_REQUEST_TYPES_GBT) instead of 0.
if (data.moreData == DLMS_DATA_REQUEST_TYPES_NONE)

I've tried the following setup with now success
client Address 16 does not comes back with data complete, the hint for the strane 0x33FF comes from the Gurux Director

Notify.init(true, 0x33FF, 1, DLMS_AUTHENTICATION_NONE, NULL, DLMS_INTERFACE_TYPE_HDLC);
{
const unsigned char ln[6] = {1, 0, 1, 7, 0, 255};
INIT_OBJECT(pushSetup, DLMS_OBJECT_TYPE_PUSH_SETUP, ln);
}
arr_push(&pushSetup.pushObjectList, key_init(&pushSetup, co_init(2, 0)));
arr_push(&pushSetup.pushObjectList, key_init(&clock1, co_init(2, 0)));

here an example of the HDLC frame
7E A0 84 CE FF 03 13 12 8B E6 E7 00 E0 40 00 01 00 00 70 0F 00 01 BC 51 0C 07 E7 04 17 07 10 15 05 FF 80 00 00 02 0D 01 0D 02 04 12 00 28 09 06 00 08 19 09 00 FF 0F 02 12 00 00 02 04 12 00 28 09 06 00 08 19 09 00 FF 0F 01 12 00 00 02 04 12 00 01 09 06 00 00 60 01 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 01 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 02 07 00 FF 0F 02 12 00 00 A9 E9 7E 7E A0 7D CE FF 03 13 D0 45 E0 40 00 02 00 00 6C 02 04 12 00 03 09 06 01 00 03 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 00 04 07 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 01 01 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 01 02 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 01 05 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 01 06 08 00 FF 0F 02 12 00 00 19 3D 7E 7E A0 79 CE FF 03 13 C0 68 E0 C0 00 03 00 00 68 02 04 12 00 03 09 06 01 01 07 08 00 FF 0F 02 12 00 00 02 04 12 00 03 09 06 01 01 08 08 00 FF 0F 02 12 00 00 09 06 00 08 19 09 00 FF 09 08 36 31 37 37 33 37 33 32 06 00 00 00 4F 06 00 00 00 00 06 00 00 00 00 06 00 00 00 0A 06 00 00 12 9B 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 00 00 06 00 00 05 76 A3 E9 7E

Do you have any additional hint for the Arduino example?

Profile picture for user Kurumi

Kurumi

3 years 1 month ago

Hi, Your HDLC frame is not…

Hi,

Your HDLC frame is not correct. Ask if there is a firmware update available from the meter vendor that fixes this. It also might be that your serial port settings are not correct and frame is corrupted because of that.

BR,
Mikko

dtrt

3 years 1 month ago

Hi Mikko, my fault, the copy…

Hi Mikko,
my fault, the copy paste lost the leading 0. I have replaced it with a new one. My current assumption is, that the DLMS message consist of 3 HDLC PDUs.

dtrt

3 years 1 month ago

I was able to dig a bit…

I was able to dig a bit deeper in the Arduino PushListener.
My little knowledge about the DLMS tells me, my messages are GBT messages, consisting of several HDLC frames. The example assumes that there is exactly one HDLC frame. It evens deletes the following HDLC frame as soon the first one is detected as complete.
Line 139 in the pushListener.ino
if (data.complete)
{
bb_empty(&frameData);
In general this might work if there is enough time between the frames and there is no hardware buffer in the serial. prefered would be a ringbuffer for the frameData.

Nevertheless I guess the main question is about the reassembling of the GBT frame.
May be I can find the answer in the python implementation.

  • 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
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin