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. Event Logging For Button Presses In Gurux DLMS Arduino

Event Logging for Button Presses in Gurux DLMS Arduino

By Alan4510471 , 18 December, 2024
Forums
Gurux DLMS for ANSI C

Good morning, Forum!

I'm new to Arduino and might have missed some important details in the code descriptions or documentation. I need assistance in creating an event log to record every time a button connected to a digital pin is pressed or released.

Specifically, I'm using Gurux DLMS Arduino and would like to know which functions I should use to achieve this.

For reference, I’ve successfully implemented a similar setup using Gurux DLMS .Net on a Raspberry Pi. In that setup:
1. I added a profile generic for a [push button log] and a [status register].
2. I wrote a function to monitor the button state. 
a) When the button is pressed, I set the value in the push button register to 1 (10000000) and also update the bit in the status register.
b) When the button is released, I reset the bit back to 0.

Using this method, I could read and verify the results in GXDLMS Director. The value always updated when the button is pressed or released.

Now, I want to replicate this functionality on an Arduino using Gurux. Could someone guide me on how to do it? Any help or pointers to the documentation would be greatly appreciated!

Best regards,
Alan

Profile picture for user Kurumi

Kurumi

1 year 5 months ago

Hi, Check the up event …

Hi,

Check the up event (GURUX_EVENT_CODES_POWER_UP) from the server example:

https://github.com/Gurux/GuruxDLMS.c/blob/bee824516bb45180ae7f701da6517…

You can add a new event to GURUX_EVENT_CODES and then set it when you want to like this.

updateState(GURUX_EVENT_CODES_POWER_UP);

BR,
Mikko

Alan4510471

1 year 3 months ago

Sorry for the late reply…

Sorry for the late reply. This is just what I need and it works perfectly.
Thank you!

  • 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