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. Reading Meters Using Dynamic IP Addresses In GPRS Connection

Reading meters using Dynamic IP addresses in GPRS connection

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.

By orondelli , 27 September, 2021
Forums
Gurux.Net

Hi,

do you have any examples using the GXDLMSSecureClient?

I have a copy of Gurux.DLMS.Meter.Listener.Net but it uses GXDLMSClient.

Just wondering if I can just replace GXDLMSClient with GXDLMSSecureClient on the code itself (adding the required parameters for the secure connection).

Thanks

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

You can use GXDLMSSecureClient the same way as GXDLMSClient. THe only difference is that you can give secure settings for the GXDLMSSecureClient.

BR,
Mikko

orondelli

4 years 8 months ago

Hi Mikko,

Hi Mikko,

can I still use GXDLMSSecureClient for the public client?

I am getting: Invalid Command

Thanks

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

Yes, you can if the security is None.

BR,
Mikko

orondelli

4 years 8 months ago

Hi,

Hi,

I downloaded the latest

Send SNRM request.7E A0 07 03 21 93 0F 01 7E

the program got stuck on Media.Receive(p)

Do you know why? Do I need to change any setttings on the json file

Thanks

orondelli

4 years 8 months ago

I downloaded the latest Gurux

I downloaded the latest Gurux.DLMS.AMI

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

There might be several reasons for this if you are using a GPRS connection and the meter is starting the connection.

You need first to check if you should use WRAPPER as an interface. Not you are using HDLC.

BR,
Mikko

orondelli

4 years 8 months ago

Interface is WRAPPED (1), the

Interface is WRAPPED (1), the connection is NB-IoT... does it make any difference? It doesn't even retry

orondelli

4 years 8 months ago

Hi,

Hi,

appsettings.json
appsettings.Development.json

I think something not working as expected?

I am only changing appsettings.Development.json (Interface 1) but the (InterfaceType)listener.Interface is 0 when calling GXDLMSSecureClient(listener.UseLogicalNameReferencing, listener.ClientAddress, listener.ServerAddress, (Authentication)listener.Authentication, listener.Password, (InterfaceType)listener.Interface);

orondelli

4 years 8 months ago

it looks like it is only

it looks like it is only looking at appsettings.json for Interface

orondelli

4 years 8 months ago

so it now seems to receive

so it now seems to receive data from the meter but still: Invalid Command after sending AARQ:

