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 7 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 4 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin