Monthly Archives: June 2015

Making luakit play YouTube videos

Luakit, even though it’s a quite awesome (and fast!) browser, doesn’t play YouTube videos out-of-the-box. At least, when installing it from Raspberry Pi Debian repos, it doesn’t pull the dependencies need and doesn’t even list the packages as ‘recommended’. Nowhere I could find it, but one Arch Linux forum page had a hint, which I decrypted:
Install gstreamer1.0-libav and gstreamer1.0-alsa – the latter being responsible for sound in YouTube videos.
That’s it. Hope it helps =) If you find it’s still not working for you – comment below, I’ll try to debug the issue.

Compiling the latest Arduino IDE for Raspberry Pi

I now have started to use Raspberry Pi 2 with Raspbian Jessie as my desktop PC, and it does all the things I need it to do pretty well. Except… Well, Raspbian is stuck with Arduino IDE 1.0.5, even Jessie. Honestly, it sucks – the newest is 1.6.4 (arduino.cc, not arduino.org version. Screw arduino.org.) Did you know we’ve gotten a sketch autosave feature somewhere around 1.5? If I’d have known, I could have gotten some of my sketches saved when Arduino IDE crashed. Oh, BTW, 1.0.5 also crashes. Why are we stuck with it is incomprehensible.

Even more incomprehensible given that Arduino IDE happily compiles on Raspberry Pi 2 with just a build.xml file (ant build system file) slightly modified to add a new architecture, as well as some pre-compiled files replaced by the ones compiled for ARM. I won’t go into details much, since I hope that Arduino maintainers accept my build.xml modifications  and do what’s necessary to support ARM architecture. If they won’t, I’ll post complete build instructions myself. I’ll describe what needs to be done though.

  1. First, dependencies. Honestly, I have installed a lot of packages while trying many different ways to run Arduino IDE (including getting Linux x32 tarball and trying to replace libs one by one, which was probably stupid), so I just don’t know which from what I’ve installed is necessary and which isn’t. If you absolutely need it before it’s supported, you can always use tools like apt-file to determine necessary packages by using their filenames. I guess that ‘apt-get build-dep arduino’ will bring most of them.
  2. Then, there’s libastylej.so . You’ll need to install libastylej-jni package – it’s something that Arduino IDE sources have to download from arduino.cc website. I have modified build.xml so that it’ll copy the installed libastylej.so instead of unzipping the bundled version. You’ll also have to install avr-gcc and avrdude, as well as libusb-dev.
  3. Now’s building. You can use the official tools and instructions for building Arduino IDE, except that, as for now, the working build.xml is in my Arduino repository copy. It’s forked from version 1.6.5, but I’m sure it’ll work with the next versions as well. As for now, you might just clone my  repo instead of official:
    git clone https://github.com/CRImier/Arduino.git
    You should be able to just run ‘ant’ and relax while it compiles. Then use ‘ant run’ to run the thing, at least for the first time (haven’t researched if it does something first run-specific). After first run, at least, it should be perfectly safe to just  run it as ‘linux/work/arduino‘ (from ‘build’ directory) or even move the ‘linux/work’ directory somewhere and name it ‘arduino-1.6.5’.
  4. To have the “Compile” and “Upload” functions working, you need to replace all the files in ‘build/linux/work/hardware/tools/avr/bin‘ by their symlinks in /usr/bin.  You’ll also want the ‘build/linux/work/hardware/tools/avr/etc/avrdude.conf‘ to point to ‘/etc/avrdude.conf‘. Here’s an one-liner that you have to execute in the bin directory to make symlinks:

    for i in *; do echo $i; rm $i; ln -s /usr/bin/$i $i; done

If you try this approach and it doesn’t work, there’s a possibility I have forgotten something. Do post an error message in the comments – I’ll try to solve it =) There might be some problems because I’m using Raspbian Jessie, when most of you will use Raspbian Wheezy, so I figure some packages might need to be grabbed from testing repositories in case there’s a problem with them in Wheezy.

One more problem solved, and Raspberry Pi is one step closer to being a suitable work PC replacement for a guy like me. I’d say web browsers are still a major problem though. On Raspbian Jessie, as for now, both Epiphany, Iceweasel and Chromium crash randomly from time to time. A browser that crashes randomly isn’t a good browser for me. If you’re searching for a browser too, try Luakit. It’s Webkit-based, fast, never crashed since. You can see the latest HTML5 test of it here.