Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error writing ByteString array (readChunk EOF) #695

Open
jackchenjc opened this issue Oct 27, 2023 · 0 comments
Open

Error writing ByteString array (readChunk EOF) #695

jackchenjc opened this issue Oct 27, 2023 · 0 comments

Comments

@jackchenjc
Copy link
Contributor

Hi all,

I was trying to write a ByteString array value.
Tweaked the examples/write demo and tested with ProSys simulation server:

diff --git a/examples/write/write.go b/examples/write/write.go
--- a/examples/write/write.go
+++ b/examples/write/write.go
@@ -18,7 +18,7 @@
        var (
                endpoint = flag.String("endpoint", "opc.tcp://localhost:4840", "OPC UA Endpoint URL")
                nodeID   = flag.String("node", "", "NodeID to read")
-               value    = flag.String("value", "", "value")
        )
        flag.BoolVar(&debug.Enable, "debug", false, "enable debug logging")
        flag.Parse()
@@ -40,7 +40,7 @@
                log.Fatalf("invalid node id: %v", err)
        }
 
-       v, err := ua.NewVariant(*value)
+       v, err := ua.NewVariant([][]byte{{'1', '2', '3'}, {'4', '5', '6'}})
        if err != nil {
                log.Fatalf("invalid value: %v", err)
        }

Screenshot 2023-10-27 at 1 48 14 PM

I then got the readChunk EOF error and the connection was disconnected and reconnecting again.
Below are parts of the debug logs:

debug: uasc 2/6: send *ua.ReadRequest with 146 bytes
debug: uacp 2: recv MSGF with 64 bytes
debug: uasc 2/6: recv MSGF with 64 bytes
debug: uasc 2/6: recv *ua.ReadResponse
debug: uasc 2/6: sending *ua.ReadResponse to handler
debug: uasc 2/7: send *ua.ReadRequest with 131 bytes
debug: uacp 2: recv MSGF with 492 bytes
debug: uasc 2/7: recv MSGF with 492 bytes
debug: uasc 2/7: recv *ua.ReadResponse
debug: uasc 2/7: sending *ua.ReadResponse to handler
debug: uasc 2/8: send *ua.WriteRequest with 134 bytes
debug: uacp 2: recv ERRF with 81 bytes
debug: uasc 2: readChunk EOF
debug: client: monitor: disconnected
debug: client: monitor: auto-reconnecting
debug: client: monitor: action: createSecureChannel
debug: uacp 2: close
debug: sub: pause: pause
debug: uasc 2: Close()
debug: client: monitor: trying to recreate secure channel

Any help would be appreciated.

@jackchenjc jackchenjc changed the title Error writing ByteString array. (readChunk EOF) Error writing ByteString array (readChunk EOF) Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant