Communication with GXDLMSDirector setting works with this Properties:
1. Media: NET, Protocol:TCP, Interface: Wrapper, Use serial port through ethernet: Checked
2. Media: NET, Protocol:TCP, Interface: HDLC, Use serial port through ethernet: Checked
3. Media: NET, Protocol:TCP, Interface: HDLC, Use serial port through ethernet: Not Checked
Does not work:
4. Media: NET, Protocol:TCP, Interface: Wrapper, Use serial port through ethernet: Not Checked
How can I set communication parameters in java for first three cases? I am able to set only 4th case :-(
Peter.
WRAPPER is used with TCP/IP or UDP connections. It's not used with serial port connections.
If you are using TCP/IP to the serial port converter you need to end frames using HDLC framing.
Hello Mikko,
iskra.jar is just built gurux example.
Metter is Iskraemeco MT880
Everything is working with GXDLMSDirector (see attachment):-(
java -jar iskra.jar -h 31.134.96.1 -p 666 -a Low -P 12345678 -g 1.0.1.8.0.255:2 -s 18 -c 1
this is trace info I have got:
TX: 14:04:15.308 7E A0 07 25 03 93 6E C4 7E
TX: 14:05:15.312 7E A0 07 25 03 93 6E C4 7E
TX: 14:06:15.318 7E A0 07 25 03 93 6E C4 7E
TX: 14:07:15.322 7E A0 07 25 03 93 6E C4 7E
without response, but I see on converter that 4x 9bytes were received.
Please check it there is real meter connected.
Thanks
Peter.
...is the same...just trace info has changed of course to:
TX: 14:51:36.524 00 01 00 01 00 12 00 38 60 36 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 31 32 33 34 35 36 37 38 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 1D FF FF
But, if I check "Use serial port through ethernet" it works on GXDLMSDirector. Without it it does not work. This is exactly what I dont know set in Java.
Please try it maybe you will succeed and something wrong on my side.
Peter.
It seems to work correctly. Java app reads the association view. It's good to save it somewhere because reading it takes a long time.
Association view describes all the objects what meter can offer. In GXLMDSDirector you can see it on the left side after the meter.
If you know what you want to read you can do it like below. The Clock object is read from the meter.
GXDLMSClock clock = new GXDLMSClock("0.0.1.0.0.255");
read(clock, 2);
You can uncomment this and call it after you have established the connection.
BR,
Hello Mikko,
is there any possibility to omit Association readings?
If I comment that line an exception occurs.
Initialization ran OK with SNRM and AARQ request/response...
...
this.readObjects
.add(new GXSimpleEntry<String, Integer>("1.0.1.8.0.255", 2));
try {
////////////////////////////////////////
// Initialize connection settings.
////////////////////////////////////////
Media.open();
System.out.println("Number of request:"+this.readObjects.size());
if (this.readObjects.size() != 0) {
this.initializeConnection();
// this.getAssociationView();
for (Map.Entry<String, Integer> it : this.readObjects) {
System.out.println("Request:"+it.getKey()+">"+it.getValue());
Object val = this.read(dlms.getObjects().findByLN(ObjectType.NONE, it.getKey()),
it.getValue());
System.out.println("Hodnota:"+val);
// System.out.println("Hodnota1:"+this.showValue(it.getValue(), val));
}
}
} catch (Exception ex) {
System.out.println("Exceprion :-(");
System.out.println(ex.getMessage());
System.exit(1);
} finally {
this.close();
}
this is print of process;
Connection: 31.134.96.1:666
Authentication: Low
ClientAddress: 0x1
ServerAddress: 0x92
Number of request:1
Request:1.0.1.8.0.255>2
Exceprion :-(
null
You need to check what is object type for 1.0.1.8.0.255.
Remove starting from this:
this.readObjects.add(new GXSimpleEntry<String, Integer>("1.0.1.8.0.255", 2));
ANd add something like this:
Media.open();
this.initializeConnection();
GXRegister r1 = new GXRegister("1.0.1.8.0.255");
this.read(r1, 2);
close();
If OBIS code or object type is wrong meter returns error.
Thank you Mikko,
I got it independently...
dlms.getObjects().findByLN(ObjectType.NONE, it.getKey()) found nothing off course...
Now it works fine.
BTW where I can find list of GX objects. Now I know GCClock and GXRegister... In the future I will need maybe more...
Peter.
The list of registers depends on the meter and sometimes even meter version number.
Read your meter with GXDLMSDirector and you get a list from the objects that meter supports.
Class name is always GXDLMS*
...
one more isue.
how to push GXObject to a list to be able use dlms.getObjects().findByLN(ObjectType.NONE, attributeIndex); (dlms..GXDLMSClient dlms= new GXDLMSClient(true))
Hi,
Hi,
1. -h IP_ADDRESS, -p PORT_NUM -w
2,3. -h IP_ADDRESS, -p PORT_NUM
I don't know if you need to set the client address. Run java app without parameters and it shows the help for you.
BR,
Mikko
Hello Miko,
Hello Miko,
what is difference between case 1 and case 4 in settings communication parameters?
Peter
Hi,
Hi,
WRAPPER is used with TCP/IP or UDP connections. It's not used with serial port connections.
If you are using TCP/IP to the serial port converter you need to end frames using HDLC framing.
BR,
Mikko
Hello Mikko,
Hello Mikko,
iskra.jar is just built gurux example.
Metter is Iskraemeco MT880
Everything is working with GXDLMSDirector (see attachment):-(
java -jar iskra.jar -h 31.134.96.1 -p 666 -a Low -P 12345678 -g 1.0.1.8.0.255:2 -s 18 -c 1
this is trace info I have got:
TX: 14:04:15.308 7E A0 07 25 03 93 6E C4 7E
TX: 14:05:15.312 7E A0 07 25 03 93 6E C4 7E
TX: 14:06:15.318 7E A0 07 25 03 93 6E C4 7E
TX: 14:07:15.322 7E A0 07 25 03 93 6E C4 7E
without response, but I see on converter that 4x 9bytes were received.
Please check it there is real meter connected.
Thanks
Peter.
Hi,
Hi,
Try to add -w parameter. Iskra is using WRAPPER.
BR,
Mikko
...is the same...just trace
...is the same...just trace info has changed of course to:
TX: 14:51:36.524 00 01 00 01 00 12 00 38 60 36 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 31 32 33 34 35 36 37 38 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 1D FF FF
But, if I check "Use serial port through ethernet" it works on GXDLMSDirector. Without it it does not work. This is exactly what I dont know set in Java.
Please try it maybe you will succeed and something wrong on my side.
Peter.
Hi,
Hi,
I believe that you have Moxa, etc before the meter. Is this correct?
BR,
Mikko
Off, course. GXDLMSDirector
Off, course. GXDLMSDirector works fine...System works also with virtual COM (from ICube)...
Peter.
Hi Peter,
Hi Peter,
You can also connect directly with TCP/IP to some Iskraemeco models and then wrapper is used.
Can you post the first two lines from GXDLMSDirector trace? The client address is usually 0x64 and the physical server address is 0x11 for Iskraemeco.
BR,
Mikko
Hello Mikko,
Hello Mikko,
so after some work:
1a. request from GXDLMSDirector: 7E A0 08 02 25 03 93 E7 A2 7E
1b. java request: 7E A0 07 25 03 93 6E C4 7E
After changing Address size from defautl to 2 (and a manipulating with server addres) I also got 7E A0 08 02 25 03 93 E7 A2 7E with same response. That is important step...
But after that java starts to generate lot of requests, here are some of them from the begining...
TX: 21:07:41.388 7E A0 08 02 25 03 93 E7 A2 7E
RX: 21:07:41.463 7E A0 1F 03 02 25 73 13 25 81 80 12 05 01 9A 06 01 9A 07 04 00 00 00 01 08 04 00 00 00 01 CC A2 7E
TX: 21:07:41.477 7E A0 45 02 25 03 10 22 A9 E6 E6 00 60 36 A1 09 06 07 60 85 74 05 08 01 01 8A 02 07 80 8B 07 60 85 74 05 08 02 01 AC 0A 80 08 31 32 33 34 35 36 37 38 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 00 1E 1D FF FF DF FB 7E
RX: 21:07:41.642 7E A0 38 03 02 25 30 C1 05 E6 E7 00 61 29 A1 09 06 07 60 85 74 05 08 01 01 A2 03 02 01 00 A3 05 A1 03 02 01 00 BE 10 04 0E 08 00 06 5F 1F 04 00 00 1E 1D 05 00 00 07 5B BA 7E
TX: 21:07:41.658 7E A0 1A 02 25 03 32 AC B4 E6 E6 00 C0 01 C1 00 0F 00 00 28 00 00 FF 02 00 91 53 7E
RX: 21:07:41.917 7E A8 A4 03 02 25 52 A8 2D E6 E7 00 C4 02 C1 00 00 00 00 01 00 82 04 F4 01 82 05 E8 02 04 12 00 08 11 00 09 06 00 00 01 00 00 FF 02 02 01 09 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 02 03 0F 03 16 03 00 02 03 0F 04 16 01 00 02 03 0F 05 16 03 00 02 03 0F 06 16 03 00 02 03 0F 07 16 03 00 02 03 0F 08 16 03 00 02 03 0F 09 16 01 00 01 06 02 02 0F 01 16 01 02 02 0F 02 16 01 02 02 0F 03 16 01 02 02 0F 04 16 01 02 02 0F 05 16 01 02 02 0F 06 16 01 02 04 12 00 1B 11 01 09 06 00 00 02 00 00 FF 4F 1E 7E
TX: 21:07:41.922 7E A0 08 02 25 03 51 F9 47 7E
RX: 21:07:42.129 7E A8 A4 03 02 25 54 9E 48 02 02 01 04 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 01 00 02 04 12 00 1D 11 02 09 06 00 00 02 01 00 FF 02 02 01 06 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 02 03 0F 05 16 03 00 02 03 0F 06 16 03 00 01 01 02 02 0F 01 16 01 02 04 12 00 1C 11 02 09 06 00 00 02 02 00 FF 02 02 01 07 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 02 03 0F 05 11 0D 7E
TX: 21:07:42.132 7E A0 08 02 25 03 71 FB 66 7E
RX: 21:07:42.488 7E A8 A4 03 02 25 56 8C 6B 16 03 00 02 03 0F 06 16 03 00 02 03 0F 07 16 03 00 01 00 02 04 12 00 09 11 00 09 06 00 00 0A 00 00 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 00 02 04 12 00 09 11 00 09 06 00 00 0A 00 01 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 00 64 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 19 8F 7E
TX: 21:07:42.491 7E A0 08 02 25 03 91 F5 81 7E
RX: 21:07:42.737 7E A8 A4 03 02 25 58 F2 82 00 65 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 00 66 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 00 67 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 00 6B FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 8D 28 7E
TX: 21:07:42.740 7E A0 08 02 25 03 B1 F7 A0 7E
RX: 21:07:42.959 7E A8 A4 03 02 25 5A E0 A1 12 00 09 11 00 09 06 00 00 0A 00 6C FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 00 FD FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 00 02 04 12 00 09 11 00 09 06 00 00 0A 00 FE FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 01 00 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 37 75 7E
TX: 21:07:42.962 7E A0 08 02 25 03 D1 F1 C3 7E
RX: 21:07:43.329 7E A8 A4 03 02 25 5C D6 C4 01 01 02 02 0F 01 16 00 02 04 12 00 09 11 00 09 06 00 00 0A 01 FA FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 12 00 09 11 00 09 06 00 00 0A 01 FD FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 00 02 04 12 00 09 11 00 09 06 00 00 0A 03 65 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 00 02 04 12 00 09 11 00 09 06 00 00 0A 05 65 FF 02 02 01 02 02 03 0F 01 D5 9B 7E
TX: 21:07:43.333 7E A0 08 02 25 03 F1 F3 E2 7E
RX: 21:07:43.601 7E A8 A4 03 02 25 5E C4 E7 16 01 00 02 03 0F 02 16 01 00 01 01 02 02 0F 01 16 01 02 04 12 00 0B 11 00 09 06 00 00 0B 00 00 FF 02 02 01 02 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 01 01 02 02 0F 01 16 01 02 04 12 00 14 11 00 09 06 00 00 0D 00 00 FF 02 02 01 0A 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 02 03 0F 03 16 01 00 02 03 0F 04 16 01 00 02 03 0F 05 16 01 00 02 03 0F 06 16 03 00 02 03 0F 07 16 03 00 02 03 0F 08 16 03 00 02 03 0F 09 16 03 00 02 03 0F 0A 16 03 00 01 01 02 02 0F 01 3A CC 7E
TX: 21:07:43.602 7E A0 08 02 25 03 11 FD 05 7E
RX: 21:07:43.840 7E A8 A4 03 02 25 50 BA 0E 16 01 02 04 12 00 06 11 00 09 06 00 00 0E 00 01 FF 02 02 01 04 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 02 03 0F 03 16 03 00 02 03 0F 04 16 01 00 01 03 02 02 0F 01 16 01 02 02 0F 02 16 01 02 02 0F 03 16 01 02 04 12 00 06 11 00 09 06 00 00 0E 00 02 FF 02 02 01 04 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 02 03 0F 03 16 03 00 02 03 0F 04 16 01 00 01 03 02 02 0F 01 16 01 02 02 0F 02 16 01 02 02 0F 03 16 01 02 04 12 00 16 11 00 09 06 00 00 0F 00 00 FF 02 02 01 B9 86 7E
TX: 21:07:43.841 7E A0 08 02 25 03 31 FF 24 7E
RX: 21:07:44.171 7E A0 3D 03 02 25 52 81 63 04 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 01 00 02 04 12 00 16 11 00 09 06 00 00 0F 00 02 FF 02 02 01 04 02 B6 85 7E
TX: 21:07:44.175 7E A0 14 02 25 03 54 24 D3 E6 E6 00 C0 02 C1 00 00 00 01 51 BE 7E
RX: 21:07:44.454 7E A8 A4 03 02 25 74 9C 69 E6 E7 00 C4 02 C1 00 00 00 00 02 00 82 04 F4 03 0F 01 16 01 00 02 03 0F 02 16 01 00 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 01 00 02 04 12 00 15 11 00 09 06 00 00 10 01 00 FF 02 02 01 04 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 02 03 0F 03 16 01 00 02 03 0F 04 16 03 00 01 00 02 04 12 00 15 11 00 09 06 00 00 10 01 01 FF 02 02 01 04 02 03 0F 01 16 01 00 02 03 0F 02 16 01 00 02 03 0F 03 16 01 00 02 03 0F 04 16 03 00 01 00 02 04 12 00 13 11 01 09 06 00 00 14 52 AC 7E
TX: 21:07:44.457 7E A0 08 02 25 03 71 FB 66 7E
RX: 21:07:44.660 7E A8 A4 03 02 25 76 8E 4A 00 00 FF 02 02 01 09 02 03 0F 01 16 01 00 02 03 0F 02 16 03 00 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 02 03 0F 05 16 03 00 02 03 0F 06 16 03 00 02 03 0F 07 16 02 00 02 03 0F 08 16 02 00 02 03 0F 09 16 02 00 01 00 02 04 12 00 07 11 01 09 06 00 00 15 00 00 FF 02 02 01 08 02 03 0F 01 16 01 00 02 03 0F 02 16 01 01 02 0F 01 0F 02 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 02 03 0F 05 16 01 00 02 03 0F 06 16 01 00 02 03 0F 07 16 01 00 02 03 0F 08 16 01 00 01 02 0E 12 7E
TX: 21:07:44.663 7E A0 08 02 25 03 91 F5 81 7E
RX: 21:07:44.869 7E A8 A4 03 02 25 78 F0 A3 02 02 0F 01 16 01 02 02 0F 02 16 01 02 04 12 00 07 11 01 09 06 00 00 15 00 01 FF 02 02 01 08 02 03 0F 01 16 01 00 02 03 0F 02 16 01 01 02 0F 01 0F 02 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 02 03 0F 05 16 01 00 02 03 0F 06 16 01 00 02 03 0F 07 16 01 00 02 03 0F 08 16 01 00 01 02 02 02 0F 01 16 01 02 02 0F 02 16 01 02 04 12 00 07 11 01 09 06 00 00 15 00 02 FF 02 02 01 08 02 03 0F 01 16 01 00 02 03 0F 02 16 01 01 02 0F 01 0F 02 02 03 0F 03 16 03 00 02 03 0F 7D DE 7E
TX: 21:07:44.872 7E A0 08 02 25 03 B1 F7 A0 7E
RX: 21:07:45.077 7E A8 A4 03 02 25 7A E2 80 04 16 03 00 02 03 0F 05 16 01 00 02 03 0F 06 16 01 00 02 03 0F 07 16 01 00 02 03 0F 08 16 01 00 01 02 02 02 0F 01 16 01 02 02 0F 02 16 01 02 04 12 00 07 11 01 09 06 00 00 15 00 05 FF 02 02 01 08 02 03 0F 01 16 01 00 02 03 0F 02 16 01 01 02 0F 01 0F 02 02 03 0F 03 16 03 00 02 03 0F 04 16 03 00 02 03 0F 05 16 01 00 02 03 0F 06 16 01 00 02 03 0F 07 16 01 00 02 03 0F 08 16 01 00 01 02 02 02 0F 01 16 01 02 02 0F 02 16 01 02 04 12 00 17 11 01 09 06 00 00 16 00 00 FF 7D 7E
....
I have got 84kB of data from the meter. After that I have got also my own request with successful response.
I dont know source of that requests but immediately from initialing GXDLMSSecureClient client = new GXDLMSSecureClient(true) I have client.getObjectsRequest().length = 27 ???
Peter.
Hi,
Hi,
It seems to work correctly. Java app reads the association view. It's good to save it somewhere because reading it takes a long time.
Association view describes all the objects what meter can offer. In GXLMDSDirector you can see it on the left side after the meter.
If you know what you want to read you can do it like below. The Clock object is read from the meter.
GXDLMSClock clock = new GXDLMSClock("0.0.1.0.0.255");
read(clock, 2);
You can uncomment this and call it after you have established the connection.
BR,
Mikko
BR,
Mikko
Hello Mikko,
Hello Mikko,
is there any possibility to omit Association readings?
If I comment that line an exception occurs.
Initialization ran OK with SNRM and AARQ request/response...
...
this.readObjects
.add(new GXSimpleEntry<String, Integer>("1.0.1.8.0.255", 2));
try {
////////////////////////////////////////
// Initialize connection settings.
////////////////////////////////////////
Media.open();
System.out.println("Number of request:"+this.readObjects.size());
if (this.readObjects.size() != 0) {
this.initializeConnection();
// this.getAssociationView();
for (Map.Entry<String, Integer> it : this.readObjects) {
System.out.println("Request:"+it.getKey()+">"+it.getValue());
Object val = this.read(dlms.getObjects().findByLN(ObjectType.NONE, it.getKey()),
it.getValue());
System.out.println("Hodnota:"+val);
// System.out.println("Hodnota1:"+this.showValue(it.getValue(), val));
}
}
} catch (Exception ex) {
System.out.println("Exceprion :-(");
System.out.println(ex.getMessage());
System.exit(1);
} finally {
this.close();
}
this is print of process;
Connection: 31.134.96.1:666
Authentication: Low
ClientAddress: 0x1
ServerAddress: 0x92
Number of request:1
Request:1.0.1.8.0.255>2
Exceprion :-(
null
Peter.
Hi,
Hi,
You need to check what is object type for 1.0.1.8.0.255.
Remove starting from this:
this.readObjects.add(new GXSimpleEntry<String, Integer>("1.0.1.8.0.255", 2));
ANd add something like this:
Media.open();
this.initializeConnection();
GXRegister r1 = new GXRegister("1.0.1.8.0.255");
this.read(r1, 2);
close();
If OBIS code or object type is wrong meter returns error.
Thank you Mikko,
Thank you Mikko,
I got it independently...
dlms.getObjects().findByLN(ObjectType.NONE, it.getKey()) found nothing off course...
Now it works fine.
BTW where I can find list of GX objects. Now I know GCClock and GXRegister... In the future I will need maybe more...
Peter.
Hi,
Hi,
The list of registers depends on the meter and sometimes even meter version number.
Read your meter with GXDLMSDirector and you get a list from the objects that meter supports.
Class name is always GXDLMS*
BR,
Mikko
...
...
one more isue.
how to push GXObject to a list to be able use dlms.getObjects().findByLN(ObjectType.NONE, attributeIndex); (dlms..GXDLMSClient dlms= new GXDLMSClient(true))