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

Test #1

Open
wants to merge 86 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
b7ac926
conversion from OPCUA <-> OPC DA server
FrictionalUnemployment Dec 28, 2020
f619ffc
Added the UA server
FrictionalUnemployment Dec 29, 2020
662c74b
Changes to readability of the OPCDA to OPCUA conversion, it is now wo…
FrictionalUnemployment Jan 2, 2021
76f8d92
Initial code for server discovery.
ackee Jan 10, 2021
e086513
Add files via upload
yazdii Jan 10, 2021
f4eb9f8
Update opcclient.py
yazdii Jan 10, 2021
e1db9b2
Changed GUI file structure.
ackee Jan 10, 2021
2e9ff9f
Made discovery as class only file, imported into uaxplorer.
ackee Jan 10, 2021
ce1f5e4
Fixed typo.
ackee Jan 10, 2021
564e3d3
To grab the discovery server and methods for grabbing all the details…
FrictionalUnemployment Jan 19, 2021
34f2a8d
Add files via upload
yazdii Jan 20, 2021
352c2d8
Fixed service registration on server, now client finds the server.
ackee Jan 20, 2021
b646f2f
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
ackee Jan 20, 2021
97ddd30
Made a navigating class with functions to dynamically grab all nodes …
FrictionalUnemployment Jan 21, 2021
b92e188
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
FrictionalUnemployment Jan 21, 2021
b830cc0
Changed port info to be a string, and added some usage documentation …
ackee Jan 21, 2021
6d057f7
Added some documentation and default values to the start_service_anno…
ackee Jan 21, 2021
410a492
Added some more documentation and fixed the name of the device in the…
ackee Jan 21, 2021
908f04d
Moved discovery to ui_methods also fixed server_discovery to work wit…
FrictionalUnemployment Jan 21, 2021
2ff8177
This is the Main Ui
yazdii Jan 25, 2021
4a55ca5
Added discovery utility function to get a server as address:port combo.
ackee Jan 25, 2021
0e6f2e8
Same as last commit, added utility for discovery.
ackee Jan 25, 2021
7ea593a
Fixed not using local method combine.
ackee Jan 25, 2021
7f0018f
UI Client for connecting to the opc servers
yazdii Jan 27, 2021
88b63f9
Fixed using the wrong port in announce_service.
ackee Jan 27, 2021
2c7b245
Fixed so we make a copy of the keys list to iterate over while gettin…
ackee Jan 27, 2021
431d0b0
Updated server discovery to run the function for 5 seconds instead of…
FrictionalUnemployment Jan 27, 2021
2944530
Fixed connecting to client dynamically.
FrictionalUnemployment Jan 28, 2021
b20c4bc
Changed name of client.py to localclient.py to match the class name.
ackee Jan 29, 2021
10fa652
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
ackee Jan 29, 2021
d9277c4
Some changes to py.server moved and MainUI is still being fixed.
FrictionalUnemployment Feb 3, 2021
e310052
Added in UI mapping
FrictionalUnemployment Feb 5, 2021
18dd1fa
Created a "right hand tree" for a 2nd access
yazdii Feb 5, 2021
60bfafa
Revert "Created a "right hand tree" for a 2nd access"
FrictionalUnemployment Feb 5, 2021
f362309
Added Artins treeView from rollback
FrictionalUnemployment Feb 6, 2021
609adc3
New class for handling QStandardItems (Rows, columns) cleaner code in…
FrictionalUnemployment Feb 7, 2021
7c7326f
Pushed changes for handling multiple objects for displaying & mapping
FrictionalUnemployment Feb 7, 2021
c53772e
Added first draft of sever class for a Rapsberry PI device.
ackee Feb 14, 2021
50dd17e
Added service announcement to PI server file.
ackee Feb 14, 2021
edcbcbc
Added a first gitignore file.
ackee Feb 14, 2021
c4d42e3
Optimized the UI, Updated it creating new options
yazdii Feb 17, 2021
adc1296
Changes to the Linking which is now recursive (In testing), mapping h…
FrictionalUnemployment Feb 21, 2021
be8021e
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
FrictionalUnemployment Feb 21, 2021
67876af
More changes to linking (now recursive) mapping fixed and more optimi…
FrictionalUnemployment Feb 21, 2021
d6ccd48
Big bug changes, thread optimizing of MainUI and mapping is even more…
FrictionalUnemployment Feb 24, 2021
d623ce6
Added main function to LocalClient and removed raspua/server path in …
ackee Feb 24, 2021
f68e9f6
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
ackee Feb 24, 2021
7e3f542
Added pycache in ui_methods to gitignore.
ackee Feb 24, 2021
ef77dd1
Fixed initial method code.
ackee Feb 24, 2021
4ccbcaf
Added some more subscribe code and changed variable name of qxtempera…
ackee Feb 24, 2021
24dcdb3
Fixed some minor bugs and typos.
ackee Feb 24, 2021
e9072d8
Fixed folder structure.
ackee Feb 24, 2021
65f510b
Manual Connection fixed
yazdii Feb 24, 2021
475e422
Revert "Manual Connection fixed"
FrictionalUnemployment Feb 24, 2021
e643f5e
Updated Manual Connection
yazdii Feb 24, 2021
1a0f1ef
Fixed manually added connections in the treeview. If children had the…
FrictionalUnemployment Feb 25, 2021
943b7fb
Find node names and node id in navigating_nodes now possible (Prepari…
FrictionalUnemployment Feb 25, 2021
8765f85
Added method to methods object.
ackee Feb 26, 2021
d139cf4
Linking has now been added.
FrictionalUnemployment Feb 26, 2021
a62f72a
A try to test the PI server.
ackee Mar 2, 2021
e36dae5
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
ackee Mar 2, 2021
16d6a13
Changed to use Node as input for subscribe method.
ackee Mar 2, 2021
1c19993
Changed to string usage for server nodes in subscribe method.
ackee Mar 2, 2021
309ab9f
Fixed being able to call a remote method, added some test files and r…
ackee Mar 3, 2021
22f0635
Now able to connect to remote client from server.
ackee Mar 3, 2021
1c5c29d
Subscription to data variable working.
ackee Mar 3, 2021
2b3f354
Some clean up of duplicate code and added methods to main class.
ackee Mar 3, 2021
2a01fa2
Fixed some small typos.
ackee Mar 3, 2021
68e983f
Swapped variable names of serverpi and serverpi2 fo the the qx/ixTemp…
ackee Mar 3, 2021
96911bb
Linking and pairing has been added now.
FrictionalUnemployment Mar 3, 2021
26e958b
Added some shit to gitignore
ackee Mar 3, 2021
ab8f345
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
ackee Mar 3, 2021
dbecc1b
Made serverpi2 updated to the latest and also fixed the test client.
ackee Mar 3, 2021
60491cf
Added text
FrictionalUnemployment Mar 3, 2021
f64bc5e
Server bugs have been fixed, navigating_node clean up MainUI clean up.
FrictionalUnemployment Mar 5, 2021
ea15c54
Fixed subscription handler to be more general and can handle multiple…
ackee Mar 5, 2021
e676a51
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
ackee Mar 5, 2021
0f62d04
Created Subscription button
yazdii Mar 12, 2021
5f0b897
Added Subscription handler to main User Interface, nodes can now be v…
FrictionalUnemployment Mar 13, 2021
a5b39cb
Added comments removed files.
FrictionalUnemployment Mar 18, 2021
7dde28b
More bug fixes
FrictionalUnemployment Mar 18, 2021
1a541b9
More general version of server.
ackee Mar 19, 2021
703c7d8
Merge branch 'test' of https://github.com/FrictionalUnemployment/OPCU…
ackee Mar 19, 2021
5c3c7ed
Fixed so local server updates variable value.
ackee Mar 19, 2021
a6ef893
Made all variables writable.
ackee Mar 19, 2021
3d8c9db
Lowered the time it checks for update.
ackee Mar 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added the UA server
  • Loading branch information
FrictionalUnemployment committed Dec 29, 2020
commit f619ffc8a7df191c260a0a63a8b4443f6953aaf3
23 changes: 21 additions & 2 deletions server/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
import logging, sys, asyncio, OpenOPC, decimal
import sys, asyncio, OpenOPC, decimal

from asyncua import ua, Server, uamethod

@@ -22,7 +22,6 @@ class SubHandler(object):
"""
Subscription handler to receive events from the server.
"""


def datachange_notification(self, node, val, data):
p_a_string = node.get_path_as_string() #Get a list containing root, objects, opc da server
@@ -106,5 +105,25 @@ async def main():
nodes_list = da.list('*', recursive=True) #A list of dot-delimited strings
await sort_nodes_list(nodes_list, idx, root, da)

try:
async with server: #Starting the server
handler = SubHandler() #Subscribing to datachanges coming from the UA clients
sub = await server.create_subscription(500, handler)
handle = await sub.subscribe_data_change(writeable_variables.values())
readable_vars = list(writeable_variables) #readable_variables
#print(writeable_variables)
while True:
await asyncio.sleep(1)
for i in da.list(readable_vars):
da_id = i[0]
var_handler = readable_variables[da_id]
var_handler.set_value(read_value(i[1:]))


finally:
await server.stop()
da.close()


if __name__ == "__main__":
asyncio.run(main())