I hadn’t updated my Raspberry Pi (a B+ model for my rpi-drd project) in about a year.
Pacman -Syu kept complaining about being unable to find files on any of the mirrors.
So I, without thinking, ran
reflector on an x86 host and copied it over. Oops. Now it definitely can’t find packages.
The archlinuxarm.org website gave me the hostname I needed, but not the entire URL. Put this in your mirrorlist (as the sole entry) to restore functionality:
Server = http://mirror.archlinuxarm.org/$arch/$repo
This was the hardest part. If you wire the wrong things together you can brick your Pi. I took some time to decide on which pins to use, and after assembly and testing everything worked. I’ll explain which pins I picked, but note that this information will not work with other hardware configurations. Continue reading
So you’ve got a bunch of parts, assembly is pretty easy. I’m going to skip over most of the chassis assembly since it came with instructions, but I have a couple pointers and I’ll go over how I attached the encoders. Then I’ll talk about soldering the motor controller and wiring the encoders up, and which pins to pick from the GPIO of the Pi.
So this is what the chassis looks like fully assembled:
Now that you have the hardware built and tested (although that’s not necessary), you can either use the code I’ve written–which is specific to the hardware and environment I have, or compile your own version. If you want to compile your own there are two options:
- Compile on the Pi itself
- Compile on an ARM virtual machine
- Cross-compile on a faster machine
The trade off? Compiling on the Pi is slow (very slow). The virtual machine is a marked improvement for compiling speed, but is complicated to setup. Cross-compiling is about the same difficulty as setting up a virtual machine but a bit faster and less “bulky”. So it depends. The virtual machine is nice if you have a lot of libraries you want to use, since you’ll have to compile all of them to be available for linking. If any of them have poor autoconfig support, it might be a pain to fix if you weren’t already on the target machine. But, since I just needed one or two popular libraries, I decided to setup cross-compiling from my host (x86_64) machine.
The last time I setup cross-compiling it was on Gentoo, and it wasn’t pleasant. However, after a little bit of research it looks like the crosstool-ng project is pretty popular and useful. I only had to patch one tiny thing.
Here’s the overall process:
- Install crosstool-ng
- Configure a cross toolchain with it
- Try and build the toolchain
- Use the toolchain to build your Pi code
So, a while back I gave my wife a Farscape DRD kit. I promised to make it in to a robot. How hard could it be? Well, not too bad. A little more expensive than planned, though…