client setup issue #821
Unanswered
Yuvaneshwarran
asked this question in
Q&A
Replies: 2 comments
-
|
Did you figure this one out? The default node name is set to be the empty string when the command line is configured in the client. So if you do not use the -node argument the client will not be able to find anything. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Yea i figured it out |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I first ran "go run ./server_test/" in terminal 1 produced
and then in terminal 2 i ran "go run ./read/"
CODE:
// ./server_test/server.go
package main
import (
"context"
"crypto/rsa"
"crypto/tls"
"flag"
"log"
"os"
"time"
)
var (
// ... (your flags remain the same)
endpoint = flag.String("endpoint", "0.0.0.0", "OPC UA Endpoint URL")
port = flag.Int("port", 4840, "OPC UA Endpoint port")
certfile = flag.String("cert", "cert.pem", "Path to certificate file")
keyfile = flag.String("key", "key.pem", "Path to PEM Private Key file")
gencert = flag.Bool("gen-cert", true, "Generate a new certificate")
)
func main() {
// ... (all the setup code for flags, security, endpoints, and certs remains the same)
flag.BoolVar(&debug.Enable, "debug", false, "enable debug logging")
flag.Parse()
log.SetFlags(0)
}
// Copyright 2018-2020 opcua authors. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
// ./read/read.go
package main
import (
"context"
"errors"
"flag"
"io"
"log"
"time"
)
func main() {
var (
endpoint = flag.String("endpoint", "opc.tcp://localhost:4840", "OPC UA Endpoint URL")
nodeID = flag.String("node", "", "NodeID to read")
)
flag.BoolVar(&debug.Enable, "debug", false, "enable debug logging")
flag.Parse()
log.SetFlags(0)
}
Help me how to solve this error
Beta Was this translation helpful? Give feedback.
All reactions