twiddling bits and atoms's blog

Posted Sun 02 June 2013

CarPC build part 2: hardware, still

This is the second part of building a RaspberryPi powered CarPC. I ended previous entry with seemingly nice photos of home etched PCB of hardware revision 1. Unfortunately, things did not go as planned, and I had to derail this project a bit.

After careful inspection of rev 1 PCB, I discovered some hardware bugs, namely:

Frustrated with problems I experienced etching it, I decided to first debug a prototype version of hardware soldered on a protoboard.

Hardware prototype v2

Hardware prototype v2

It's definitely not pretty, but it works.

As for the software side- I had some of the bits ready (communication via SPI with MCP2515- to read messages from CAN), but I decided to start from scratch, this time ditching the Arduino libraries completely and using plain avr-gcc. It was actually quite an experience, given my last encounters with pure C were a few years ago.

Nevertheless, I got the controller side working- nicely outputting key press/release events via serial port.

As for Linux side of the software- I went for Arch Linux ARM, because I wanted a fairly low control of what's running on Pi.

I was afraid of not getting a decent navigation software running on RaspberryPi. One of the best options seemed to be navit, which I actually went for. Compiled it on Raspberry (which took a good half an hour, relevant xkcd link).

Feeding keypresses from steering wheel buttons to navit turned out to be a straightforward process. In Linux, there is a kernel module for this purpose- uinput. It basically allows user-space software to create virtual input devices, and inject events via this device. These events are then passed to kernel input layer, and are further processed as if they came from hardware keyboard.

There are nice python bindings in evdev python library, which made this process really easy.

After plugging in USB GPS dongle and running gpsd, I have almost usable navigation system.

Display

Why almost? A couple of things I don't like in current setup:

Display

More pictures can be found in my Google+ album.

What's next?

As usual, all the code is available in my github repo.

Category: RPi carpc

Comments