Sunday, October 12, 2014

Arduino IDE 1.5.8 on Banana Pi

I use Arch Linux on Banana Pi. In my previous post, I used a workaround to compile Arduino code on an x86_64 platform and then copy the *.hex file to upload to Arduino from Banana Pi. While i7-4770 is very fast, it's also very power hungry. I dug a little bit and managed to get Arduino IDE 1.5.8 running on my Banana Pi.

If you want to install Arduino 1.0.5-1, Arch Assualt Repo has an almost working version. To make it work, you'll need to install java-rxtx, and replace /usr/share/arduino/lib/librxtxSerial.so with a symlink to /usr/lib/librxtxSerial.so , and also RXTXcomm.jar -> /usr/share/java/rxtx/RXTXcomm.jar

Now, this is how I got version 1.5.8 working (thanks to this post for a pointer):

Use the following PKGBULID (modified from its AUR for x86 and x86_64) to build and install a package:

# Maintainer: Lauri Hakko # Contributor: PyroPeter # Contributor: darkapex pkgname=arduino-beta epoch=1 pkgver=1.5.8 pkgrel=1 pkgdesc="Arduino SDK Beta release" arch=('armv7h') url="http://arduino.cc/en/Main/Software" options=(!strip) license=('GPL') depends=('avr-libc' 'libusb-compat' 'java-runtime') install="arduino.install" conflicts=('arduino' 'arduino-toolchain') provides=('arduino') source=("http://downloads.arduino.cc/arduino-${pkgver//_/-}-linux32.tgz" 'arduino' 'arduino.png' 'arduino.desktop') md5sums=('289b1e3ad64f29db3ed13b06880dce40' '5e385c8cba80ca1b4227b162e4cad5cd' '9e36d33891d5e68d38ec55d1494499a5' 'eebc4d6495864bea99ad057af801afb9') package() { cd "$srcdir/arduino-${pkgver//_/-}" # arduino excutable should accept arguments sed -i 's/^java .* processing.app.Base$/\0 "$*"/' arduino mkdir -p "$pkgdir"/usr/{bin,share/{doc,applications,pixmaps}} # copy the whole SDK to /usr/share/arduino/ cp -r . "$pkgdir/usr/share/arduino" # at least support the FHS a little bit: install -m755 "$srcdir/arduino" "$pkgdir/usr/bin/arduino" ln -s /usr/share/arduino/reference "$pkgdir/usr/share/doc/arduino" # desktop icon install -m644 "$srcdir/arduino.desktop" "$pkgdir/usr/share/applications/" install -m644 "$srcdir/arduino.png" "$pkgdir/usr/share/pixmaps/" }

This version won't run because /usr/share/arduino/hardware/tools/* are compiled for x86. We need those files compiled for Arm7. Let's remove /usr/share/arduino/hardware/tools now.

Download a pre-compiled version 1.5.4 by UDOO folks (big thanks for their efforts!). Go to their download page, click on Driver & Tools, and click on Arduino IDE for UDOO. Unpack the archive. We only need arduino/hardware/tools . Move it to /usr/share/arduino/hardware/tools

Since 1.5.8 above expects avr tools in /usr/share/arduino/hardware/tools/avr, and Arch installs it separately, so we need to make another two symlinks.

$ ln -s /usr/bin /usr/share/arduino/hardware/tools/avr/
$ ln -s /etc /usr/share/arduino/hardware/tools/avr/

There's one more file we need to replace: arduino/lib/libastylej.so . I just installed astyle from archlinuxarm.org and do a symlink libastylej.so -> /usr/lib/libastyle.so

That's it.

1 comment: