Tag: ‘MinnowBoard Max’

Getting started with Minnowboard MAX

Update October 12, 2015

MRAA 8.0 and UPM 4.0 have been released recently. These releases offer improvements in both stability and, in the case of UPM, an increase in number the sensors supported. I have updated this post to install the latest versions of this software.

End Update.

After recently receiving my Minnow Board Max  (MBM)  I found that there are few good resources for getting started with it. Unlike the BeagleBone Black I have used before, the MBM does not have a 4GB eMMC that we can program by flashing a prebuilt OS image. Instead we need to use one of the external connectors to provide storage for the OS. We have a choice of using a mini SD card, USB storage, or a SATA2 device. I chose to use an 230 GB OCZ Vector on the SATA port.

The beauty of the MBM is that it is essentially a low powered X64 compatible computer. This opens up many options for OS that we can use. Since I have such a large SSD on the system I chose to dual boot Windows and Linux. I put Windows 8.1 on just because I could, not because I have any plans to develop with it. Surprisingly, 64 bit Windows runs pretty well on the MBM — not nearly as laggy as I expected. But Windows heavily loads the MBM making it run hot compared to running it with Linux. Complete instructions for installing Windows 8.1 on the MBM can be found here.

For my needs Linux is a better choice. I want to be able to take advantage of the MRAA and UPM libraries as well as have a desktop OS on the board. Since we only have 2 gigs of memory on the MBM I want a distro with a very lightweight window manager. I also want to use Ubuntu as I have a long history with it (plus I am not that crazy about Yocto anyway). This lead me to Xubuntu — an Ubuntu distro that utilizes the XFCE window manager. I chose to use version 15.04.

To get the system I am looking for I will be following these steps:

  1. Update BIOS
  2. Install OS
  3. Install Nodejs
  4. Compile and install SWIG 3.0.7.
  5. Compile and Install MRAA 8.0
  6. Compile and install UPM 4.0

Update BIOS: 

My board shipped with version 0.80 of 64 bit BIOS.  As of 9/10/15 the latest bios is 0.82, which can be found here. I used MinnowBoard.MAX.FirmwareUpdateX64 for the update. Instructions for updating using the MBM Flash Utility can be found here.

Install O/S

Xubuntu 15.04 can be downloaded here. Be sure to get the 64 bit version. The image can be burned to a DVD or put on miniSD or thumb drive. The Ubuntu site has some detailed instructions for setting up install media. I chose to copy the Xubuntu image to a thumb drive for the install. The instructions for installing are here – they describe 14.04 but work for 15.04 as well. When complete you should go ahead and do all the updates before proceeding.

Install Nodejs:

Nodejs is available in the Ubuntu repositories, but that version will not work if we try to compile MRAA nor will it allow us to install the version of MRAA that is in NPM. There are a couple of options to get around this. We can use the Nodesource PPA and use APT or we can just download the tarball from the Node site.

The instructions for using the Nodesource PPA are here. Even though they specify 14.04, the instructions are valid for 15.04 as well.

I will use the tarball from the Node site.

It’s a simple install if we use the compiled download so I downloaded the  0.12.x  version of node. The read me in the archive details the install, but it can be difficult to decipher so I will summarize here. All we need to do is copy the files from the archive to /usr/local in the file system. We can accomplish this as follows:

cd /usr/local
sudo tar --strip-components 1 -xzf /path/to/node-v0.12.7-linux-x64.tar.gz

Or use whatever tool you are comfortable with to copy the files to the correct directories. A favorite tool of mine is Midnight Commander (which can be installed via APT).

Since we are copying the files onto the system we will need to set the NODE_PATH environment variable ourselves. This can be done by editing the /etc/environment file. Add the following line to the file:

NODE_PATH="/usr/lib/node_modules"

We need to get the change picked up by the environment. To do so enter:

 sudo source /etc/environment

Alternatively you can reboot the device. If you see node related errors later, check to make sure the environment is set correctly.

Install SWIG

SWIG needs to be installed if we are going to build MRAA. SWIG has a dependency of Perl regular expressions. Install the the needed files as follows:

sudo apt-get install libpcre3 libpcre3-dev

Then download SWIG 3.0.7 from here. Detailed build instructions can be found here. Download and decompress the SWIG source files. Change to the root of the SWIG source and run the following commands:

./configure
make
sudo make install

Install MRAA:

We need build MRAA so that we can take advantage of the Python and Java bindings as well as Node. Detailed build instructions can be found here. I will summarize the steps I followed:

First – install the perquisites. This includes a Java SDK, python dev modules, cmake and git.

sudo apt-get install python-dev python3-dev cmake git

Version 8.0 of MRAA requires JNI 8, so we need to install oracle java. Instructions for doing so can be found here. (The page may look a little funny because I chose the https address). Just follow the install instructions and  test to ensure Java 8 JDK is installed.  The Java home environment variable should be set during the install. If not set it by editing the /etc/environment again by adding JAVA_HOME. Add this line to /etc/environment:

JAVA_HOME="/usr/lib/jvm/java-8-oracle"

To ensure the JAVA_HOME setting is picked up run ‘sudo source /etc/environment’ (or reboot).

Next we need to clone the MRAA repo from git hub:

git clone https://github.com/intel-iot-devkit/mraa.git

Now we are ready to build. We will used the same out of tree build as described in the MRAA documentation.

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr -DBUILDSWIGJAVA=ON
make
sudo make install

Install UPM:

UPM can be cloned with the following:

git clone https://github.com/intel-iot-devkit/upm.git

We will again be using the out of tree build as described in the documentation. Enter these commands to build and install:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr
make 
sudo make install

Testing:

There are several examples installed in /usr/share/mraa/examples that can be used to test our installation with. These can be copied to a directory we have write access to and modified to test our set up. Be sure to use the MRAA numbers for the MBM pinouts when connecting devices to the system.

Other options:

I chose a Linux setup that worked for me, but there are other options that could be used. There are several options described on the web at Minnowborad.org using different distros of Linux, 32 bit versions of the firmware and alternate BIOS firmware.

So there it is. Hopefully this post will save you some time in getting your MinnowBoard Max configured for use. It took me a couple of days to gather all the info I needed to get my setup working. Feel free to hit me up if you have any questions or found something I did wrong.