AnsweredAssumed Answered

PI Web API - 502 response and unconnected pi points

Question asked by vinzenzeck on Aug 23, 2017
Latest reply on Aug 30, 2017 by vinzenzeck

Hei,

 

I am writing a data access tool to retrieve time series from the PI server for data analysis.

Since, the data analysis is done with python, I decieded to use the PI Web API with the to communicate with the server.

 

However the Pi Webapi seem to be broken from time to time.

For example to retrieve an element by path I use the following url call:

 

https://my_server.com/piwebapi/elements?path=%5Cmypath%5Cto%5Celement

 

This returns an empty response if I don't do the following requests first:

 

1. my_server.com/webapi

2. https://my_server.com/piwebapi/assetservers

3. search for the database in links of response and use the link for the last request: https://my_server.com/piwebapi/assetservers/JKASDKJBSD/assetdatabases

 

some times this monkey patching works, sometimes it does not, resulting in an 502 gateway response for the 3. request.

However when I then copy the request of 3. into the windows IE, I get a response. And the servers are set up.

Then the python calls work as well.

 

Furthermore, If I retreived the element and use this url for the attributes

 

https://my_server.com/piwebapi/elements/LFNksE/attributes

 

The attributes sometimes have a link to the PI Point and sometimes not. Which is crucial to receive any information.

Here copy pasting the link into IE does not help fixing this problem

 

What is going wrong?

Outcomes