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. Forums
  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 2 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 2 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 2 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 2 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 2 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

  • 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

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin