node-opcua / opcua-commander

a opcua client with blessed (ncurses)
MIT License
211 stars 46 forks source link

opcua-commander closes immediately after connecting #13

Closed jdion-tft closed 5 years ago

jdion-tft commented 6 years ago

I am able to connect to the opcua server with commander, but immediately after connecting the program disconnects from the server, and closes the output in the terminal window. No error message is given.

I'm running the latest node-opcua and opcua-commander code.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/57003651-opcua-commander-closes-immediately-after-connecting?utm_campaign=plugin&utm_content=tracker%2F32277473&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F32277473&utm_medium=issues&utm_source=github).
roykn commented 6 years ago

Try to set the option endpoint_must_exist in index.js:84 to false, like:

const options = {
    securityMode: securityMode,
    securityPolicy: securityPolicy,
    //xx serverCertificate: serverCertificate,
    defaultSecureTokenLifetime: 40000,
    certificateFile: certificateFile,
    privateKeyFile: privateKeyFile,
    endpoint_must_exist: false
};

This works for me.

ckarras commented 6 years ago

endpoint_must_exist doesn't work for me. How can I get an error message for more investigation?

sachinmorabada commented 6 years ago

Am also facing same problem opcua-commander closes immediately after connecting. Even after updating endpoint_must_exist: false.

qlevZer commented 6 years ago

I have the same probleme...

alexshn commented 6 years ago

@qlevZer Try to remove this line. It forces commander to close immediatelly and you are not able to see the message.

sanderd17 commented 5 years ago

I also had this, and it's related to certificates.

I when I connected to the device using UA-Expert, it asked to install a certificate. After connecting, I saw the PLC was used with this endpoint: opc.tcp://Grading:4840

Later, when connecting to the PLC using opcua-commander, I could connect via opc.tcp://Grading:4840, but not via opc.tcp://GRADING:4840 (although hostnames are case insensitive in windows, and I can ping both), and going via the ip address opc.tcp://172.16.13.120:4840 also didn't work.

I'm not sure how UA-Expert detects a lacking certification, and even generates one.

Btw, removing that line did help to see the message.

image image

erossignon commented 5 years ago