[
https://issues.apache.org/jira/browse/PLC4X-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16990190#comment-16990190
]
Alvaro del Castillo edited comment on PLC4X-157 at 12/6/19 10:24 PM:
---------------------------------------------------------------------
{code:java}
// code placeholder
{code}
Ok, I will try now the fix. As the OPC-UA server I will launch in a docker
image.
{code:java}
[docker]$ docker run -p 4843:4843 mcr.microsoft.com/iotedge/opc-plc -ut --pn
4843
{code}
This server will be inside a docker and it will use the docker image networking
config. If you try to discover the endpoints, it will provide internal IP
address that can not be accessed outside the docker image. So it is the ideal
scenario for testing the "discover=false" feature.
Without the fix when the endpoints are discovered:
{code:java}
com.thingso2.agent.plugins.commons.ProtocolException: Error while creation of
the connection because of : java.net.UnknownHostException: 69a73c9297c3: Name
or service not known{code}
It is using the hostname *69a73c9297c3* because this is the name defined in the
docker container:
{code:java}
[docker]$ docker exec -it compassionate_spence sh
/appdata # hostname
69a73c9297c3
{code}
And with the fix ... it is failing because of:
[https://github.com/apache/plc4x/blob/PLC4X-157OPC-UADisablediscovery/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/OpcuaPlcDriver.java#L73]
It seems it should work according to the regexp, but with the URL:
opcua:tcp://127.0.0.1:4843?nDiscovery=true
it is failing.
was (Author: acs):
{code:java}
// code placeholder
{code}
Ok, I will try now the fix. As the OPC-UA server I will launch in a docker
image.
{code:java}
[docker]$ docker run -p 4843:4843 mcr.microsoft.com/iotedge/opc-plc -ut --pn
4843
{code}
This server will be inside a docker and it will use the docker image networking
config. If you try to discover the endpoints, it will provide internal IP
address that can not be accessed outside the docker image. So it is the ideal
scenario for testing the "discover=false" feature.
Without the fix when the endpoints are discovered:
{code:java}
com.thingso2.agent.plugins.commons.ProtocolException: Error while creation of
the connection because of : java.net.UnknownHostException: 69a73c9297c3: Name
or service not known{code}
It is using the hostname *69a73c9297c3* because this is the name defined in the
docker container:
{code:java}
[docker]$ docker exec -it compassionate_spence sh
/appdata # hostname
69a73c9297c3
{code}
And with the fix ... it is failing because of:
[https://github.com/apache/plc4x/blob/PLC4X-157OPC-UADisablediscovery/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/OpcuaPlcDriver.java#L73]
The URL format checker must be adopted to support queryString.
> OPC-UA: Disable by config endpoint discovery
> --------------------------------------------
>
> Key: PLC4X-157
> URL: https://issues.apache.org/jira/browse/PLC4X-157
> Project: Apache PLC4X
> Issue Type: Improvement
> Components: Driver-OPC-UA
> Reporter: Alvaro del Castillo
> Priority: Major
> Labels: device, network
>
> Some real world devices like the [https://iqunet.com/server-and-data/]
> includes as the OPC-UA server the FreeOPCUA server running inside a docker.
> When you discover the endpoints, the IPs advertised are the internal ones in
> the docker container, so you can not access these endpoint from the network.
> It is an issue in the device, but for those cases, just using directly the
> public IP in which the OPC-UA server is listening as the endpoint is the only
> solution.
> For PLC4x to work in those cases, a config option must be available to
> disable the endpoint discovering and just connect to the endpoint build with
> the public IP.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)