Category Archives: Embedded

Embedded Computing devices and information

Raspberry Pi: first impressions and bluetooth configuration instructions

I got my first Pi a couple of months ago and finally got around to testing it out. Initial impressions are very favorable – it’s a well-engineered little embedded board. Performance is not stellar, but is about what one should expect from a 700 MHz device. I chose to use the Occidentalis v0.2 distribution from the fine folks at Adafruit. Installation was painless, but I’ve been working with Linux for many years so your mileage may vary.

My Raspberry Pi is housed in the awesome Adafruit Pi Box, a really nice laser-cut acrylic enclosure. I also ordered a small sheet metal enclosure from an eBay seller which should arrive sometime next week with my second pi. I’ll post a brief review once I get the enclosure.

For connectivity, I’m using a little 802.11b/g/n dongle from Adafruit. The device worked out of the box with some minor configuration to set up my SSID and password. Although the Adafruit site claims that the device requires a powered USB hub, it is working just fine for me connected directly to the pi.

The power supply that I am using is a 5V, 1A Power Supply from Adafruit. It seems to be more than adequate for the task.

For storage, I’m using a [amazon_link id=”B007M51J42″ target=”_blank” ]SanDisk SDSDU-016G-AFFP Ultra 16 GB SDHC Class 10 Flash Memory Card.[/amazon_link] I’ve experienced no issues with the card so far, and disk speed seems more than adequate.

I’m using an old analog VGA monitor for display. Since the pi doesn’t natively support VGA, I’m using a [amazon_link id=”B0080D3Z24″ target=”_blank” ]Sanoxy ViewHD HDMI-D to VGA Converter.[/amazon_link] It works OK, but I do experience an odd blink on the display that I did not see when I connected to my flatscreen TV or a composite monitor. I’m not sure if this is being caused by the converter or the cheap flat-panel monitor (which I purchased about 5 years ago for $20 at a drug store, of all places.) Since this pi will likely be spending most of its time running headless (without a display), I’m not that worried about this glitch.

I’m using an [amazon_link id=”B003765X38″ target=”_blank” ]Azio BTD-V201 USB Micro Bluetooth Adapter[/amazon_link] to interface with a Motorola bluetooth keyboard [amazon_link id=”B004L9MBH6″ target=”_blank” ]Motorola Wireless Keyboard[/amazon_link] and [amazon_link id=”B006428K7I” target=”_blank” ]Motorola 89519N Bluetooth Mouse[/amazon_link]. Configuration was fairly straightforward after I installed the appropriate bluetooth modules. For the sake of posterity, these are the modules that I installed (via aptitude):

  • bluez
  • bluez-tools
  • python-gobject

Note that I DID NOT install the “bluetooth” meta-package, as it dragged in a large number of unnecessary packages and wanted to replace the Occidentalis-included versions of php and perl. The “python-gobject” package was required to resolve a missing reference required by the bluez tools.

The Azio bluetooth adapter shares a chipset with many cheap BT dongles available on eBay. The tool lsusb reports the device as ID 0a12:0001 with description “Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)”.

To configure the devices, I connected to my pi via SSH:

ssh pi@raspberrypi.local

After plugging in the device and booting up the pi, check to see if the keyboard is visible. My keyboard’s MAC address is 00:0F:F6:81:5D:C0. Type “hcitool scan” to list visible bluetooth devices. Once I verified visibility, I needed to pair the device:

sudo bluez-simple-agent hci0 00:0F:F6:81:5D:C0

The program prompts you to “enter pin”, I typed “0000” at the SSH prompt and quickly typed the same on the keyboard. Timing is a bit picky, so this may take a couple of attempts.

Once paired, I needed to mark the device as trusted:

sudo bluez-test-device trusted 00:0F:F6:81:5D:C0 yes

And then connected the device:

sudo bluez-test-input connect 00:0F:F6:81:5D:C0

Once these steps are completed, the devices are automagically connected at startup.

I also installed a few additional packages:

  • ipython, an enhanced Python shell
  • emacs, my preferred text editor
  • lynx, my preferred CLI/text-only web browser
  • mosquitto, a MQTT 3.1 message broker
  • python-mosquitto, Python libraries for MQTT
  • mosquitto-clients, MQTT command-line tools
  • owfs, Linux support for 1-Wire devices via the excellent One-Wire File System tools
  • owfs-fuse, Userspace bindings to OWFS filesystem
  • python-ow, Python bindings for OWFS

I ordered two of the expanded memory Raspberry pis from Newark the day that they were announced, so my first pi will be going to my nephew tomorrow. He is a freshman in high school this year and is very interested in software development, so this is part of my continuing strategy to introduce him to Linux and other non-Microsoft technologies. Mojang’s announcement regarding a new Raspberry pi version of Minecraft was extremely timely and has helped to increase his excitement about experimenting with the platform.