As I couldn't find this on the 40m elog/wiki I'm putting notes here on how to configure a fresh webserver + python server for the Zurich box (model HF2LI) that runs an autobooting service job.
The Zurich box (model HF2LI) has no front panel interface. All controls are done from a USB interface to a host computer (running windows or Ubuntu/Debian). This computer then hosts a web-server that runs an interface in a browser (through http) or responds to requests from python/matlab/labview/C API over the network.
Set up on a Linux box is fast and easy from a fresh install. A thin low powered computer is ideal. Start with a fresh install of Debian, use the latest stable release. Then download the latest stable release for the HF2LI, HF2IS, HF2PLL instruments from the Zurich downloads page. You’ll probably want the 64bit linux. You can untar this file with
> tar xzvf LabOneLinux<arch>-<release>-<revision>.tar.gz
tar xzvf LabOneLinux<arch>-<release>-<revision>.tar.gz
(Insert your filename details above)
Then cd into the directory it created and run
> sudo bash install.sh
It will ask a bunch of questions, just hit enter and y all the way through. The install should immediately boot the HF2 data server at the end. You can check the data server is running with
> ziService status
Now plug in your Zurich box using the USB cable. Note: there are ethernet ports on the box, but these are NOT for network ethernet. If the box is powered up the data server should find the box.
In another terminal you’ll want to to start a Webserver so you can view the box status, settings and live data. Go to another terminal and run
Your Zurich device should now be exposed on port 8006 of that machine. You are read to go.
Now on that computer you can got to http://localhost:8006, alternatively on any other computer on the network you can go to the host machine’s IP address and see your Zurich interface. I.e. if the computer IP is 192.168.1.121 then go to http://192.168.1.128:8006.
If you wanted to access the Zurich interface remotely (outside network) you can do some SSH forwarding if you have a gateway machine to outside the lab. The standard command for this is
> ssh -nNT -L <clientport>:localhost:<hostport> <controls>@<Host-IP-Address>
where controls is the username, Host-IP-Address is the IP address of the machine to be forwarded from, clientport is the port on your machine (the one you are ssh'ing from) and hostport is the port on the remote machine (for Zurich this is 8006). Then when you go to http://localhost:<clientport> and you'll see Zurich interface.
Since the release 2.18 (Nov 2018) the python access tools are now just in Pypi. You can install them with pip:
> pip install --upgrade zhinst
This should now allow you to use python API to access your Zurich box.
You’ll want to set up a service on your Debian box with systemd. Make a unit
> cd /etc/systemd/system
> sudo vim ziServer.service
You must use sudo to be able to save the file here.
Paste the following in, this assumes that your username and its group is called controls on your machine:
Description=Zurich Instruments HF2LI data server
ExecStart=/bin/bash -c "exec ziServer"
Tip: in vim you can type “:set paste” to get exact paste without auto indent etc.
Save the file and exit. You'll also need to create the working director, or change the above to your desired directory
> mkdir /home/controls/services/
Finally, tell systemd to look for new things:
> systemctl daemon-reload
and enable the service,
> systemctl enable ziServer.service
and manually start the service,
> systemctl start myservice.service
It should be running, try to see if this is so:
> ps | grep ziServer
It should run on reboot of the machine and restart every 30 seconds if it crashes for whatever reason. Try rebooting the host machine to check it is still running
Follow the above steps to also auto load the webserver with a unit file named /etc/systemd/system/ziWebServer.service:
Description=Zurich Instruments HF2LI web server
ExecStart=/bin/bash -c "exec ziWebServer"
Now you have a local network ready server for accessing the Zurich box through a web browser.