ITEAD Studio IBOX – Part 3: Installing Java and Processing

ITEAD Studio asked me how to install Processing 2.1.1 on Debian 7.0 running on the IBOX, because they want to use the IBOX as a Lampduino controller. This article describes the installation procedure. All of the commands must be typed into a shell Terminal.

1. Install openjdk and librxtx

# apt-get update
# apt-get install openjdk-7-jdk librxtx-java

2. Download and extract Processing for 32-bit Linux

# cd /opt
# wget http://download.processing.org/processing-2.1.1-linux32.tgz
# tar xzf processing-2.1.1-linux32.tgz

3. Remove the x86 Java bundled with Processing and link to OpenJDK

# cd processing-2.1.1
# rm -rf java
# ln -s /usr/lib/jvm/java-7-openjdk-armhf java

4. Modify the serial support for ARM

Unfortunately, Processing 2.1.1 no longer uses RXTXcomm.jar, so we have to copy the serial support from Processing 2.0.3, and then modify it for ARM:

# cd /opt
# wget http://download.processing.org/processing-2.0.3-linux32.tgz
# tar xzf processing-2.0.3-linux32.tgz
# rm -rf processing-2.1.1/modes/java/libraries/serial
# mv processing-2.0.3/modes/java/libraries/serial processing-2.1.1/modes/java/libraries
# rm -rf processing-2.0.3*
# cd processing-2.1.1/modes/java/libraries/serial/library
# rm RXTXcomm.jar
# cp /usr/share/java/RXTXcomm.jar .
# rm linux32/librxtxSerial.so
# cp /usr/lib/jni/librxtxSerial.so linux32

Congratulalions, you have a working copy of Processing! Start Processing by launching /opt/processing-2.1.1/processing

** Optional Steps Below **

Processing complains that it doesn’t like OpenJDK when it’s launched. If you want to accelerate the performance, and improve compatibility, you can follow the additional steps below and install the hard float version of Oracle Java 7 SE Embedded. The OpenJDK 7 that’s installed via apt-get ignores the A20’s hardware floating point unit, and instead uses software emulation.

5. Download Java SE Embedded 7 update 51

Unfortunately, Oracle makes you accept a license agreement, which requires cookies, making download a lot messier than just running wget.
Use a web browser to navigate to the Java SE Embedded Downloads page. Click the Accept License Agreement radio button near the top of the page, and then click the link corresponding to ARMv6/7 Linux – Headful EABI, VFP, HardFP ABI, Little Endian. The next page requires you to log into an Oracle account. If you don’t have one, you can create one for free. Save the file the /opt directory. The included web browser wasn’t working in my copy of ITEAD Debian 7.0. If you need a web browser to download Java, you can use iceweasel:

# apt-get install iceweasel
# iceweasel

6. Install Oracle Java SE Embedded 7

# cd /opt
# tar xzf ejre-7u51-fcs-b13-linux-arm-vfp-hflt-client_headful-18_dec_2013.gz

The .gz file will extract into a directory at /opt/ejre1.7.0_51.
7. Modify Processing to use Oracle Java SE Embedded 7

# ln -s /opt/ejre1.7.0_51 /opt/processing-2.1.1/java

When you launch Processing 2.1.1, it should no longer complain that it doesn’t like the version of Java that you’re using. I found that the hardware floating support Oracle Java 7 gives a big speedup in any code that has floating point computations.

Previous Article: ITEAD Studio IBOX – Part 2: Booting up Debian Linux 7.0

ITEAD Studio IBOX Part 2: Booting up Debian Linux 7.0

My IBOX came shipped with Android TV A20 pre-loaded in the NAND flash. I plugged a Microsoft keyboard and mouse into the USB ports, and used my Panasonic plasma TV as a HDMI display.  The boot screen is a bit confusing, because it implies that the device has WLAN support:

atv1

You can ignore the big WLAN banner on the screen, because the IBOX only has a RJ-11 100BT Ethernet port. The main screen has typical media center functions. Applications takes you into an Android launcher screen, Settings takes you to a typical Android settings screen. Going to the Applications screen shows that it has some typical apps pre-installed:

atv2

Most notable is the Google Play store support. I tried logging into Google Play and installing a few apps. They worked fine. However, I’ve heard that YMMV … some apps don’t work properly. Adobe Flash is also pre-installed, which is a plus. I did not play with it much, beyond some cursory tests, because I am more interested in running Debian Linux on the IBOX. ITEAD has a Debian 7.0 image, which runs off an SD card. Instead of downloading the version from ITEAD’s OS page, I used an alpha version built on 2014-03-27 which ITEAD sent me. To install it, first extract the  iteados-A20-debian-xfce-2.0-alpha-2014-03-27.img file from the downloaded.bz2 archive. I used WinRAR on my Windows machine to extract it. The image file needs to be copied to a 4GB or bigger micro SD card. Note that the .img file cannot be copied to a FAT-formatted SD card, because it contains an entire Linux filesystem. Instead, it must be raw-copied using a utility. In Windows, Win32 Disk Imager is a free utility that fits the bill:

