The internet is awash with information and tutorials about the Raspberry Pi (Googling "Raspberry Pi" in April 2017 returned ~27 million hits). A good place to start is the Raspberry Pi Foundation's website, https://www.raspberrypi.org. We also like Adafruit's tutorials, https://learn.adafruit.com/series/learn-raspberry-pi.
Compile CT apps
Setup an RPi and compile CloudTurbine applications on it.
Serve CT data from RPi
Serve up some CT data from the RPi using CTweb.
File sharing from the RPi
Use a file sharing tool such as Dropbox, Syncthing, FTP to share CloudTurbine files from RPi. Run performance tests using CloudTurbine's FilePump/FileWatch utilities.
Here are the steps I used to setup a Raspberry Pi (RPi) and compile CloudTurbine (CT) on it.
We purchased the following hardware from Adafruit:
- Raspberry Pi 3 – Model B – ARMv8 with 1G RAM (part #3055, $39.95)
- Adafruit Raspberry Pi B+ / Pi 2 / Pi 3 Case – Smoke Base – w/ Clear Top (part #2258, $7.95)
- 16GB Card with NOOBS 2.1 (part #1583, $14.95)
- 5V 2.4A Switching Power Supply with 20AWG MicroUSB Cable (part #1995, $7.50)
- Optional (to communicate with RPi over serial): USB to TTL Serial Cable – Debug / Console Cable for Raspberry Pi (part #954, $9.95)
- Optional (for easy access to RPi’s 40-pin header): Assembled Pi Cobbler Plus – Breakout Cable – for Pi B+/A+/Pi 2/Pi 3 (part #2029, $6.95)
Here’s a picture of our RPi at Erigo:
Raspberry Pi setup
First step is to install an operating system on the RPi. This task is very easy using a micro SD card with NOOBS installed. I installed Raspbian OS (https://www.raspberrypi.org/downloads/raspbian/). Being a RPi “noob” myself, the following page was helpful at getting started: https://www.raspberrypi.org/learning/quick-start-guide/quickstart/.
After installing the OS, remember to change your password (don’t keep the default).
Raspbian configuration can either be done using the “Raspberry Pi Configuration” UI (available from the applications menu, Preferences sub-menu) or by running “sudo raspi-config” in a terminal window. Using one of these methods, you may want to change your Localization settings. I also enabled SSH for remote login.
Consider installing Raspbian OS upgrades (see https://www.raspberrypi.org/learning/quick-start-guide/update-sd-card/ for an easy intro how to do this).
Connecting the RPi to a network via WiFi is easy if the SSID is broadcast. If the SSID is “hidden”, it is a bit more of a trick. I followed the instructions at https://learn.adafruit.com/adafruits-raspberry-pi-lesson-3-network-setup/setting-up-wifi-with-occidentalis; see the section that starts “If you are using a ‘hidden’ SSID, try the following…”. This involves editing the “wlan0” section of /etc/network/interfaces (make a backup copy of the file before editing it).
Prepare build environment
Git is included with Raspbian. Using it, I was able to clone the CloudTurbine software to our RPi (see https://www.cloudturbine.com/using-github-and-git/ for details).
An official Oracle Java (v1.8.0_65) was also included. The only CloudTurbine application that didn’t compile on the RPi was CTadmin, which gave errors about missing JavaFX classes. To try to fix this, I upgraded the version of Java on the RPi (this didn’t fix the problem, but I figured I’d include instructions on upgrading Java anyway):
- although the Raspberry Pi 3 CPU is 64 bit, the Raspbian Jessie OS is a 32-bit kernel
- from Oracle website, I download the updated JDK installation, “Linux ARM 32 Hard Float ABI” (currently jdk-8u131-linux-arm32-vfp-hflt.tar.gz)
- for installation, I followed the instructions at http://www.rpiblog.com/2014/03/installing-oracle-jdk-8-on-raspberry-pi.html
- the new JDK is installed at /opt/jdk1.8.0_131, but (after configuration with “update-alternatives”) “java” and “javac” are accessed from /usr/bin/java and /usr/bin/javac
As I mentioned, using an up-to-date Java didn’t fix the problem – CTadmin compile still had errors on missing JavaFX classes! The problem is that the JDK installation does not include the JavaFX library. Thus it isn’t a Java version issue, it is a missing library issue! Thankfully, the solution was straightforward: I copied the JavaFX library from my Windows 10 machine (in my case, from C:\Program Files\Java\jdk1.8.0_112\jre\lib\ext\jfxrt.jar) and put it on the RPi in the new Java installation at /opt/jdk1.8.0_131/jre/lib/ext. I also had to change the permissions on this jfxrt.jar file (sudo chmod a+r jfxrt.jar).
With the above setup in place, I was able to compile all CloudTurbine applications by going into the “JavaCode” directory and executing “./gradlew build”. More information about the Gradle-based build system is available at https://www.cloudturbine.com/gradle/.