UA Web sockets architecture|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
UA Web sockets architecture
Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
1
04/07/2021 - 17:26
sp_Permalink sp_Print sp_EditHistory

I like to confirm the architecture involving opcua and web sockets implementation:

At the edge side:
Opcua server#1-> web socket server#1 installed with libwebsockets library

At the cloud side:
Opcua server#2 -> web socket server #2 installed with libwebsockets library

web socket server#1 <-> web socket server#2 persistent connection over internet

please advise if my understanding above is correct.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
04/07/2021 - 18:22
sp_Permalink sp_Print

One of your servers needs to be acting like a client.

Servers dont talk to Servers.

Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
3
04/07/2021 - 20:41
sp_Permalink sp_Print sp_EditHistory

Oh maybe I amend the architecture as follows:

———

At the edge side:

Opcua server#1 and web socket proxy#1 installed with libwebsockets library :: listener 

At the cloud side:
Opcua client#2 and web socket proxy #2 installed with libwebsockets library :: connecting to edge

once opcua client#2 completed the handshake with opcua server#1 via proxy#2 and proxy#1, a persistent connection will be established as follows:

Opcua server#1 <- web socket proxy#1 <- web socket proxy#2 <- opcua client#2

::persistent connection over internet A<-B ie B initiates connection request,

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
04/08/2021 - 13:36
sp_Permalink sp_Print

That seems reasonable.

What software are you using to connect web socket proxy#1 and web socket proxy#2?

Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
5
04/09/2021 - 00:10
sp_Permalink sp_Print

I just tried libwebsockets library to build a proxy server, and tested with a generic web socket client successfully.

My plan is as follows:

1. extend to opcua server by fronting it with a web socket proxy server

2. Use the same web socket client to access opcua server via the proxy server

once this is successful, I will extend to 2 instances of proxy server to simulate WAN connection.

 

i am not using any cots https server eg ibm, Apache for now

Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
6
04/16/2021 - 04:40
sp_Permalink sp_Print

Hi Randy,

I forget to inform that I am using open62541.org open source version of OPCUA and warmcat libwebsockets library.

I can instantiate a websocket port listening on 7681 and am able to test it out using a simple off-the-shelf Websocket client.

Now, i want to check with you on the concepts of OPCUA-websockets. I read that once the websockets on the OPCServer is up and running, any websocket client connecting to it will just need to send 1 http request to OPCServer to get the value of a node variable (a monitored item).

If there are any subsequent changes (say every 9 seconds the node gets updated with a new value), the websocket client will get the latest value 'without' sending any new http request anymore.  In essence, can i take it that websockets connection is persistent and the data from the OPCServer flows continuously (streaming) to the clients connecting to it and is subscribing to the said variable node?

Currently, i have implemented addDataSetWriter() and can publish dataSetFields to a mqtt broker.  At the same time, i want to also avail the same data to clients connecting via websockets.

In order to achieve this behavior at the server end, do i just write the data packet to socket 7681?

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
7
04/16/2021 - 05:30
sp_Permalink sp_Print

Are you using UA PubSub or your own custom streaming protocol?

Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
8
04/16/2021 - 06:40
sp_Permalink sp_Print

I am already using UA PubSub.. via MQTT broker.

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
9
04/17/2021 - 18:19
sp_Permalink sp_Print

I meant the data streaming over the websockets.

Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
10
04/23/2021 - 06:44
sp_Permalink sp_Print

I am using UA PubSub based on open62541 API.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 25
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855