The Raspberry Pi has reignited the computer/technology DIY crowd of programers, system hackers, and electronic aficionados seen in the early days of computers and amateur radio operators throughout the 20th century. For under $50 anyone can buy the raspberry pi and build operating systems, learn programing skills or create some robotic device. My project for the raspberry pi was pretty basic and could have been done with any x86 system on the market today; however an investment of about $80 in parts I had to give it a try.

My goal for the pi was to use the device as a wireless controller for the Ubiquity UniFi managed AP’s. The project consisted of getting a light OS installed and in this case I chose Arch Linux ARM and the Unifi controller software. The controller software is a web app built upon Apache Tomcat and the backend database is MongoDB. Since the controller software is a java app there is significant processor overhead and if you wish to run the UniFi controller in a public environment using the guest login be advised that running it on a Raspberry Pi or any ARMv5 system would not be suitable, but for a small office it works okay.

The latest build of the UniFi controller requires MongoDB 2.0 so I knew that I could not get by with and older build of MongoDB. My first attempt installing MongoDB 2.0 was not successful the dependency boost was not the correct version available for Arch Linux Arm. In order to install MondoDB 2.0+ on ARM I had to go with an unstable release r.2.1.1. In this release the developers have included the dependencies within the build the alleviated the problem with boost. So, here are the initial issue with MongoDB and ARMv5.

  • Multithreading
  • Boost Dependency
  • Inline assembly

The core issue with getting MongoDB installed on the ARMv5 is multithreading. MongoDB is geared for a multi-threaded system. NoSQL databases are designed for a large volume of traffic and connections, MongoDB’s name is derived from the “humongous.” For more information on why MongoDB performs better on multi-threaded please follow the link.

The issue around boost dependency has to do with the Boost C++ source libraries and my version of Linux—Arch Linux ARM. MongoDB 2.0 was programed around pre Boost 1.50 libraries and Arch Linux Arm only has Boost builds for 1.50 for the ARMv5. In attempt to work around this issue I attempted to install Boost 1.48 from the source code however that caused a number of other issues. The issue with boost in this point is the MongoDB was looking to use a boost filesystem version that has been deprecated in Boost 1.50. The second issue that I had with macro TIME_UTC which I will explain in part 2.

The third issue has to do with inline assembly and converting it over to the ARMv5 processor. C++ inline assembler is written per the architecture type so what would be written for x86 will be different that what would be for PowerPC, SPARC, ARMv5, MIPS et.al. When looking into the MongoDB code it’s clear the programers have worked at getting their database app to work on various platforms as they have inline assembler for various architecture types just not the ARMv5.

In summary installing MongoDB beyond v2.1.1 resolves the dependencies issue as the developers have included the necessary boost filesystem library within the code. In an attempt to install MongoDB most recent stable 2.2.x system failed as the developers have utilized much more inline assembler—more then what I have time or ability to convert to the ARMv5 platform. And thirdly although MongoDB installs on the ARMv5 it is not very well suited for heavy usage of MongoDB as it’s a single core processor and Mongo is better suited for multi-threaded systems.

For more information on the TIME_UTC issue please follow the link.
https://svn.boost.org/trac/boost/ticket/6940

Information on ARM and assembly
http://infocenter.arm.com/help/index.jsp

Arch Linux ARM:
http://archlinuxarm.org

Comments

  1. Kenny

    Hi Tim, I am trying to setup a unifi controller on a RPi for a church in Mexico, I don’t suppose you have a how-to guide for the whole processes?

    Any help you can give would be greatly appreciated.

  2. Tim (Author)

    Kenny, I don’t have full documentation for all the steps necessary for running the UniFi controller on the RPi. I did send you an email and via e-mail correspondence I will help you get your system running.

Commenting has expired for this article.