Archiving EPICS data


In the past few posts I’ve explained how to set up a Control System architecture involving an EPICS IOC running on a Raspberry Pi reading/writing data to from an Arduino to control a very simple system (an LED & a photoresistor).  There are various functions that a control system is typically expected to perform, and one of these is to maintain an ongoing archive of data.

EPICS has many ways to do this, but here I introduce one of the easiest.  We will run an application that will serve a website on the local network, and this website will allow the user to turn archiving on/off for any available PV’s.  In addition, the user will be able to look back through archived data; plotting PV’s over various time-scales.

I set up a second Rasbperry Pi and put it on the network in order to act as the server.  This means that a crash of the archiving engine will not lead to a crash of the IOC running on the first Raspberry Pi

Firstly go here and download the archiving application.  Then download a recent version of Apache’s Tomcat 7 from here.

Now follow the instructions here.

It’s important to remember that those instructions don’t lead to a “proper” installation of the archiver, and a considerable amount of setup would be necessary to get it ready for a production environment.  In particular, this setup isn’t robust against failure of the server in that a subsequent restart of the website will start in a completely fresh state.  That is, with no PV’s marked for archival.  The old data will not be lost, but the user will need to switch on archival for all the appropriate PV’s.  The frozen state of the data can be seen in the image at the top of this post.

Note that one of the most awkward parts of this installation is to ensure that the right version of java is running on the Raspberry Pi.  This took quite a bit of trial and error, but it should be possible to do by using apt-get to grab the appropriate package (oracle-java8-jdk), and then remove the initial version of Java.  You might also need to check the soft-links in /etc/alternatives to make sure that apt updated the links appropriately.

Leave a comment