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. ESP32-Based Smart Meter Interface Via DLMS/COSEM

ESP32-Based Smart Meter Interface via DLMS/COSEM

Profile picture for user aria_12
By aria_12, 16 July, 2025
Forums
General discussion

Hi everyone, I’m prototyping a smart meter interface using an ESP32 to read DLMS/COSEM data over RS-485 and then relay that information via MQTT. For inspiration on reliable multi-node communication, I found this guide on ESP-NOW peer-to-peer networking really insightful:
https://www.theengineeringprojects.com/2022/01/esp-now-protocol-with-es…

I’ve also reviewed Gurux’s own DLMS implementation examples and came across a community Arduino–ESP32 RS-485 telemetry setup that emphasizes buffer management. My main challenge is ensuring stable DLMS frame parsing and MQTT transmission without timing conflicts. Has anyone used ESP32 in production with DLMS, how did you manage serial buffering, task prioritization, and recovery from communication errors?

Profile picture for user Kurumi

Kurumi

3 months 2 weeks ago

Hi, When you receive MQTT…

Hi,

When you receive MQTT message, you must establish the connection to the meter and read data. Then close the connection.

You can't leave the connection open, because there is an inactivity timeout and the meter will close the connection after that time.

https://gurux.fi/Gurux.DLMS.Objects.GXDLMSIecHdlcSetup

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 10/29/2025 - 08:51
    gurux.dlms.c 9.0.2510.2901
  • Thu, 10/16/2025 - 09:59
    gurux.dlms.java 4.0.83
  • Wed, 10/08/2025 - 10:21
    gurux.dlms.c 9.0.2510.0801
  • Fri, 09/26/2025 - 10:02
    gurux.dlms.cpp 9.0.2509.2601
  • Fri, 09/26/2025 - 09:45
    gurux.dlms.c 9.0.2509.2601

New forum topics

  • Guidance on using the source codes
  • How to get/convert user readable format data from readRowsByRange
  • Insufficient memory to continue the execution of the program.
  • The client instance code failed to connect to the electricity meter for authentication
  • Unable to Release Request when closing connection with meter.
More
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin