Azure / iot-edge-opc-proxy-api-csharp

OPC Proxy API
16 stars 7 forks source link

BadNotConnected error while running in linux #7

Closed matteo-bon closed 6 years ago

matteo-bon commented 6 years ago

I'm facing some problems while running the C# opcua client example.

Following the README:

The sample client in the UA.-NETStandard however works fine, connecting to sample sever.

I tried with another opcua server (with open62541 sdk), using my ip-address instead of localhost, but the problem is the same.

Here the commands: dotnet run --project NetCoreConsoleServer.csproj -a #for UA-.NETStandard server ./proxyd -c 'HostName=<..>;SharedAccessKeyName=<..>;SharedAccessKey=<..>' #for proxy dotnet run --framework netcoreapp2.0 #for opcua c# client

This is the error: client_cs

Maybe the problem could be in the proxy, which gives this warning: proxy

I'm not sure if this is the issue, maybe due to authentication problems the connection is refused.

I'm running Linux Mint 18 64 bit (kernel 4.4.0-34-generic). For C# client, I'm using branch '1.0.4-lts'; for proxy, I'm using 'master' and '1.0.2' branch.

Thanks

matteo-bon commented 6 years ago

I found the problem, I was setting iothub connection string as a parameter of proxy, but not as an environment variable (_HUB_CS). Starting proxy without arguments (after setting _HUB_CS with export in bashrc) works.