-
Notifications
You must be signed in to change notification settings - Fork 40
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
Open PI Connection without context manager #656
Comments
Could you please explain why you don't want to use the contextmanager (== |
I dont know if I can do this in another way, but I'm constantly reading tags, and the opening and closing of the connection puts a small overhead that I have to get rid of. I wanted to create a singleton with the reference, but did not manage to get it to work using the context with. Im new at Python and OOP, so maybe i'm doing something wrong. |
Maybe you are right that it would be nice to provide the possibility to connect/disconnect manually. For now, you could do the following: import PIconnect as PI
server = PI.PIServer('SERVER_IP', 'USERNAME', 'PASSWORD')
server.connection.Connect(*server._credentials) # <- This only works if you actually provide credentials on the line above
points = server.search()
server.connection.Disconnect() |
Feature request
I am trying to open a connection to the PI Server without using "with open" like the examples provided.
Works fine
Code below does not work:
Error:
I've tried using "authenticate=AuthenticationMode.PI_USER_AUTHENTICATION" but got the same error.
Is there a way that this can be done?
The text was updated successfully, but these errors were encountered: