How can I use the WaveAnalyzer Analysis Server to take data?

The WaveAnalyzer Analysis Server is a server application that runs on the PC providing a RESTful style Webservice API.  The “ip_server” is the IP of the Analysis Server. The server allows you access to measurement data and analysis functions via HTTP GET commands from a web browser or automated test systems. Advanced functions include 3 Point OSNR, 6 Point OSNR, Wavelength Meter Measurements and WDM Analysis.

The analysis server can be started via the start menu:

Start -> Programs -> Finisar -> WaveAnalyzer Analysis Server

When the Analysis Server is running, the front panel looks like this:

The IP for the server is localhost:<Port> where <port> is the currently configured port. In this instance, the “ip_server” would be localhost:8002, or alternatively: 127.0.0.1:8002. Functions of the analysis server can be accessed from an external computer by using <external-pc’s-ip>:8002. That makes it possible to run the analysis server on a PC separate to the computer executing the code. Note that the server PC needs to belong to the same network as the WaveAnalyzer is connected to.

The HTTP command format for the WaveAnalyzer Analysis Server is as follows:

http://<server address>/analysis/<method>?<input parameters>

<server address> is the IP address of the WaveAnalyzer Analysis Server. <method> specifies which API method to perform. A question mark character (?) is used to separate the method and the input parameters. <input parameters> specify a list of input parameters dictating how each command will operate. Some of these parameters are required and some are optional. The input parameter list is specified in the following format: <parameter1>=<value1>&<parameter2>=<value2>&… Each parameter is separated by an ampersand (&) character.

The following example demonstrates a typical HTTP command for a WaveAnalyzer 1500S:

http://localhost:8002/analysis/data?ip=203.219.49.105&averages=32&rbw=3000

This HTTP command contains the following details:

  • The analysis server address is localhost, with port number 8002.
  • The API method is data.
  • The input parameters specify a device with an IP address of 203.219.49.105, 32 averages and a resolution bandwidth of 3000 MHz.
  • The output when read through a browser is as follows:

Complete details on using the WaveAnalyzer Analysis Server can be found in the WaveAnalyzer User Manual section 4.2.

Depending on the network connection and the measurement time, it’s possible that there is a lag between the time that the measurement request is sent and a response received. It’s best to ensure that the timeout settings or measurement request frequency will cover the delay time between request and response.

This is a typical time out error:

ReadTimeout: HTTPConnectionPool(host=’203.219.49.105′, port=8002): Read timed out. (read timeout=5)

For further information, see the article on high latency and time out issues and the article on increasing the speed to read data.