w32diskimager

Simply select the image file and the SD card’s drive letter, and then click the Write button. After the image is successfully written, insert the microSD card into the IBOX, and power it up. If all goes well, you will first see two Linux Penguins in the upper left corner of the screen. After a while, the login screen should appear:

deblogin

Log in with user: root, password: root. While Android TV A20 was incompatible with my Dell LCD monitor (all I got was a blank screen), Debian 7.0 is working great. Unfortunately, I’m having the same problem with both my Dell LCD and my Panasonic plasma: when the screen blanks out after inactivity, I am not able to wake it up again. Therefore, I have to reboot it after every time the screen blanks. Hopefully, ITEAD will be able to tell me how to fix this.

Previous Article: ITEAD Studio IBOX – Part 1: First Look
Next Article: ITEAD Studio IBOX – Part 3: Installing Java and Processing

ITEAD Studio IBOX – Part 1: First Look

ITEAD Studio recently contacted me to let me know that they’re going to display my Lampduino project at the Shenzhen Makerfaire. I thought that was a pretty cool idea, and am honored to hear that. They also asked if I wanted to test out their IBOX mini multifunction single board computer, which is currently in its final days of its campaign on Indiegogo, having already raised over 4.5x its funding goal. The IBOX is designed with hackers in mind, and is driven by an Allwinner A20 ARM Cortex-A7 processor. Here are the salient hardware specs:

  • CPU Dual-core ARM Cortex-A7
  • GPU Mali 400 MP
  • DDR3 RAM 1GByte
  • NAND FLASH 4GByte
  • 4x USB
  • 1x HDMI
  • 1x optical S/PDIF
  • 1x 100BT Ethernet
  • 1x 7-24V DC power jack

ITEAD touts the IBOX as a very open hackers platform, capable of running a plethora of OS’s.  Currently, the following distros are available for booting from its onboard NAND flash:

  • Android TV A20 (from ITEAD)
  • Android 4.2 (from Cubietech)
  • Lubuntu (from Cubietech)

The following distros must be booted from the microSD:

  • Android SD bootable image (from LinkSprite)
  • Debian 7.0 (from ITEAD)
  • Cubian (from Liu)
  • Arch Linux (from archlinuxarm.org)

The IBOX comes in an anodized aluminum case that has a glossy plexiglas top:

top

Being a pre-production sample, I’ll excuse the fact that the top had a lot of superficial scratches on it, but I wonder if a matte surface would be better, since it scratches so easily. The left side of the unit contains a plethora of connectivity:

left

The small rectangle on the left labeled Uboot is a switch for entering the U-Boot bootloader. The right side contains a micro SD slot:

right

Behind the rectangular window is a 2-color status LED and an IR receiver for talking to remote controls. The back panel contains a 32-pin expansion interface connector:

back

The expansion connector is what really separates the IBOX from the typical ARM mini PC. It opens up the platform for hardware hackers, containing pins for UART, TWI, SPI, SATA, etc.  You can find the full pinouts on the Indiegogo page. The bottom of the IBOX is held on with 4 Philips screws:

bottom

A set of rubber feet would be a nice addition.  Removing the metal bottom cover reveals the bottom of the baseboard:

botpcb

The baseboard is a very tight fit into the case.  In order to remove it, you must first pry the it away far enough to clear the various ports from their cutouts in left side of the case, and then pry upwards from the front.  The baseboard is a modular backplane which contains all of the I/O connectors, as well as the socketed core board:

pcbtop

The core board is essentially the “brain” of the IBOX, containing the A20 processor, RAM, etc. Since the core board is socketed, it can be swapped out as newer, more powerful ones become available (e.g. A31, etc).  Here is a close-up of the A20 core board:

coreboard

Note that there are two pushbuttons, SW1 and SW2. I’m not sure of their purpose, but they are not accessible when the IBOX is assembled. The plexiglas top was attached to my IBOX with some rather messy clear silicone caulk:

inside

Again, I’ll excuse the mess because it’s a pre-production sample. I hope that the production units will have cleaner assembly.

So far, the IBOX looks like an interesting platform for building an energy efficient media center, file server, http server, etc. I’m looking forward to powering it up and putting it through its paces. Perhaps I will use it to replace my Raspberry PI that’s currently running XBMC. In my next article, I will boot up the IBOX, and test it out.

Resources:

Indiegogo campaign – the most information can currently be found on this page.
ITEAD blog – contains various informative posts on the IBOX
A20 core board schematic
IBOX baseboard schematic
IBOX baseboard design files
Case dimensions
distro downloads