Monday, April 29, 2013

BeagleBone Black arrived today!

I received my BeagleBone Black today!
Cheap camera shot

The kernel date for the image on the eMMC matched the latest build date, so I did not try to flash a whole new image. I did, however, run 'opkg update' and 'opkg upgrade', which had quite a list of packages. 

I then started on getting an EDIMax (EW-7811Un) USB WiFi adapter working. I plugged it in and checked 'dmesg'. The kernel module was complaining that it could not load a binary firmware file. So a little searching on the internet, and a couple of false starts later, I found a working binary at:

so I copied it to the /lib/firmware/rtlwifi folder.

The next step was to add my wireless router settings to the wpa_supplicant.conf file. I did this by entering the following command:

# wpa_passphrase mywireless_ssid "secretpassphrase" >> /etc/wpa_supplicant.conf

The adapter associates with the access point after a system reboot and/or removing and reinserting the adapter. Success! Well, not quite. By default, access point association does not imply getting a dhcp lease.

So this is where it goes all wrong....I decided to run 'opkg upgrade' before finishing this step, however, some way through the downloads, it could not fetch any more packages. The update still seemed to be doing the configurations, so I thought it would just allow me to run upgrade again. Nope, when it got to the end it complained about bonescript.socket not listening and other bonescript post processing errors. I tried to run 'opkg upgrade' a couple more times, but nothing changed. I decided to reboot to reset the network. Doh! Now, on boot, it shows LED D2 for a couple seconds, then D2, D3, and D4 all light up and stay on. Time to reflash eMMC......tomorrow.

Sunday, April 28, 2013

ArchLinux on BeagleBone and Linux 3.8

I've discovered the joys of embedded programming with the new Linux kernel 3.8. It is bleeding edge and not for the faint of heart. The way that I/O works has been totally changed, so anything that relied on the /sys/kernel/debug/omap_mux/ folder is broken.

This has to do with switching over to Device Tree Overlays for processor configurations. The file at has a good explanation, but that doesn't make it any easier to get it up and running.

I've cloned the validation-scripts repository from I tried to run from test-capemgr folder, but it needs dtc. No problem, right, we'll just install it....wrong! The current version of dtc in ALARM is not patched to support the -@ option (see, so you get a "dtc: invalid option -- '@'" error message.

I'm not as hardcore as the guys at so I am calling it a night. I will look into how to get a patched version of dtc, but if it involves too much, I can see myself jumping ship and reverting to an older kernel.

FYI: Here are a couple of issues that I ran into, when trying to install ArchLinux, and how to fix them:

I followed the instructions at for configuring and setting up the SD card. When I followed the links provided though, I ran into 2 issues:

  1. I could get a u-boot command prompt, but it could not load the kernel image from the SD card. This was solved by copying /boot/uImage to the DOS partition.
  2. After looking for upgrades ('pacman -Syu'), the kernel update gave a warning that my u-boot was probably out of date. After a reboot, sure enough the "image is wrong type" error message appeared in u-boot. I corrected this by downloading and installing 

Friday, April 26, 2013

LiFePO4 Battery Pack for Yaesu FT-857D

I am playing around with the idea of using LiFePO4 batteries for my Yaesu FT-857D. Since I have access to some pretty cool software, I thought I would model up my radio and try some simple permutations.
Large Prismatic type, 20 Ah

This image above shows the large plastic case style. These cost around $35 each and have an energy density of around 85.33Wh/kg.

Polymer Type, 20 Ah

The image above shows the foil packed polymer style cells. These cost around $60 each and have an energy density of around 125 Wh/Kg.

The typical discharge rate is the same for both types, 20 amps, but the peak discharge (<10 seconds) is much higher for the prismatic style (200 amps) vs the polymer style (40 amps).

Thursday, April 25, 2013

Convert Cheap 9 LED flashlight to PIC Controlled High Brightness LEDs


Flashlight in the packageA while back I needed a high power light for my mountain bike. I couldn't justify purchasing one, as they were between $100 and $500 at the time, so I decided to make my own.

I was initially going to fabricate the whole thing out of aluminum tube stock and a lathe, but that was going to require a lot of time and borrowed resources (I don't own a lathe :). So I started to look for suitable candidates that were 'close' to my design dimensions.

I ultimately chose a cheap, Chinese, nine LED flashlight that runs on three AAA batteries. Here is one that was purchased for around $1.50 (2 for $3) from Harbor Freight.

Let's open it up, shall we....

Three parts so far...
Removing the battery compartment.
Nothing warranty voiding here...
Trying for four more parts...
Removing the LED board with pliers.
That was easy....
Ah, the smell of aluminum and plastic....
The LED assembly, not much to it.

Time to upgrade!

The Switch

A big green button
I had to open up the hole a wee bit to get the new switch to fit.
Like a glove..
The first thing to go was the power switch. The original switch was turn on, turn off, but I thought a momentary button would be so much cooler and I also convinced myself that a button that cost more than the flashlight would be a longer lasting solution. Little did I know how many tens of thousands of switches and buttons there were at Mouser. I chose a nice bright green silicone one, for moisture reasons.

The Processor

Now I know why they switched to surface mount components....
Microchip PIC12F683 installed
Space is kinda tight in the case, so I decided to solder a PCB straight to the pins of the switch. Since the PIC chip only has 8 pins, I didn't have to create a lot of traces or add any discrete components.

For those not familiar with the Microchip PIC processor family, you are missing out. This particular unit has up to 6 I/O pins (on an 8 pin device!), goodbye my faithful 555. The clock is internal and the reset line can be made an input, but I chose to leave that alone to simplify programming and debugging. Another neat feature is onboard EEPROM that is writable from the running program. I use this to store the current brightness, in case power is lost momentarily. More on that later.

The LED Module

These high brightness LEDs come with a price, they must have a good heatsink. So what better way to sink some heat than to add more aluminum. Technically copper would be better, but aluminum is lighter and I had some laying around.
The motion stopping speed of my Nexus One camera
A friend has a machine shop in his garage :)
None of the scraps of aluminum I had would fit, without some minor machining. Once we had the right size heatsink (approximately 1" of material to be pressed into the case), we prepared the flashlight case by removing the paint, from the inside, with a Dremel tool. The LED mounting face height is a little more dimensionally critical, so it involved some trial and error fitting of the whole assembly. Once we were satisfied with the dimensions, the heatsink was permanently pressed into the case.

The smell of burning paint.....yum.
Removing the paint from the inside of the case.
Getting closer....
Ignore the LED module for now ;)

Stay tuned for more!

Look for the exciting conclusion soon....