Client 95.129.20.27:13398 is connected.
Send AARQ request
TX: 03:29:02 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 5D FF FF
info: Gurux.DLMS.AMI.Notify.GXListenerService[0]
TX: 03:29:02 00 01 00 10 00 01 00 1F 60 1D A1 09 06 07 60 85 74 05 08 01 01 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 5D FF FF
RX: 03:29:03 00 01 00 01 00 01 00 24 DB 08 93 15 03 00 03 00 25 03 19 30 00 00 00 00 14 44 D5 58 3B 7A 94 0C EF 3A 5F 0A 3E 81 41 4E F0 CF 6D B7
info: Gurux.DLMS.AMI.Notify.GXListenerService[0]
RX: 03:29:03 00 01 00 01 00 01 00 24 DB 08 93 15 03 00 03 00 25 03 19 30 00 00 00 00 14 44 D5 58 3B 7A 94 0C EF 3A 5F 0A 3E 81 41 4E F0 CF 6D B7
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
Request starting HTTP/1.1 POST http://localhost:64881/api/SystemError/AddSystemError application/json 90
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
Executing endpoint 'DBService.Controllers.SystemErrorController.Post (Gurux.DLMS.AMI)'
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]
Route matched with {action = "Post", controller = "SystemError"}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult`1[Gurux.DLMS.AMI.Messages.Rest.AddSystemErrorResponse] Post(Gurux.DLMS.AMI.Messages.Rest.AddSystemError) on controller DBService.Controllers.SystemErrorController (Gurux.DLMS.AMI).
info: Gurux.DLMS.AMI.Startup[0]
GXSQL: INSERT INTO GXSystemError ("Generation", "Error", "Level") VALUES('2021-09-28 15:29:03', 'Invalid Command.', 0)
info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1]
Executing ObjectResult, writing value of type 'Gurux.DLMS.AMI.Messages.Rest.AddSystemErrorResponse'.
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]
Executed action DBService.Controllers.SystemErrorController.Post (Gurux.DLMS.AMI) in 6.844ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
Executed endpoint 'DBService.Controllers.SystemErrorController.Post (Gurux.DLMS.AMI)'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
Request finished in 15.974ms 200 application/json; charset=utf-8
Disconnecting from the meter.

Thanks

orondelli

4 years 8 months ago

update...if I add a few

update...if I add a few delays it works, at least I can get the LDN

GXDLMSObjectCollection objects = new GXDLMSObjectCollection();

Thread.Sleep(2000);

GXDLMSSecureClient client = new GXDLMSSecureClient(listener.UseLogicalNameReferencing, listener.ClientAddress, listener.ServerAddress, (Authentication)listener.Authentication, listener.Password, (InterfaceType)listener.Interface);
client.Ciphering.Security = Security.None;

Thread.Sleep(2000);

reader = new GXDLMSReader(client, media, _logger, listener.TraceLevel, 60000, 3, 0);
GXDLMSData ldn = new GXDLMSData("0.0.42.0.0.255");
ldn.SetUIDataType(2, DataType.String);

Thread.Sleep(2000);

reader.InitializeConnection();
reader.Read(ldn, 2);
Console.WriteLine("Meter connected: " + ldn.Value);

I don't understand why, maybe some timeout issues?

Thanks

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

In reply to it looks like it is only by orondelli

Hi,

Hi,

Visual Studio uses appsettings.Development.json when you are debugging the application. Otherwise
appsettings.json is used.

BR,
Mikko

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

When you connect without delay meter seems to expect that you connect using the ciphered connection. I believe that this is the behavior specified by the manufacturer.

BR,
Mikko

orondelli

4 years 8 months ago

Hi Mikko,

Hi Mikko,

I have been told from the manufactured (Elster/Honeywell EI7) to wait for a "Compact Frame":

When are you sending AARQ request? Typically meter sends a Compact Frame (a notification packet) once connection is established with network and socket connection is successful. The server seeing the socket connection, must first receive the packet, process it and then send a downlink packet. Is it possible that you are sending a AARQ request immediately after socket connect and then processing the receiving notification packet after few milliseconds. You must first receive the packet, flush the packet and then send the AARQ.

Is there a way to do it using Gurux library?

I think this is what is happening: I am sending a AARQ request immediately after socket connect...

Many Thanks

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

This functionality is not defined in DLMS protocol and all the meters don't send it when the connection is established. I just realized that Elster is sending the notification as encrypted and that is breaking the current functionality. I believe that AMI can't decrypt the message and check that this is a notification message. I need to think about this.

BR,
Mikko

orondelli

4 years 8 months ago

Hi Mikko,

Hi Mikko,

adding a delay after the socket connection seem to work even do is not nice.

What do I need to do on the AMI database to be able to read Half Hourly Data from the meter? I have populated a few table: Task, Object, Device, DefualtTemplate, ecc.. to be able to reach the Read method.
What do I need to have on Attribute table?

For the "compact frame" issue I am thinking if you could help us (just so the Hire US advert). What do we need to do to hire you for some help?

Thanks

Profile picture for user Kurumi

Kurumi

4 years 8 months ago

Hi,

Hi,

Send an email to me. You can find my contact information from here:
https://www.gurux.fi/AboutUs

All data is read from the meter to the AMI database. You need to read the profile generic buffer and AMI will read new rows and add them to the database. If there aren't any new rows data is returned right away.

What kind of problem do you have with the compact frame?

BR,
Mikko

  • 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