Commit 95ae2e1b authored by Ivan Tyagov's avatar Ivan Tyagov

WIP

parent 89886652
......@@ -12,10 +12,11 @@ import requests
import urllib
import argparse
import logging
import __main__
# #################################
# Configure
# XXX: addn erp5_username and erp5_password!
parser = argparse.ArgumentParser(description='Run OPCUA Server.')
a = parser.add_argument
a('--ip', help='The IP address on which the OPCUA Server runs', default="127.0.0.1")
......@@ -64,6 +65,7 @@ if erp5_ip is not None and erp5_port is not None:
# Start OPCUA Server
async def main():
_logger = logging.getLogger(__name__)
# setup our server
server = asyncua.Server()
await server.init()
......@@ -87,14 +89,13 @@ async def main():
server.iserver.create_session = create_session
_logger.info("Added subscription for erp5 handler.")
_logger.info("Starting server!")
async with server:
while True:
await asyncio.sleep(1)
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.INFO)
asyncio.run(main(), debug=True)
import __main__
if __name__ == '__main__':
sys.exit(__main__.main())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment