OmniDriver, Java and the whims of companies

Open source alternative drivers

R packages
data acquisition

Pedro J. Aphalo






Ocean Optics, spectrometer, rOmniDriver pkg, ooacquire pkg

Acquiring spectra from Ocean Optics/Ocean Insight spectrometers

Current status

Java ended under Oracle’s ownership in 2010 through the acquisition of Sun Microsystems by Oracle. Sun’s formerly free licence for Java was later tightened into a commercial one that requires payment of fees on an uncertain basis as Oracle frequently changes the licencing terms. Furthermore, the licence depends on the version and frre updates on the versions’ vintage. To say the least, this is a very messy situation.

Ocean Optics OmniDriver driver, written in Java has been available for close to 20 years, with minimal updates in the last 10 years. It is based on Java 8, and recent versions are bundled with Java. However, to access OmniDriver from R, one needs to install the Java 8 JDK (or the Java 8 OpenJDK). Oracle’s updates to Java 8 JDK require a paid support agreement and without updates it is very vulnerable to malicious attacks. The OpenJDK is free and receives updates, and does work with package ‘rJava’. It is available packaged in alternative distributions under other names. Java is both the name of the language and the name of a product. As a product, Java is used by Oracle. Other distributions of the OpenJDK have different names, making finding them slightly difficcult. When I tried to access OmniDriver with the OpenJDK some time ago, I did not succeed to make it work from R using package ‘rJava’. I tested this a couple of days ago, and at least the Temurin 8 OpenJDK 64 bit version works well under recent versions of R.

OmniDriver is a commercial SDK with a cost of nearly 400 € but with a free runtime. Years back, Ocean Optics, agreed to me using it in my ‘ooacquire’ package. The person with whom I discussed this, has left the company several years ago. Under its new name of Ocean Insight the company seems to be slowly phasing out OmniDriver and replacing it with OceanDirect, listed at a price of nearly 600 € but also described as available free of charge with new spectrometer purchases.

There are two good reasons for moving away from Java: 1) the new licencing imposed by Oracle, and 2) that Java tends to be rather slow in executing code. Java is not a language normally used to write drivers that need to access hardware. What surprises me is that OceanDirect does not support even all the spectrometer models Ocean Insight currently sells under the Ocean Optics brand name.

I have an old Ocean Optics USB2000 spectrometer, which is no longer supported by recent releases of OmniDriver, but is supported by a version from year 2018. Some years back, Ocean Optics released an open source C++ driver for its spectrometers named SeaBreeze, which is no longer mentioned by Ocean Insight. It survives in GitHub as forks (e.g. a research group in Italy, Brookhaven National Laboratory and Jolz ) and as a reimplementation in Python: Python SeaBreeze, well docummented and portable. At some point it was advertised by Ocean Optics for acquiring spectra using Raspberry Pi microcontroller boards as hosts.

There are some spectral-data acquisition front-ends based on Python SeaBreeze, such as brizzy

An alternative is to call Java from R to communicate with spectrometers without the driver. Using this approach in Java or C would be limit the supported spectrometers as I am able to test the code only with three spectrometer models. With OmniDriver I can trust the driver will hide most of the differences among spectrometer models.

My tests with OmniDriver 2.70 and R initially failed. The problem caused by changes in the OmniDriver API are now solved in ‘rOmniDriver’ (>= 0.1.18) and ‘ooacquire’ (>= 0.3.0). However, I am still relying on OmniDriver version 2.56 for one spectrometer because this old USB2000 is not supported by more recent versions. Anyway, after some adjustments to the code and testing, both Oracle’s Java 8 JDK and Temurin 8 OpenJDK are known to work, as well as versions 2.46, 2.56 and 2.71 of OmniDriver, and possibly most of those released in-between them.

The future of package ‘ooacquire’

In the short term OmniDriver will remain the basis of package ‘ooacquire’. Omnidriver is unlikely to be “killed” soon by OceanInsight as it is used by commercial software to access Ocean Optics spectrometers. Oracle’s Java licencing is problematic but using the free OpenJDK solves this, for the user, but not necessarily for Ocean Insight.

Package ‘ooacquire’ uses OmniDriver mostly to communicate with the spectrometer, so I hope in the long-term to be able to replace ‘rOmniDriver’ by an interface based on Python SeaBreeze or the original SeaBreeze. SeaBreeze, however, has a different API than OmniDriver, which is not as complete, so a possible ‘rSeaBreeze’ package may lack some functions available in ‘rOmniDriver’ or require some functions to be coded from scratch in C++ within this future package. If as it seems, Ocean Insight is no longer officially contributing to SeaBreeze development, support in SeaBreeze for new spectrometer models may take a long time after their release.

The end of OmniDriver usefulness seems to be looming on us. The worst prospect would be to have to support different drivers for different spectrometer models. I think, waiting to see how OceanDirect and SeaBreeze development progresses for the next year or two is the best strategy.

In the meantime, I have enhanced ‘ooacquire’ and ‘rOmniDriver’ adding support for high speed acquisition of spectra using the OmniDriver API’s special functions. I have also implemented slower time series acquisition but in this case relying on R for the implementation.