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. Meter Simulator DisconnectControl: Access Error : Device Reports Read-Write Denied

Meter Simulator DisconnectControl: Access Error : Device reports Read-Write denied

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 imand , 15 November, 2022
Forums
Gurux DLMS for Java

Hi Mikko and Team,

We have trying to use the meter simulator in place of real meter. We generated the template from CLOU single phase meter. We're able to connect to the meter using HIGH_GMAC with AES_GCM_128. We have so far been able to update the clock.

Now want to test the disconnect control but we're getting read-write denied error. This is the simulator logic that triggers this error:

if (settings.getAssignedAssociation() != null) {
p.accessMode = MethodAccessMode3
.toInteger(settings.getAssignedAssociation().getMethodAccess3(obj, id));
}
e = new ValueEventArgs(server, obj, id, 0, parameters);
e.setInvokeId(invokeId);
if (server.notifyGetMethodAccess(e) == 0) {
error = ErrorCode.READ_WRITE_DENIED;
}
These are the packets.
PreRead 0.0.96.3.10.255:2
TX: 00 01 00 01 00 10 00 06 C4 01 C1 00 03 00
RX: 00 01 00 10 00 01 00 0F C3 01 C1 00 46 00 00 60 03 0A FF 02 01 0F 00
TX: 00 01 00 01 00 10 00 04 C7 01 C1 03

We suspect the method access rights are not correctly being set in the template. Here is the disconnect control XML section:

<GXDLMSDisconnectControl>
<LN>0.0.96.3.10.255</LN>
<Description>Ch. 0 Disconnect control</Description>
<Access>3300</Access>
<MethodAccess>11</MethodAccess>
<OutputState>0</OutputState>
<ControlState>1</ControlState>
<ControlMode>1</ControlMode>
</GXDLMSDisconnectControl>

We have been playing the access bits as we don't what they are represent.

Thanks in advance as always

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi,

Hi,

The disconnect control returns an error. The reason is that disconnect action is not implemented for the GXDLMSDisconnect object. There is nothing that the object can do and you need to handle this in PreAction.

https://github.com/Gurux/Gurux.DLMS.Net/blob/2d542fd95146b10829a6ad9b78…

BR,
Mikko

imand

3 years 6 months ago

Hi Mikko,

Hi Mikko,

Thanks for the response.
Do you mean we need to add the disconnection action in the PreAction method like the other examples shown?
Also we have to do the same thing for other objects, correct?

Do you please have any reference explaining on how to set the values of these elements in the template?

<Access>3300</Access>
<MethodAccess>11</MethodAccess>

Thanks,
Imand

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi Imand,

Hi Imand,

Add this for the preaction.

if (it.Target is GXDLMSDisconnect && it.Index == 1)
{
Console.WriteLine("Disconnect called");
it.Handled = true;
}

The server will return ACK for the disconnect action.

Access rights are set when a new object is added to the association view and those values can't be changed after that. What do you want to do with them?

BR,
Mikko

imand

3 years 6 months ago

Hi Mikko,

Hi Mikko,

Do you mean add that logic to PreRead? PreAction is not being triggered for the disconnection control.

Regarding access rights, we want the set the correct access rights (read/write etc) for each object in the template. But we don't know what are the access rights for given object.

Thanks, again.
Imand

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi,

Hi,

If you are calling the disconnect or reconnect is't using invoke and not read. Try this with GXDLMSDirector.

Access right values are:
Read = 1
Write = 2
ReadWrite = 3

There is one number for each attribute that describes the access rights.

BR,
Mikko

imand

3 years 6 months ago

Hi Mikko,

Hi Mikko,

I think the read-write error is caused by method access rights not being correct. Here is the code in ServerBase that triggers the error:

public final int notifyGetMethodAccess(final ValueEventArgs arg) throws Exception {
if (owner instanceof GXDLMSServer) {
GXAttributeCollection attributes = arg.getTarget().getMethodAttributes();
GXDLMSAttributeSettings att = attributes.find(arg.getIndex());
/// If attribute is not set return read only.
if (att == null) {
return MethodAccessMode.NO_ACCESS.getValue();
}
return att.getMethodAccess().getValue();
} else if (owner instanceof GXDLMSServer3) {
if (getSettings().getAssignedAssociation().getVersion() < 3) {
return ((GXDLMSServer3) owner).onGetMethodAccess(arg).getValue();
} else {
return MethodAccessMode3.toInteger(((GXDLMSServer3) owner).onGetMethodAccess3(arg));
}
}
return ((GXDLMSServer2) owner).onGetMethodAccess(arg).getValue();
}

This "if" is returning the error:

if (getSettings().getAssignedAssociation().getVersion() < 3) {
return ((GXDLMSServer3) owner).onGetMethodAccess(arg).getValue();
}

This is what we have in the template file. We tried different values without success:

<MethodAccess>11</MethodAccess>

Any idea?

Thanks,
Imand

imand

3 years 6 months ago

Hi Mikko,

Hi Mikko,

We're able to workaround this issue by updating the association method access for the disconnect control in onGetMethodAccess in the server.
But we think the method access rights should be set in the template file. No?

Also we had to set outputState in the onPreAction. Otherwise it's not being updated.

Thanks,
Imand

Profile picture for user Kurumi

Kurumi

3 years 6 months ago

Hi Imand,

Hi Imand,

Access rights are read from the connected association. If you check the association view, you can see that there the logical name and associations are under it. The reason for this is that there might be multiple associations and with some associations, you can read and with other read and write object attributes.

BR,
Mikko

imand

3 years 6 months ago

Ok. Got it. Thanks, Imand

Ok. Got it.

Thanks,
Imand

  • 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