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 7 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 7 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 7 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 7 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 7 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, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101
  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202

New forum topics

  • Need RJ45 pin configuration for Saral 300 and Saral 305 Secure meters
  • Query Regarding Class 63 Status Mapping Support in Gurux DLMS Python
  • Inhemeter
  • DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries
  • HDLC Frames sequencing
More

Who's new

  • Asier Sierra
  • BlessyAnn
  • sravya.thota@m…
  • Diwakar
  • williamorussell
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin