Close

Beaglebone Green

A project log for HydroPWNics

An open source hydroponic garden control, monitoring, and grow system with cloud database and dashboard.

avrAVR 09/17/2015 at 21:072 Comments

This week the Beaglebone Green arrived on Monday and I spent the whole evening setting it up and learning about it. The main application for HydroPWNics is a Java application packaged as an executable JAR file. The purpose of the Beaglebone Green in the HydroPWNincs system is to function as an embedded Linux environment for hosting a JVM to run said executable JAR. In that sense the Beaglebone is the master controller over the whole system all DyIO and module hubs in the system take instructions and send feedback to the Beaglebone running the JAR.

Beaglebone Green and Packaging unboxed and booted:


First thing I did upon booting up the BBG was obtaining SSH access. By default the BBG's IP address is 192.168.7.2, to SSH in you must first SSH as root, the root password by default is blank. The BBG ships with a build of Debian for the ARM, this makes installing software and working with it really easy, almost no different from dealing with a regular Debian based system. Once I was SSHed in as root I created a new user for myself for development purposes, and a new user for the HydroPWNics application. Creating new users was just like on my server which runs Ubuntu Server (also a Debian based OS), using a Debian based distro really just makes it easier.

On to Java, I first installed the Oracle JDK via the apt-get package manager, installed with no frills and worked right away, the only problem is that the JDK in the package repository was a very old release. To support BowlerStudio on which HydroPWNics is written, the latest JDK is required. To install the latest ARM Java 8 JDK release I hade to manually install it with the following process:

  1. First on your local machine download the latest Java 8 package for Linux ARM v6/v7 Hard Fload ABI found here:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2. Open up a Terminal session on your local machine
  3. Copy the Java archive to the home directory of the root user on your Beaglebone Black/Green. Open up a Terminal session on your local machine and type with the following command:
     sudo scp /path/to/java/archive root@192.168.7.2:/path/to/user/home
  4. Once the file has finished copying over to the home directory of your user account on the Beaglebone open up a Terminal session and SSH into the Beaglebone
  5. Once inside the SSH session on the Beaglebone make sure you are in he home directory and unpack the java archive:
    cd /~
    gunzip jdk-8-linux-arm-vfp-hflt.tar.gz
  6. Copy Upack the tar into the /usr directory:
    sudo tar xf jdk-8-linux-arm-vfp-hflt.tar -C /usr
  7. Next update the Java path by adding the following lines to the .bashrc file
    sudo nano ~/.bash_profile
    Add the follownig to the ~/.bash_profile and save it
    #### JAVA 1.8.0 #######################
        export JAVA_HOME=/usr/jdk1.8.0_60
        export PATH=$PATH:$JAVA_HOME/bin
     #### JAVA 1.8.0 #######################
    Then run
    source ~/.bash_profile
  8. Finally to test the install and check the Java version:
    java -version
    It should print back something like this:
    java version "1.8.0_60"
    Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
    Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)

So yeah after some hacking away at the terminal Java is installed on the Beaglebone. Now since this project is utilizing BowlerStudio and it would make sense to be able to pull and build BowlerStudio from the git repo right on the Beaglebone. In order to build BowlerStudio in the shell from source, not only is Java required but also Maven and Gradle, I will go over the process I went to install them below:

Installing Maven 3.3.3 on the Beaglebone Green:

  1. Open a Terminal session
  2. SSH into the Beaglebone using user account.
  3. Now download the latest build of Maven 3.3.3
    cd /tmp
    sudo wget http://apache-mirror.rbc.ru/pub/apache/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
  4. Now to unpack the archive, create the install directory, and move the contents of the archive tot he directory
    sudo tar -xvzpf apache-maven-3.3.3-bin.tar.gz
    sudo mkdir -p /opt/maven/3.3.3
    sudo mv apache-maven-3.3.3/* /opt/maven/3.3.3/
    sudo ln -s /opt/maven/3.3.3/ /opt/maven/current
  5. Now to add the proper PATH, open your bash profile:
  6. sudo nano ~/.bash_profile
    Add the following to the File below the Java entry :
    #### MAVEN 3.3.3 #########################
    
        export MAVEN_HOME=/opt/maven/current
        export PATH=$PATH:$MAVEN_HOME/bin
    
    #### MAVEN 3.3.3 #########################
    Then run
    source ~/.bash_profile
  7. Test Installation and Check Version
    mvn -version

Installing Gradle on the Beaglebone Green

  1. Open a Terminal session
  2. Access the Beaglebone over SSH under the user account you created earlier inthe tutorial
    ssh your-username@192.168.7.2
  3. Now download the latest Gradle
    cd /tmp
    sudo wget https://services.gradle.org/distributions/gradle-2.7-all.zip
  4. Now to unpack the archive, create the install directory, and move the contents of the archive tot he directory
    unzip gradle-2.4-all.zip
    sudo mkdir -p /opt/gradle/2.4
    sudo mv gradle-2.4/* /opt/gradle/2.4/
    sudo ln -s /opt/gradle/2.4/ /opt/gradle/current
  5. Now to add the proper PATH, open your bash profile:
    sudo nano ~/.bash_profile
    Add the following entry after the others:
    #### GRADLE 2.7 ###########################
    
        export GRADLE_HOME=/opt/gradle/current
        export PATH=$PATH:$GRADLE_HOME/bin
    
    #### GRADLE 2.7 ###########################
  6. Then run:
    source ~/.bash_profile
  7. Lastly check test the installation and check version:
    gradle -version

So After all that the Beaglebone Green has the latest Java 8 for ARM, Gradle, and Maven. Immediately after getting everything isntalled and setup I set out to build BowlerStudio from source. Everything was going fine until it needed to find the JavaFX libraries, it couldn't seem to find them despite Java 8 for ARM supporting it natively. I need to do a bit more investigating to figure out this bug. Stay tuned for more updates on the project, the next deadline is approaching so expect more updates this week/weekend!!!!

Discussions

Jason Kridner wrote 03/25/2016 at 18:11 point

you should look at using apt-get to install Java. See the BeagleBone Black Debian elinux wiki page for instructions.

  Are you sure? yes | no

AVR wrote 03/26/2016 at 16:38 point

At first I did do just that but Bowler Studio required the latest JDK so I installed it manually and linked it to my user path.  I'll have to break out my BBG and try it again. This project is still under development BTW, and I've been meaning to make a page on the BEagleboard site at some point :)

  Are you sure? yes | no