Connection problem decpite verfied login credentials: 'Cannot connect to #738
-
Hello everybody, Until now I used Matlab to connect to our PI server via a VPN. In Matlab i can connect to the server without issues using the code:
Also using the PI SDK I can establish the connection and see the IP address etc. But now i have to use Python for a project and sadly when I try to conncect using similar code in Python it doesn't connect. Here is my code:
Only by importing the module i get already the following warning: I'm not sure if this is the cause, because even though I get the warning, the following line still executes successfully: However, the actual connection fails and gives the following error message
I have seen a similar error in a another discussion here in this forum: #622 Since it works in Matlab and PI SDK I susspect the problem lies somwhere else. But I am unable to locate the root cause. I dont know if the SocketException raised when importing the module is responsible or if it something else. In the PI.py file its this piece of code that in the end throws the error but I can not find where the .connection method is to further investigate the problem by myself:
I would be very happy if someone who had the same problem or knows what is going on could help me:) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You mention Windows authentication, so I guess you try to connect with a Windows account, is that right? By default a username/password combination is interpreted as a PI user. For Windows authentication you need to set the authentication mode: import PIconnect as PI
from PIconnect.PIConsts import AuthenticationMode
with PI.PIServer(username=..., password=..., authentication_mode=AuthenticationMode.WINDOWS_AUTHENTICATION) as server:
... Does it work for you using that option? |
Beta Was this translation helpful? Give feedback.
You mention Windows authentication, so I guess you try to connect with a Windows account, is that right? By default a username/password combination is interpreted as a PI user. For Windows authentication you need to set the authentication mode:
Does it work for you using that option?