GoIOLink is the flagship component of a project I call VernierPiLink which seeks to provide a variety of Vernier-sensor-Raspberry-Pi integration resources. It relies on VS&T’s Go!Link USB adapter to perform the physical connection between an analog Vernier sensor and the Raspberry Pi. On the software side, I am using the Go! I/O software development kit also from VS&T and the Wolfram Language which comes free (for non-commercial use) on the Raspberry Pi.
This project has evolved out of my earlier Vernier project and has some significant advantages over the previous approach. First, it makes better use of the device driver framework that comes with Mathematica. The major advantage of this change is that the commands needed to access sensor information become more intuitive and transparent to the end user. The second big development is identifying and squishing an earlier bug, which is discussed in the comments section of this blog entry, that caused the sensor to report a zero reading on occasion. Lastly, I figured out how to create releases on Github, which means the end user doesn’t need to compile the code and instead can install the device driver and Mathematica package into their home directory.
If you are interested in the software development side of things, you’ll need to visit the main Github page for this project and follow the directions there. If you want to cut to the chase, you can go to my Version 1.0 release candidate and download the two files: goio and GoIO.m. These files are compiled for the Raspberry Pi (2 or earlier, I don’t have a version 3 yet). These two files need to go in a particular directory for Mathematica to recognize them:
mkdir ~/.WolframEngine/Applications/GoIO cd ~/.WolframEngine/Applications/GoIO wget https://github.com/bobthechemist/goiolink/releases/download/v1.0.0.RC1/goio chmod a+x goio wget https://github.com/bobthechemist/goiolink/releases/download/v1.0.0.RC1/GoIO.m
That’s all there is to it. Please note that this is a release candidate and there may be some problems. I’ve been able to perform the installation, but then again, I know what the software designer is thinking, and there may be something I have forgotten to mention or do. I hope you’ll let me know if that is the case.
Once the installation is complete, you can plug the Go!Link USB adapter into the Raspberry Pi and connect a sensor to the Go!Link. Fire up Mathematica (either the command line wolfram or the notebook GUI mathematica will work) and check that the sensor is recognized with:
RunProcess["/bin/bash", "StandardOutput","lsusb | grep Vernier; exit"]
which should return a line with the phrase “Vernier Go!Link” at the end of it if the hardware is connected properly.
Next, load the package and open the device:
<<GoIO` dev = DeviceOpen["GoIO"];
I have the temperature probe installed at present, so now when I type dev[“Read”] , I get “24.4759” as the output. There are a variety of properties/methods that can be accessed in the very same fashion. To get a list, type dev[“Properties”] and you’ll notice that you can get information such as the name of the sensor (dev[“Name”] ) and the units of the value returned by the sensor (dev[“Units”] ). There’s also an option to set the measurement period of the sensor (dev[“MeasurementPeriod”] ) which, when combined with the command dev[“ReadAll”] will allow the end user to acquire data at up to approximately 50 hz.
I’m currently working on the documentation both for the end user and the software developer (and – ahem – for me, since I often can’t read my code several months after writing it). I’m also working on a couple of example projects that can be performed using the current version of the driver. I’d like to explore the limits of the current functionality before I go creating new features that may not be relevant.