Closed Sanu153 closed 4 years ago
Hello Sanu153,
You should set the system up in a different way.
The default setup for us is to obtain an IP address for a meter by asking a telecom provider (KPN) for the IP address (via an API called JasperWireless). You are not going to be able to use this without credentials and SIM cards from KPN.
Try to configure the system using a static IP address:
If you set ip_address_is_static
to true in table dlms_device
of database osgp_adapter_protocol_dlms
, the system will use the IP address as configured in network_address
in table device
of database osgp_core
.
As you can see, this error has nothing to do with OSGP's SOAP web service or the certificates
Thank you for your swift response and action.
Through I had configure the system using a static IP address as you had instructed to set ip_address_is_static
to true in table dlms_device
of database osgp_adapter_protocol_dlms
and assigned an static IP that is 127.0.0.1
in network_address
in table device of database osgp_core
.
Now I encounter the following exception while performing any operation.
ERROR o.o.a.p.d.i.m.DeviceRequestMessageProcessor@processMessage:116 - Unexpected exception during GET_ASSOCIATION_LN_OBJECTS org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ConnectionException: java.net.ConnectException: Connection refused (Connection refused)
Kindly help me to resolve the issue. The screenshot and the generated logs are attached below.
2019-09-24 14:13:26.636] [sanu-pc] [ajp-nio-8009-exec-34] INFO o.o.a.w.e.WebServiceMonitorInterceptor@printSoapMessage:338 - soap message: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.opensmartgridplatform.org/schemas/common/2014/10" xmlns:ns1="http://www.opensmartgridplatform.org/schemas/smartmetering/sm-adhoc/2014/10">
<soapenv:Header>
<ns:ApplicationName>AutomaticTest</ns:ApplicationName>
<ns:UserName>SoapUI</ns:UserName>
<ns:OrganisationIdentification>sanu-test1</ns:OrganisationIdentification>
</soapenv:Header>
<soapenv:Body>
<ns1:GetAssociationLnObjectsRequest>
<!--type: DeviceIdentification-->
<ns1:DeviceIdentification>TEST1024000000ST1</ns1:DeviceIdentification>
</ns1:GetAssociationLnObjectsRequest>
</soapenv:Body>
</soapenv:Envelope>
2019-09-24 14:13:26.701] [sanu-pc] [ajp-nio-8009-exec-34] INFO o.o.d.core.services.SecurityService@checkAuthorization:106 - Organisation sanu-test1 is allowed GET_ASSOCIATION_LN_OBJECTS for device TEST1024000000ST1
2019-09-24 14:13:26.702] [sanu-pc] [ajp-nio-8009-exec-34] INFO o.o.a.w.s.i.j.SmartMeteringRequestMessageSender@sendMessage:77 - Sending message to the smart metering requests queue
2019-09-24 14:13:26.808] [sanu-pc] [ActiveMQ Task-1] INFO o.a.a.t.failover.FailoverTransport@doReconnect:1052 - Successfully connected to ssl://localhost:61617
2019-09-24 14:13:26.840] [sanu-pc] [domainSmartMeteringIncomingWebServiceRequestMessageListenerContainer-2] INFO o.o.a.d.s.i.j.w.WebServiceRequestMessageListener@onMessage:41 - Received message of type: GET_ASSOCIATION_LN_OBJECTS
2019-09-24 14:13:26.841] [sanu-pc] [domainSmartMeteringIncomingWebServiceRequestMessageListenerContainer-2] INFO o.o.a.d.s.i.j.BaseRequestMessageProcessor@processMessage:95 - Calling application service function: GET_ASSOCIATION_LN_OBJECTS
2019-09-24 14:13:26.870] [sanu-pc] [ajp-nio-8009-exec-34] INFO o.o.a.w.e.WebServiceMonitorInterceptor@printSoapMessage:338 - soap message: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns3:GetAssociationLnObjectsAsyncResponse xmlns:ns2="http://www.opensmartgridplatform.org/schemas/common/2014/10" xmlns:ns3="http://www.opensmartgridplatform.org/schemas/smartmetering/sm-adhoc/2014/10" xmlns:ns4="http://www.opensmartgridplatform.org/schemas/smartmetering/sm-configuration/2014/10"><ns2:DeviceIdentification>TEST1024000000ST1</ns2:DeviceIdentification><ns2:CorrelationUid>sanu-test1|||TEST1024000000ST1|||20190924141326702|||957889fb-60f3-42aa-b603-253a355f5d25</ns2:CorrelationUid></ns3:GetAssociationLnObjectsAsyncResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
2019-09-24 14:13:26.951] [sanu-pc] [DefaultMessageListenerContainer-1] INFO o.o.c.i.j.d.DomainRequestMessageListener@onMessage:49 - Received domain request message of type: GET_ASSOCIATION_LN_OBJECTS for domain: SMART_METERING and domainVersion: 1.0
2019-09-24 14:13:26.963] [sanu-pc] [DefaultMessageListenerContainer-1] INFO o.o.c.a.s.DeviceRequestMessageService@processMessage:64 - Device is using protocol [DSMR] with version [4.2.2]
2019-09-24 14:13:26.993] [sanu-pc] [DefaultMessageListenerContainer-1] INFO o.o.d.core.services.SecurityService@checkAuthorization:106 - Organisation sanu-test1 is allowed GET_ASSOCIATION_LN_OBJECTS for device TEST1024000000ST1
2019-09-24 14:13:26.994] [sanu-pc] [DefaultMessageListenerContainer-1] INFO o.o.c.i.j.p.ProtocolRequestMessageSender@send:56 - Sending protocol request message for device [TEST1024000000ST1] using protocol [DSMR] with version [4.2.2]
2019-09-24 14:13:26.994] [sanu-pc] [DefaultMessageListenerContainer-1] INFO o.o.c.i.j.p.ProtocolRequestMessageSender@send:61 - Message sender destination queue: [protocol-dlms.1_0.osgp-core.1_0.requests] for protocol [DSMR] with version [4.2.2]
2019-09-24 14:13:26.994] [sanu-pc] [DefaultMessageListenerContainer-1] INFO o.o.c.i.j.p.ProtocolRequestMessageSender@sendMessage:70 - Sending request message to protocol requests queue
2019-09-24 14:13:26.997] [sanu-pc] [dlmsRequestsMessageListenerContainer-2] INFO o.o.a.p.d.i.m.DeviceRequestMessageListener@onMessage:36 - Received message of type: GET_ASSOCIATION_LN_OBJECTS
2019-09-24 14:13:27.007] [sanu-pc] [dlmsRequestsMessageListenerContainer-2] INFO o.o.a.p.d.i.m.DeviceRequestMessageProcessor@processMessage:97 - GET_ASSOCIATION_LN_OBJECTS called for device: TEST1024000000ST1 for organisation: sanu-test1
2019-09-24 14:13:27.009] [sanu-pc] [dlmsRequestsMessageListenerContainer-2] INFO o.o.a.p.d.a.s.SecurityKeyService@getDlmsPassword:283 - Retrieving DLMS LLS Password for device TEST1024000000ST1
2019-09-24 14:13:27.012] [sanu-pc] [dlmsRequestsMessageListenerContainer-2] WARN o.o.a.p.d.a.s.SecurityKeyService@getKey:298 - No valid PASSWORD key found with device TEST1024000000ST1 - returning null.
2019-09-24 14:13:27.014] [sanu-pc] [dlmsRequestsMessageListenerContainer-2] ERROR o.o.a.p.d.i.m.DeviceRequestMessageProcessor@processMessage:116 - Unexpected exception during GET_ASSOCIATION_LN_OBJECTS
org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ConnectionException: java.net.ConnectException: Connection refused (Connection refused)
at org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.Lls1Connector.connect(Lls1Connector.java:60)
at org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionManager.connect(DlmsConnectionManager.java:118)
at org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionFactory.newConnectionWithSecurityLevel(DlmsConnectionFactory.java:99)
at org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionFactory.getConnection(DlmsConnectionFactory.java:67)
at org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionHelper.createConnectionForDevice(DlmsConnectionHelper.java:49)
at org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DlmsConnectionMessageProcessor.createConnectionForDevice(DlmsConnectionMessageProcessor.java:59)
at org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DeviceRequestMessageProcessor.processMessage(DeviceRequestMessageProcessor.java:102)
at org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DeviceRequestMessageListener.onMessage(DeviceRequestMessageListener.java:42)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:744)
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:682)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:649)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1168)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1160)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1057)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:244)
at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:277)
at org.openmuc.jdlms.transportlayer.client.TcpLayer.open(TcpLayer.java:76)
at org.openmuc.jdlms.sessionlayer.client.WrapperLayer.startListening(WrapperLayer.java:66)
at org.openmuc.jdlms.BaseDlmsConnection.connect(BaseDlmsConnection.java:179)
at org.openmuc.jdlms.DlmsLnConnectionWrapper.connect(DlmsLnConnectionWrapper.java:35)
at org.openmuc.jdlms.ConnectionBuilder.build(ConnectionBuilder.java:365)
at org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.SecureDlmsConnector.createConnection(SecureDlmsConnector.java:86)
at org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.Lls1Connector.connect(Lls1Connector.java:53)
... 16 common frames omitted
2019-09-24 14:13:27.015] [sanu-pc] [dlmsRequestsMessageListenerContainer-2] INFO o.o.a.p.d.i.m.RetryHeaderFactory@createRetryHeader:40 - Creating retry header for retryCount: 0, maximumRetries: 2, scheduledRetryTime: Tue Sep 24 14:13:57 UTC 2019.
Well, it seems you are now opening a connection to your meter. The meter refuses the connection.
I'm not able to tell you what to do next. This depends on:
security_key
of table security_key
of the osgp_adapter_protocol_dlms
databaseUpdate: I missed the part where you are using 127.0.0.1
as the IP address. What are you connecting to at localhost
?
Sir, I am trying to make a demo-smart-metering app. Is it possible to make an application like web-demo-app(i;e public-lighting) without using the real meter in my demo-smart-metering app for testing purpose. On later stage after succesfully configuring the demo-smart-metering app i will try it with real smart meter for further activity. Would you do me a favor for the above scenario?
I think it is possible to create a demo application for smart meter OSGP functionality. We don't have a smart meter simulator application available as an open-source component.
A solution could be to use the OpenMUC project.
We are using the DLMS client library in the osgp-protocol-adapter-dlms
component.
The DLMS server library could be used to simulate a smart meter:
https://www.openmuc.org/dlms-cosem/ https://www.openmuc.org/dlms-cosem/user-guide/#_server
Sir, Thanks for the support. I am studing the OpenMUC Project as suggested, but for quick implementation can you please provide step by step procedure to implement the smart-meterng application.
I'm not sure how to help you with a step by step procedure.
The web-demo-app
has been built using Spring MVC, JSP, and JQuery.
That is a pretty old way of building a web application and there are lots of examples on the internet.
The way communication with OSGP works can be derived from the classes in the package org.opensmartgridplatform.webdemoapp.infra.platform
and the application configuration of the web-demo-app
.
Thank you for your support and time.
I'm closing this issue and will be raising another in case I encounter any.
Thank you.
Hi,
I am currently building smart-metering application using SoapUI. I have already added the certificate file(test-org.pfx) into the project. Now I encounter only one type of exception while performing any operation. PKIX path building failed exception is thrown while performing any of the operations defined in all WSDL Files. But I could perform the AddDeviceRequest & AddDeviceAsyncRequest operation present in the SmartMeteringInstallation.wsdl
Kindly help me to resolve the issue. The screenshot and the generated logs are attached below..