Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpcUa: renew secure channel
Forum Updated to NodeBB v4.3 + New Features

QOpcUa: renew secure channel

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 378 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    Using the QOpcUaViewer example I notice that after few minutes a line in the message window appears:

    Info: "Connection 25 | SecureChannel 2246060434 | SecureChannel renewed" (:0, )

    and the connection stays alive for long time.
    Instead in my application after few minutes the connection closes and I have to connect again.

    Of course I tried to follow that example but I must forgot something important! Even inspecting again the code I don't find where it handle the renewing of the secure channel.

    Please, can you help me to understand how this is done?

    UPDATE
    I enabled the messages from open62541 and I noticed that when the disconnection happens I get these errors:

    [20231003 10:37:23 I] unknown:0 - "Received a ServiceFault response"
    [20231003 10:37:23 I] unknown:0 - "The ServiceResult has the StatusCode BadTimeout"
    [20231003 10:37:23 W] unknown:0 - "Received Timeout for Publish Response"
    [20231003 10:37:23 I] unknown:0 - "The ServiceResult has the StatusCode BadNoSubscription"
    [20231003 10:37:38 I] unknown:0 - "Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: Good"

    Why it receive these errors instead of renewing the channel? What am I missing?

    M 1 Reply Last reply
    0
    • M Mark81

      Using the QOpcUaViewer example I notice that after few minutes a line in the message window appears:

      Info: "Connection 25 | SecureChannel 2246060434 | SecureChannel renewed" (:0, )

      and the connection stays alive for long time.
      Instead in my application after few minutes the connection closes and I have to connect again.

      Of course I tried to follow that example but I must forgot something important! Even inspecting again the code I don't find where it handle the renewing of the secure channel.

      Please, can you help me to understand how this is done?

      UPDATE
      I enabled the messages from open62541 and I noticed that when the disconnection happens I get these errors:

      [20231003 10:37:23 I] unknown:0 - "Received a ServiceFault response"
      [20231003 10:37:23 I] unknown:0 - "The ServiceResult has the StatusCode BadTimeout"
      [20231003 10:37:23 W] unknown:0 - "Received Timeout for Publish Response"
      [20231003 10:37:23 I] unknown:0 - "The ServiceResult has the StatusCode BadNoSubscription"
      [20231003 10:37:38 I] unknown:0 - "Client Status: ChannelState: Closed, SessionState: Closed, ConnectStatus: Good"

      Why it receive these errors instead of renewing the channel? What am I missing?

      M Offline
      M Offline
      Mark81
      wrote on last edited by
      #2

      Well, it seems that if I have NO subscriptions enabled it renew the channel and the connection is kept open.

      Otherwise, if I have any monitoring enabled I get the errors above and the connection will be closed after few minutes.

      Still I don't understand why.

      C 1 Reply Last reply
      0
      • M Mark81

        Well, it seems that if I have NO subscriptions enabled it renew the channel and the connection is kept open.

        Otherwise, if I have any monitoring enabled I get the errors above and the connection will be closed after few minutes.

        Still I don't understand why.

        C Offline
        C Offline
        Chs_QtLearner
        wrote on last edited by
        #3

        @Mark81 , disconneciton, it means "network broken" ?

        M 1 Reply Last reply
        0
        • C Chs_QtLearner

          @Mark81 , disconneciton, it means "network broken" ?

          M Offline
          M Offline
          Mark81
          wrote on last edited by
          #4

          @Chs_QtLearner no, even if the network is up and stable, the server closes the channel.

          C 1 Reply Last reply
          0
          • M Mark81

            @Chs_QtLearner no, even if the network is up and stable, the server closes the channel.

            C Offline
            C Offline
            Chs_QtLearner
            wrote on last edited by Chs_QtLearner
            #5

            @Mark81 , I haven't no ability to solve it , but I want to know more, because I also work in this way. My concern is " Connect many machine controllers (PLC.. ) with QOpcUa, to collect data from machine in cycling , if one machine is disconnected (switch off or restart ...), then restart again , Do OpcUaClient could receive one signal from this machine, then could trigger one procedure to create one new instance to connect it again.

            If not possible , I prefer to change to proposal "kepware collection".

            Thanks for your information !

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved