Hi,
Thanks for all your support till now!
Now, I am prototyping the Metcom meter connectivity. We have Building Management System which exposes an IP and port which is connected to the series of Metcom meters in daisy chain using RS485.
I am using GURUX java client example (somewhat modified for us) to connect to this Metcom meter. Adding the sample code.
****************************************
GXDLMSSecureClient2 dlmsClient = null;
GXDLMSReader reader = null;
String meterType = "Metcom";
String ipAddress = "100.100.100.100"; // -h dummy IP
String portNumber = "61001"; // -p
String clientAddress = "1"; // -c
String serverAddress = "10181272"; // -s
String authenticationLevel = "LOW"; // -a
String password = "XXXXXXXX"; // -P
// Boolean shortName = true; // -r
Boolean useLogicalName = true; // -r - Metcom uses Logical name but LG uses short name
InterfaceType communicationInterfaceType = InterfaceType.WRAPPER; // -i Metcom uses WRAPPER but LG uses HDLC
// Create connection
GXNet connectionMedia = new GXNet();
connectionMedia.setHostName(ipAddress);
connectionMedia.setPort(Integer.parseInt(portNumber));
// Create Client
dlmsClient = new GXDLMSSecureClient2(true);
dlmsClient.setUseLogicalNameReferencing(useLogicalName);
dlmsClient.setInterfaceType(communicationInterfaceType);
dlmsClient.setAuthentication(Authentication.valueOfString(authenticationLevel));
dlmsClient.setClientAddress(Integer.parseInt(clientAddress));
dlmsClient.setServerAddress(Integer.parseInt(serverAddress));
if ( dlmsClient.getServerAddress() != 1 ) {
dlmsClient.setServerAddress(GXDLMSClient.getServerAddress(Integer.parseInt(serverAddress))); // setting 2272
}
dlmsClient.setPassword(password);
// Initialize reader
reader = new GXDLMSReader(dlmsClient, connectionMedia, TraceLevel.INFO, null);
// Open connection
connectionMedia.open();
reader.initializeConnection();
// Read association view
reader.getAssociationView();
***************************************************************
I couldn't connect to the meter and getting Invalid connection error Adding the trace file.
Exception in thread "main" java.lang.RuntimeException: Invalid connection.
at com.bt.ggdcenergy.metering.dlms.net.GXNet.send(GXNet.java:414)
at com.bt.ggdcenergy.metering.dlms.test.GXDLMSReader.readDLMSPacket(GXDLMSReader.java:264)
at com.bt.ggdcenergy.metering.dlms.test.GXDLMSReader.readDataBlock(GXDLMSReader.java:352)
at com.bt.ggdcenergy.metering.dlms.test.GXDLMSReader.readDataBlock(GXDLMSReader.java:337)
at com.bt.ggdcenergy.metering.dlms.test.GXDLMSReader.initializeConnection(GXDLMSReader.java:595)
TX: 08:40:28.703 00 01 00 01 08 E0 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 46 45 44 43 30 30 30 33 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 42 1E 5D FF FF
TX: 08:41:28.712 00 01 00 01 08 E0 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 46 45 44 43 30 30 30 33 BE 10 04 0E 01 00 00 00 06 5F 1F 04 00 42 1E 5D FF FF
Could you please help me out to put the proper configuration and connect the meter.
Hi, If you are using RS-485…
Hi,
If you are using RS-485 you must use HDLC and not WRAPPER framing. It's easier if you connect with GXDLMSDirector and configure the correct settings.
BR,
Mikko