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. Node
  3. Best Way To Simulate a DLMS With PC

Best way to simulate a DLMS with PC

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.

Profile picture for user rafamarca
By rafamarca , 23 March, 2021
Forums
General discussion

Hi all,

I am new to the DLMS and the forum... I have been reading as much as I could but I do not have a clear idea whether it is possible to emulate or simulate a DLMS meter with my PC and then connnect a hardware through the serial port (like a HHU) to read the simulated OBIS objects from the PC DLMS meter.

Do you have any suggestion? Thanks a lot in advanced!!

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

Hi,

Hi,

Download example server and start that -S parameter, ex. -S COM1. It's now using the serial port that you defined and you can connect from your HW. Add also -t Verbose and you can see received and send messages.
https://github.com/Gurux/Gurux.DLMS.Net/tree/master/Gurux.DLMS.Server.E…
BR,
Mikko

Profile picture for user rafamarca

rafamarca

5 years 5 months ago

Hi Mikko,

Hi Mikko,

Thanks a lot for your kind answer! I have cloned and compiled the code you adviced without problems. I have a serial com port COM11 in my device manager/serial ports. When I run the exe with the suggested flags (-S COM11 -t Verbose) it seems that the thread is not launched. If I run only with -t Verbose the thread is launched... please see attached picture. Am I doing something wrong? Is there any additional serial port configuration I am missing? (like baud rate, number of bits, parity, stop bit?)

Image
Profile picture for user rafamarca

rafamarca

5 years 5 months ago

Actually, I am not an expert

Actually, I am not an expert on .Net but reviewing the code I could see that the only options I could add are: -t and -p, right?

while ((opt = getopt(argc, argv, "t:p:")) != -1)
{
switch (opt)
{
case 't':
//Trace.
if (strcmp("Error", optarg) == 0)
trace = GX_TRACE_LEVEL_ERROR;
else if (strcmp("Warning", optarg) == 0)
trace = GX_TRACE_LEVEL_WARNING;
else if (strcmp("Info", optarg) == 0)
trace = GX_TRACE_LEVEL_INFO;
else if (strcmp("Verbose", optarg) == 0)
trace = GX_TRACE_LEVEL_VERBOSE;
else if (strcmp("Off", optarg) == 0)
trace = GX_TRACE_LEVEL_OFF;
else
{
printf("Invalid trace option '%s'. (Error, Warning, Info, Verbose, Off)", optarg);
return 1;
}
break;
case 'p':
//Port.
port = atoi(optarg);
break;
case '?':
{
if (optarg[0] == 'p')
{
printf("Missing mandatory port option.\n");
}
else if (optarg[0] == 't')
{
printf("Missing mandatory trace option.\n");
}
else
{
showHelp();
return 1;
}
}
break;
default:
showHelp();
return 1;
}
}

I think I well might be missing something...
Thanks a lot for the support!

Profile picture for user Kurumi

Kurumi

5 years 5 months ago

Hi,

Hi,

ANSI C is not support serial port. Try with C# version.
Parameters are:
-S COM11 -t Verbose

BR,
Mikko

Profile picture for user rafamarca

rafamarca

5 years 5 months ago

Hi Mikko,

Hi Mikko,

I have got the server up and running though serial port. Thanks a lot for your great support!! super!!

BR

Rafa

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202
  • Mon, 08/17/2026 - 09:47
    gurux.dlms.cpp 9.0.2608.1701
  • Mon, 08/17/2026 - 09:25
    gurux.dlms.c 9.0.2608.1701
  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701

New forum topics

  • Security vulnerability report — request for a private contact (GuruxDLMS.c / ANSI C)
  • Topic: Insufficient Memory Error When Reading Class 7 Profile Generic Objects
  • SN ReadResponse returns all-null values when response spans multiple HDLC frames
  • Gurux.Serial.Android 3.0.6 – CH340 (HL-340) USB-Serial Adapter Not Working,
  • Trying to talk to a L&G E360 meter (Using Python Gurux)
More

Who's new

  • cyby
  • Metin Onan
  • ssv007
  • 3nzol3dur
  • dw772
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin