coussej / node-opcua-logger

An OPCUA Client for logging data to InfluxDB! 🔌 🏭
https://www.factry.io
MIT License
179 stars 63 forks source link

Error: The connection has rejected by server #50

Closed nexun closed 4 years ago

nexun commented 4 years ago

Hi, I am having a problem running the npm start command. It connects seamlessly to the database but when it wants to connect to the OPC UA it throws an error. I have configured the simulator and I am accessing through the url that provides me. How should I do to configure the certificate correctly?

the opc ua server url is generated by the prosys opc ua server simulador

config.toml

[opcua]
url= "opc.tcp://c******:53530/OPCUA/SimulationServer"

[influx]
url              = "http://myuser:12345@192.168.1.10:8086/OPC_DB"
writeInterval    = 1000          # optional. defaults to 1000ms
writeMaxPoints   = 1000          # optional. defaults to 1000 points

[[metrics]]
measurement        = "polled1"
datatype           = "number"
tags               = { simulation = "true", location = "ghent" }
nodeId             = "ns=5;s=Sinusoid1"
method             = "polled"
interval           = 1000     

[[metrics]]
measurement        = "monitored2"
datatype           = "boolean"
tags               = { simulation = "true", location = "ghent" }
nodeId             = "ns=3;s=BooleanDataItem"
method             = "monitored"
interval           = 5000  

PS C:\Users\user\Desktop\node-opcua-logger-master> npm run start

> influx-opcua-logger@2.0.0-alpha start C:\Users\user\Desktop\node-opcua-logger-master
> node ./src/index.js

[2020-06-09T15:02:58.987] [INFO] main - Starting Influx OPCUA Logger v2.0.0-alpha, brought to you by FACTRY (www.factry.
io)
[2020-06-09T15:02:58.989] [INFO] main - Initialising influxClient
[2020-06-09T15:02:59.009] [INFO] influx - 192.168.1.10:8086 responded in 16ms running 1.8.0
[2020-06-09T15:02:59.010] [INFO] main - Initialising buffer
[2020-06-09T15:02:59.012] [INFO] main - Connecting OPCUA
[2020-06-09T15:02:59.051] [FATAL] main - Error: The connection has been rejected by server,
Please check that client certificate is trusted by server.
Err = (Internal Error)
    at Object.start (C:\Users\user\Desktop\node-opcua-logger-master\src\opcua.js:60:11)
[2020-06-09T15:02:59.053] [INFO] buffer - Persisting membuffer.

Thanks

nexun commented 4 years ago

Fix the error by installing version 2

JanRadtke commented 2 years ago

Which version 2?