Weekend (tech) Project: Building CM11

I finally decided to dive into the deep end and compile Android from source!

This is not a complete how-to post. I'm writing this first to help you troubleshoot your own build and show where you might run into trouble. Primarily, though it's my notes for the next time I build.


Building:



First off, I'm building this in Ubuntu. Also, this is going to use some hard disk space. Make sure that at least 37 (more safely 40) GB is available. I didn't have quite this much available on my linux partition, so I plugged in my external HDD. You have to make sure that you have read-write-execute permissions to the mounted drive. The easiest way I found to do this is to use;
  • sudo umount /media/madscientist/MyExternalHDDsudo mount -t ntfs-3g /dev/sd** /media/madscientist
You need to fill in the **. This can be found be finding where the device is located in /dev. You can do this with the command;
  • sudo fdisk -l
From here on out, I'm following the instructions at;
http://wiki.cyanogenmod.org/w/Build_for_encore
with backup from this thread;
http://forum.xda-developers.com/showthread.php?t=1370873

Before you run envsetup and breakfast, you need to add a file, here's the description:
Have you set up your local manifest file to use the NookieDevs repo? If not, here is one that will work. This goes in the file [source directory]/.repo/local_manifests/roomservice.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="NookieDevs/android_device_bn_encore" path="device/bn/encore" remote="github" revision="cm-11.0" />
<project name="CyanogenMod/android_kernel_bn_encore" path="kernel/bn/encore" remote="github" revision="encore-omap3-3.0.y" />
</manifest>
After this, you may need to re-run repo sync.

Okay, now my nook isn’t showing up on usb. Trying to find adb_usb.ini to edit as per;
http://wiki.cyanogenmod.org/w/Doc:_adb_intro#.22Device_not_found.22_errors
Finally, I found the file in; ~/.android/adb_usb.ini and could add the code: 0x2080

With this done, I restarted the adb server (adb kill-server, adb start-server).
You'll have to answer a dialog on the nook to confirm that the computer is allowed to run usb debugging. With this done I was able to attach to the debugger.
(Another useful site for nook usb info is here; http://nookdevs.com/NookColor_USB_ADB)

This allowed me to run;
  • ~/Build/android/system/device/bn/encore$ ./extract-files.sh
Which requires that you already have cm 10.2 or later installed on the nook. This pulls some hardware information from the nook for building.

Then you can run the build as normal. From here on out I didn't have a problem building.

Installing:


Before you install, you ABSOLUTELY MUST back up your existing ROM. This makes it so very much easier to get back to a working state if something goes wrong. Like having an out-of-date recovery image....



When installing the build I encountered a “Build failed status 7” as per this thread
http://forum.xda-developers.com/showpost.php?p=47672324&postcount=353

This was because the recovery image was out of date. To install the latest recovery image, I followed the directions from http://nookdevs.com/CWR_Manual_Installation in which you’ll need to mount and copy some files over via adb. Here's the dump of my command line history:
  • adb shell mount -o rw,remount /
  • adb shell mkdir /boot
  • adb shell mount /dev/block/mmcblk0p1 /boot
  • adb shell mv /boot/uRecImg /boot/uRecImg.stock
  • adb shell mv /boot/uRecRam /boot/uRecRam.stock
  • adb push /buildpath/android/system/out/target/product/encore/kernel /boot/uRecImg
  • adb push /buildpath/android/system/out/target/product/encore/ramdisk-recovery.ub /boot/uRecRam
This brought me to CWM-based recovery v6.0.4.6, which looks promising as google seems to associate this with CM11.

This worked - CM11 was up and running!

Grab the latest gapps from CM’s website (http://wiki.cyanogenmod.org/w/Google_Apps) and you're done!



Weekend Project: Tablet Stand

I added a new tablet to the family, and thought that it was about time I came up with a stand so I could use them while typing. So with a bit of scrap wood and a few quick cuts I was able to whip one up in no time. It works great for both the Galaxy Note 10.1 and for the Nook Color. The stand is only about 4.5 in long and very lightweight. Here's the story;

Here's the basic design. A few slivers of plywood held
together with glue and dowels.

The side-view. You can see the design sketches below.

Making sure that it will fit the tablet.

A layer of spray-paint goes a long way

You can see it holds the Note 10.1 nicely.

It also works great for the nook!

Here's the side view, and you can see that it holds
the nook comfortably in landscape and in portrait mode.

The Galaxy Note 10.1 barely fits is portrait mode too.

Weekend project: Bluetooth Radio

Perhaps you may have seen these bluetooth powered speakers popping up around. Well, I had an old bluetooth headset that was sitting in my 'junk electronics' drawer, and I thought it would be fun to turn it into the receiving end of a bluetooth speaker system for the house. You may need an app such as btmono to play music to a mono (as opposed to stereo) headset.

The parts we'll need. Headset, audio jack, and splitter.

After trying to remove the case for an hour,
it was simpler to dremel off the speaker section
and get at the wires that way.

Testing it out with the audio jack.

Finally, I've hot-glued everything in. I would recommend
hot-gluing over the exposed leads so you don't get
speaker pop when plugging in the speakers.

Weekend Project - Photopopper

One of the current geek things to do is see what you can fit in an altoids tin. One of my friends had a similar tin that I was playing with awhile ago. He saw me playing around with it and challenged me to come up with something.

Well I've failed. It doesn't fit in the tin.

But it was still great fun to work on! And it's the perfect weekend project.
So what am I talking about? It's Solarbotics BEAM photopopper photovore. That's a mouthful, so let's break it down; it's a robot that follows the light. I got the design from the Solarbotics page, where you can buy a kit from them, although I just purchased the components on my own, as I wanted to fit them in the tin. 

Here's the picto-breakdown - scroll all the way to the bottom for a video!

It's best to build the circuit on a prototyping board to
make sure everything works. If not, it's easy to fix here.

Once it's working, you can solider it together.

Finally, we use some double-sided tape to attach the shell.


The tabasco robot! It's hard shell protects
it from many natural predators.

Cool Flower

Sometimes nature does the unexpected.
After a week in a vase, we had some flower stems decide to curl back in four directions:



Mobile

Everyone picks up seashells from the seashore, right? Well we did to thinking we would make a mobile out of them. Fast forward two years and we finally got around to making it ;)

The easiest way of finding the balanced midpoint is to put each of your index fingers at opposite edges of the stick, then move them inward. Volia! They arrive together at the center of mass.

Just a nicely balanced collection of seashells.
And the close-up.

'Origami' Bookshelf

If you haven't seen Frank Lloyd Wright's Origami chair, you should. Legend says each chair comes from a single sheet of 8x10' plywood cut and remade into a chair. Needless to say I wanted one as soon as I saw one. Unfortunately they're not for sale :(

So I did what I could. Inspired from the chair I decided to start a bit smaller with my own 'origami bookshelf' from some leftover wood.

We'll start by slicing the old piece of leftover wood in half. One half goes to the shelves and the other to the legs. Then we'll cut slots halfway through so they can slot into each other. There are some small adjustments I had to make as I went on, but I'll let the pictures speak for me.

The leftover wood piece.
Marking up the slots.
After the cuts.

Checking that everything fits.

The pieces individually.

Assembled lying down.

Assembled standing up. There is a bit of a tilt to the setup, 
resulting in a leg being trimmed towards the end.
Also I thought that the second shelf angled with respect to
the first and to the ground.

Prepping for the stain.

Turns out stain can polymerize if
left exposed to air and alone.



Done with staining, you may have noticed an extra piece.
The extra piece helps maintain the shelf separation.