Hello Mikko Sir,
I'm getting an exception from the Gurux Library code when I'm reading the Billing Profile of the meter:-
showError: Invalid Block number. It is 3 and it should be 1. (Ask Gemini)
java.lang.IllegalArgumentException: Invalid Block number. It is 3 and it should be 1.
at gurux.dlms.GXDLMS.handleGetResponseNextDataBlock(GXDLMS.java:3979)
at gurux.dlms.GXDLMS.handleGetResponse(GXDLMS.java:4072)
at gurux.dlms.GXDLMS.getPdu(GXDLMS.java:4228)
at gurux.dlms.GXDLMS.handleGloDedResponse(GXDLMS.java:4574)
at gurux.dlms.GXDLMS.getPdu(GXDLMS.java:4306)
at gurux.dlms.GXDLMS.getData(GXDLMS.java:4769)
at gurux.dlms.GXDLMSClient.getData(GXDLMSClient.java:2791)
at gurux.dlms.GXDLMSClient.getData(GXDLMSClient.java:2723)
at gurux.dlms.android.connection.DeviceConnection.readDLMSPacket(DeviceConnection.java:659)
at gurux.dlms.android.connection.DeviceConnection.readDataBlock(DeviceConnection.java:352)
at gurux.dlms.android.connection.DeviceConnection.readDataBlock(DeviceConnection.java:337)
at gurux.dlms.android.connection.DeviceConnection.readRowsByIndex(DeviceConnection.java:319)
at gurux.dlms.android.fragments.ProfileReadsFragment.readProfile(ProfileReadsFragment.java:431)
at gurux.dlms.android.fragments.ProfileReadsFragment.lambda$onCreateView$3$gurux-dlms-android-fragments-ProfileReadsFragment(ProfileReadsFragment.java:249)
at gurux.dlms.android.fragments.ProfileReadsFragment$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:222)
at android.os.Looper.loop(Looper.java:314)
at android.app.ActivityThread.main(ActivityThread.java:8680)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:565)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
My code for reading all entries is as follows :-
long entriesInUse = gxConnection.getEntries(it, 7);
long entries = gxConnection.getEntries(it, 8);
iterateTableValues(gxConnection.readRowsByIndex(pg, 0, (int) entries));
public long getEntries(GXDLMSObject it, int attrIndex) throws Exception {
long num = -1;
if (dlmsClient.canRead(it, attrIndex))
num = ((Number) read(it, attrIndex)).longValue();
return num;
}
Also, the meter has total entries for Billing Profile : 13/13.
So, why I'm facing this error?
Please guide.
Thanks,
Kshitiz
Hi, There is an issue with…
Hi,
There is an issue with your meter. DLMS standard defines the block number as starting from one. Ask if there is a firmware update available for the meter that fixes this issue.
BR,
Mikko
Okay Sir, There's might be…
Okay Sir,
There might be an issue with the meter configuration.
Please let me know if I've to modify my code.
Thanks,
Kshitiz
Hi Kshitiz, The meter…
Hi Kshitiz,
The meter returns an invalid reply and there is nothing that you can do to it.
If you add the meter reply as a hex, I'll check if it can be handled on the client size.
BR,
Mikko
Hello Mikki Sir, I've…
Hello Mikki Sir,
I've checked reading the Billing Profile data through the windows director app, and it reads the data without any errors.
For adding the meter reply as a hex, how can I convert the response into hex values?
Thanks,
Kshitiz
Hi Kshitiz, There is a…
Hi Kshitiz,
There is a special fix in GXDLMSDirector that one customer requested so they was able to read existing meters before this was fixed to the meter firmware.
Ask the meter manufacturer if there is a firmware update that fixes this issue.
BR,
Mikko