Giter Site home page Giter Site logo

Comments (8)

oroulet avatar oroulet commented on August 22, 2024

thanks for all the bug reports. I will have a look a soon as I get 2 minutes

On Mon, 26 Oct 2015 at 09:24 jk987 [email protected] wrote:

I finally caught it (I noticed it in issue #47
#47 yesterday):

http://ulozto.net/xWGF411f/test-ua2-zip
password: ua1234

There is a log and pcapng. In log there is interesting time 2015-10-26
08:57:19.983. In pcapng there is interesting time 2063 with filter tcp.stream
eq 2.

I have another things to do today but it seems to me that RequestResponse
and OpenSecureChannel have switched SequenceNumber. And Kepware OPC server
seems not to like it. I haven't investigate it much yet, but lock is bit
different in BinaryClient.open_secure_channel() than in
BinaryClient._send_request().


Reply to this email directly or view it on GitHub
#48.

from python-opcua.

oroulet avatar oroulet commented on August 22, 2024

I tried to have a look at it but it looks there are several channels opened at the same time so it is hard to understand what is happening. Do you start several client at the same time?

from python-opcua.

jk987 avatar jk987 commented on August 22, 2024

Yes, usually in my app there are 4 clients at the same time. (Two devices "Channel1mc.EVA" and "Channel2mc.HC" and for each device two halves "WP1" and "WP2". In my log I often call it EVA1, EVA2, HC1, HC2.) Like I wrote, in Wireshark you should filter tcp.stream eq 2 (filter on toolbar or Menu ~ Analyze ~ Display Filters). It is the client reading tags with the name starting on "Channel2mc.HC.WP2..." (so "HC2").
It really wasn't easy to find. :)

from python-opcua.

jk987 avatar jk987 commented on August 22, 2024

Already 3 days I'm running my app with this modification:

    def open_secure_channel(self, params):
        self.logger.info("open_secure_channel")
        with self._lock:
            request = ua.OpenSecureChannelRequest()
            request.Parameters = params
            request.RequestHeader = self._create_request_header()

            hdr = ua.Header(ua.MessageType.SecureOpen, ua.ChunkType.Single, self._security_token.ChannelId)
            asymhdr = ua.AsymmetricAlgorithmHeader()
            seqhdr = self._create_sequence_header()

            future = Future()
            self._callbackmap[seqhdr.RequestId] = future
            self._write_socket(hdr, asymhdr, seqhdr, request)

        response = ua.OpenSecureChannelResponse.from_binary(future.result(self.timeout))
        response.ResponseHeader.ServiceResult.check()
        self._security_token = response.Parameters.SecurityToken
        return response.Parameters

and it seems to run OK for me.

But I did this modification intiutively accroding to BinaryClient._send_request() without any deeper understading the headers logic.

from python-opcua.

oroulet avatar oroulet commented on August 22, 2024

you are right. a lock is missing here and in close_secure_channel too. Can
you create a pull request? So you will get the immense privilege of having
your name as author :-)

On Thu, 29 Oct 2015 at 12:15 jk987 [email protected] wrote:

Already 3 days I'm running my app with this modification:

def open_secure_channel(self, params):
    self.logger.info("open_secure_channel")
    with self._lock:
        request = ua.OpenSecureChannelRequest()
        request.Parameters = params
        request.RequestHeader = self._create_request_header()

        hdr = ua.Header(ua.MessageType.SecureOpen, ua.ChunkType.Single, self._security_token.ChannelId)
        asymhdr = ua.AsymmetricAlgorithmHeader()
        seqhdr = self._create_sequence_header()

        future = Future()
        self._callbackmap[seqhdr.RequestId] = future
        self._write_socket(hdr, asymhdr, seqhdr, request)

    response = ua.OpenSecureChannelResponse.from_binary(future.result(self.timeout))
    response.ResponseHeader.ServiceResult.check()
    self._security_token = response.Parameters.SecurityToken
    return response.Parameters

and it seems to run OK for me.

But I did this modification intiutively accroding to
BinaryClient._send_request() without any deeper understading the headers
logic.


Reply to this email directly or view it on GitHub
#48 (comment)
.

from python-opcua.

jk987 avatar jk987 commented on August 22, 2024

Sorry, but I can't. I'm not very familiar with Git.
(I think that my little modifications don't entitle me to be named somewhere. You are doing the big job, not me. For me it is the most important that I can tell my customer that my app finally works.)

from python-opcua.

oroulet avatar oroulet commented on August 22, 2024

As you want but you should really learn git. It makes programming much
easier

On Thu, Oct 29, 2015, 18:34 jk987 [email protected] wrote:

Sorry, but I can't. I'm not very familiar with Git.
(I think that my little modifications don't entitle me to be named
somewhere. You are doing the big job, not me. For me it is the most
important that I can tell my customer that my app finally works.)


Reply to this email directly or view it on GitHub
#48 (comment)
.

from python-opcua.

oroulet avatar oroulet commented on August 22, 2024

fixed in c4425c2

from python-opcua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.