CHDK Canon Camera Hack Made Easy (using Linux)

Canon Hack Development Kit running on Camera

 

You haven’t heard about the Canon Hack Development Kit?  It just might turn your Canon point and shoot into something with slightly more advanced features than you got from Canon.  You’ll be able to do things like shoot in RAW mode and enable different timer and other options that are not available in Canon’s own firmware.  Best of all, it doesn’t modify the original firmware in the camera but loads from the same Secure Digital card you save your photos on.  If you don’t like it or it causes problems, just remove the card and restart your camera and it’s gone.  No worries about bricking your camera with a hacked firmware update.

The only problem is that the instructions on the official site are a mess and spread out over about 10 different pages. (http://chdk.wikia.com/wiki/CHDK).  So here’s how to do it faster and easier with all the instructions in simple form so you don’t have to read 10 different pages and spend a long time figuring out how it all fits together.

Trying out the firmware

  1. Determine your camera model and firmware version.  To determine the firmware, create an empty file on the camera’s sd card (with a sd card reader and your computer).  Put it in the root directory.  This file should be named ver.req.  Put the sd card in your camera. Turn on your camera in play mode (not capture mode).  Press func/set  button and hold it down while you press the display button.  You will see your firmware version on the screen.  Write it down.  It will be something like  Firmware Ver GM1.00E.
  2. Download the correct software file that matches your firmware version and model from http://mighty-hoernsche.de/ .  Extract the zipped files to your computer after download. Get the complete version if this is your first time installing the software.
  3. Copy the files you extracted to the root of your camera’s sd card with an sd card reader. DISKBOOT.BIN and a few other files should be in the root directory and the CHDK folder will be in there too.
  4. Turn on your camera in play mode (not photo capturing mode) and press the menu button. Scroll to Firm Update… option and select it.  This does not overwrite your firmware it just adds chdk as an extra program to your camera which stays in memory until you turn it off.  If all goes well you’ll see a splash screen for chdk after the “firmware update.”
  5. You can get to chdk’s extra menu by pressing a special key before the menu button. (The printer key on my camera or the face detect key on some other cameras is the magic key.)   “alt” appears on the bottom of the display.  Now press your menu key to see chdk’s menu while it is in alt mode. Press the special key again to turn alt mode off when you want to take photos normally (without scripts).

Autoloading the CHDK Software When Your Camera Starts Up

If you’ve been successful so far then you know that chdk works with your camera.  Getting it to autoload when you camera boots can be trickier on large cards over 4 GB.  Here’s how to do it under Ubuntu Linux (you could do this off a live cd if you don’t have a Linux install).  For cards under 4 GB you don’t need to create two partitions, you just need one large FAT16 partition on the card.  You need a FAT16 filesystem on the card to load the file on bootup.  It will not autoload off FAT32 partitions, which is why you need to repartition your card if it’s a large one.

We’ll be partitioning the sdcard so it will erase all the data on it.  Copy anything you need off the card now.

Note most of the following commands need to be done as root user.  The easy way to stay as root for a few commands is to type “sudo su” at a shell prompt.  Do that now.  After you’re done with these commands type “exit” until your shell window closes to get out of your root shell.

  1. Insert your sd card in your card reader and wait until it’s detected.  Type “gparted” at the prompt (see sudo su tip above since you need to be root).
  2. Select your correct drive from the dropdown in the top right corner.
  3. Right-click and unmount the partition on this drive (unless it’s not mounted, then you don’t need to do this).
  4. Delete the partition on your sdcard.  Create two new primary partitions.  The first should be FAT16 filesystem and be 16MiB the second should be FAT32 and should take up the rest of the space on your card.  Click the checkbox at the top to carry out these actions.
  5. Now right-click the smaller of the two partitions and choose manage flags and check “boot” and click Ok.  After things complete, exit gparted.
  6. Now you need to modify the first partition so that the canon camera knows it can boot from it. Type the following command, but change /dev/sdx1to the specification for your first partition. If you’re not sure, open gparted again and look to see what you should use.  Make sure you have the right partition information and don’t do this to the wrong disk.
    echo -n BOOTDISK | dd bs=1 count=8 seek=64 of=/dev/sdx1
  7. Now copy the chdk files to the root of BOTH partitions you just created (you can use the GUI file explorer for this if you want).  This is basically the same as step 3 in the sections above.
  8. Unmount your sdcard partions and remove the card from your computer.  Move the write protect switch on the card to the LOCKED position.  Your camera will not automatically load the software from the card unless the card is locked (don’t worry you can still take pictures).  Now when you turn on your camera, chdk should automatically load.

Swapping Partition Order for Windows Access (only if you have two partitions)

Windows has problems accessing a 2nd partition on an SD card, so if you want to get your photos off this card you need to do the following procedure if you’re using windows after you’ve taken photos and want to get them off the card.

  1. Go into the chdk menu and select the Miscellaneous Stuff > Swap Partitions option.
  2. Put your sdcard into your computer with the write protect switch off.
  3. Transfer your photos.
  4. Pull the card out and re-engage the write-protect switch before putting it back in your camera.
  5. Follow steps 4&5 from the first section to manually load chdk again.
  6. Run “swap partitions” again to put the partitions back the way the were.  Your camera should automatically load chdk now on startup.

Enjoy.

Is Amazon past its prime?

Amazon has been around for a long time now.  I’ve been an Amazon Prime member for a number of years, but I’m having more and more reservations about renewing my Prime membership when it expires because of changes at Amazon over time. I’m also becoming less inclined to buy from them with their changes.   So here are my reasons:

  • The selection of non-book products Amazon carries and that I want to buy has been reduced more and more over time.  Many products are from 3rd party merchants.  This means no free shipping with Prime (except for rare “fulfilled by Amazon” products from other merchants).  If I’m at all particular about a brand, model or size, I often find it’s not carried by Amazon.  My impression is that the selection for non-book items has gotten worse, not better over time.
  • No 30-day price guarantee.  No 7 day price guarantee.  Very few price guarantees whatsoever.  Amazon used to offer a 30-day price guarantee in which they would refund the difference for items bought from them. If they sold it for less in the next 30 days you could request a refund for the difference.  This policy was something that I liked about Amazon and originally won me over, but it was quietly dropped sometime around 2008.  If you pay $60 for something at Amazon and they drop the price to $30 two days later you’ve just thrown away $30.  This exact scenario recently happened to me.  Also I notice they engage in a lot more pricing games (constantly changing the prices they charge or giving different prices to users with different browsers, for example).  I don’t want to spend my time playing games with prices–just give me a decent deal instead of playing with me.
  • Prices on small items aren’t all that great.  I know people who claim Prime is great since you can order small items and not worry about shipping.  My experience has been that the prices for many of the small items aren’t so great.  For instancing, I looked at buying a not-that-common laundry product that was $10 from Amazon, but I happened to find it in a local grocery store for $5.  I don’t know where people get the idea that small household item prices are great at Amazon, because my experience hasn’t borne this out.
  • They’re now using cut-rate regional shipping companies to cut their shipment costs.   Many recent packages have arrived by a carrier called “ONTRAC” which I’m nervous about (though haven’t yet had issues yet).  I hear on the East Coast they do something similar with another regional company which seems to be causing problems for many of their customers.

So . . . overall I’m not so happy with their direction of trying to reduce the good things for the customers as much as possible while expanding their profits.  Other options I’ve seen online are not much more expensive (sometimes cheaper) so I’m probably going to be doing more ordering elsewhere since Amazon isn’t as good as they once were.

Partitioning for 4k cluster size in Linux/Ubuntu

SATA WDC WD15EARS-00Z by kamihacker

SATA WDC WD15EARS-00Z by kamihacker

The 4k cluster size “Advanced Format” drives are causing a lot of confusion, especially in Linux and Windows XP.  The Windows XP solutions are pretty well documented by the manufacturer.  But it’s confusing to get the sectors aligned for maximum performance under Linux.  I looked at a lot of instructions before I got it working right.   kamihacker has some instructions in Spanish that are a bit different and might be helpful, too.

Many hard drive manufacturers are now moving to 4k cluster sizes on their large hard drives.  Western Digital is calling these Advanced Format Drives. In the past, hard drives used 512 byte sectors but these new advanced format drives actually have 4k sectors while emulating 512 byte sectors for backwards compatibility (minus some performance if you don’t align correctly).  The Anandtech Article gives some background.  This means you also must align your file system storage blocks to the ones the hard drive uses, otherwise you’ll have bad performance.  Linux can align the blocks but it doesn’t always do it automatically depending on your software versions.

There are a lot of ways to do this, but not all that I tried worked. The two most useful posts I found in figuring it out were at http://www.formortals.com/how-to-create-4kb-aligned-partitions-in-windows-xp-and-linux/ and http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/index.html?ca=dgr-twtr4KB-Disksdth-LX.  I used pieces of information from both these pages to get my drive partitioned properly and working.

I got this information from the IBM page: start fdisk as follows (be sure to change /dev/sda to the drive specification on which you want to create the partition).  I’m assuming this is an unpartitioned drive.   If not, use something like gparted to remove any partitions you don’t want first.  The “magic” command that will make it align to 4k blocks.

sudo fdisk -H 224 -S 56 /dev/sda

Starting it this way will ensure 4k alignment.  You can use the options in fdisk to then simply tell it the partition size in human terms (like ’300G). It will rounds it to even 4k blocks because of the startup options you gave it.

If you don’t know how to use fdisk, follow instructions such as those at the Technology for Mortals site.  If you follow these specific fdisk instructions, you  SHOULD NOT need to do the second half of the instructions where he types ‘x’ and uses expert commands to move the start sector if you started fdisk with the line I gave above.   In fact, moving the start sector on a partition that is already aligned may cause it to become unaligned.

After creating these partitions you will need to use the mkfs.ext4 or similar for your partition to actually make the filesystem on the partition.  Use the –help option to get information about how to make the filesystem of your choice.  You could probably also format in gparted without repartitioning, though I didn’t try it that way.

You can verify you partitioned correctly with a GUI tool such as gparted (sudo gparted) and then look at the properties for a partition.   You know you did it right if the start sector is evenly divisible by 8 (since 8×512 is 4096) and the partition size will also be equally divisible by 8.

Let me know if this post helped you out, and thanks to kamihacker for the photo of the drive.  This is the exact model I got which requires aligning to 4k blocks for performance.  The alternate instructions in Spanish are probably also useful to those who speak Spanish out there.

If the Singularity Is Near, what does it really mean?

I just ran across this essay by Ran Prieur talking about all the flaws in the religious-like assumptions of the “Singularity is Near” crowd.  These people make all kinds of assumptions based on some kind of crazy faith, rather than on any actual evidence. See The Age of Batshit Crazy Machines.

How did I miss this essay? Brilliant and insightful in comparison to some rant about how we’ll all become transhuman and some deus ex machina event will save us from all of our screwed up ineptitude and hubris.

I tend to think Ray Bradbury was much closer to correct about “progress” when he wrote The Martian Chronicles than people like Vernor Vinge and Ray Kurzweil when they rant about the hypothetical singularity as some kind of inevitable, wonderful, rapture-like event.  And even if it’s an inevitable event, what kind of progress does it turn out to be when the singularity starts bringing us smallpox infected blankets, or starts controlling us for it’s own ends, or simply has some kind of value system that we’ve never conceived of before?  Is smarter always better? Is faster always better?  Would you rather hang out with a genius psychopath or a nice person with an IQ of 90?

Ubuntu Netbook Remix 9.04 with HP Mini 5101

I’m not a Linux wizard, but I just helped a friend install Ubuntu Netbook Remix 9.04 on her HP Mini 5101 and tried to get things working for her. My experience was pretty similar to mine installing it on my HP Mini 2140, only with some additional problems. Here are the problems I know about and ran into. Not all are fixed yet, but I’ll give some pointers on how to fix them in case it helps anyone.

Dual-core support will make your system more or less unbootable

It might not happen on every boot, but it will happen on some.  The non-booting is pretty much as described here and here .  You can either disable the dual-core in your BIOS setup screen or install kernel 2.6.29-02062904-generic from kernel-ppa as detailed in the second link.

WiFi doesn’t work out of the box

I found a set of drivers on the Broadcom site which work.  They don’t seem to load automatically, which is probably because I don’t know the fascinating intricacies of Linux booting and driver loading architecture which I’ve just been dying to know in order to get my computer working so I can browse the Internet.  What I did to get them working is 1) Download the 32-bit drivers, the README.txt and the 2.6.29 kernel patch.  Extract stuff.  Apply the kernel patch to the drivers as detailed in its readme (though it seemed to have some errors and didn’t patch everything I thought it should).  Then follow the readme for installing the drivers with the exception of any deviations in the patch readme.

Every time you want to bring your card up and get it working you seem to have to type something like the lines below.  Reboot?  Type these lines.  Come out of sleep mode?  Type these lines.  I’m sure they would go in some init.something-or-other file.  I stuck them in a shell script to make it faster than typing them.  Maybe I’ll just hang out on the street corner with a case of Jolt Cola and an AD&D rulebook in hopes of tricking some nerd to come make them work automatically for me.  If all goes as expected, he’ll regale me with tales of Linux’s clearly superior ease of use while he types many lines of tersely abbreviated commands and rearranges things in that completely obvious way that the entire population (and especially his grandma) should be acquainted with.  Oh yeah, the lines I’m using to start the damn network adaptor follow (got a little involved in my rant there):

sudo modprobe lib80211
sudo insmod wl.ko

Ok . . . update . . . after messing with things and looking at about 20 different terse and partial code snippets online here is how I got it to load automatically.

  1. Copied the .ko file to my kernel drivers folder.
    sudo cp ~/hybrid_wl/wl.ko /lib/modules/`uname -r`/kernel/drivers/net
  2. Update module dependencies or some such update.
    sudo depmod -Ae
  3. Edit the /etc/modules file
    sudo pico /etc/modules
  4. In the editor add the following two lines to the end of the file:
    lib80211
    wl
  5. After adding, press CTRL-O to write the file out (press enter to accept same file name).
  6. Press CTRL-X to exit the editor.
  7. Reboot the computer and make sure the wireless network works without having to manually load the drivers.

Sound doesn’t work at all

I have no idea why.  I suspect it’s possibly the same problem as with many other netbooks.  That will be a good time when I get to try fixing that problem.  I can hardly wait since I’d really rather spend half my life trying to fix driver problems rather than using a computer (or any other tool) to accomplish anything.  Oh joy.

Other fixes I feel are likely in my future

The detection of the lid close doesn’t work.  Maybe a link such as this one will give me many more hours of joy trying to sort out conflicting advice and I can perhaps try about 10 different things before I find something that works.  You know, that’s what I’m hoping for.

I suspect that the web cam and the microphone may not be working either.  I’m really hoping for some large chunks of quality time with this computer next weekend.  There is nothing sexier than typing sweet arcane commands to a computer while sitting in my underwear and hoping one set of commands or another will seduce it into the base level of functionality that makes use of the hardware I paid for.

Reasons to hate Yahoo! Personals

I agree with quiplash's sentiment.

I saw this blog post by Melinda about Yahoo! personals and it seems Match.com works the same way.  Though I don’t know Melinda, I have to agree with her assessment that the Yahoo! personals contact “system” is pretty much dishonest and scummy. I also ran across this blog post which seems to indicate that Y! personals is going down. I can understand why.

I don’t know what used-car salesman thought up this system, but perhaps it’s time Yahoo! rethought it because it’s simply going to drive people away from them since their selection is dwindling and their restrictions and fees are high.  I know 99.9% for sure that I’ll be canceling my subscription just before my subscription runs out and my credit card gets charged again.  I hear sometimes they like to charge credit cards anyway, even after they cancel.  I’ll be on the lookout for that other little scummy trick of theirs.  Be warned, Yahoo!, don’t try it because I’m not stupid and I can defend myself.

So after that rant, let me explain the problem.

  1. First you pay a fee from about $15-$30 to use their personals site per month.  Yeah, I can waste that kind of money on a dinner or something, but this service costs Yahoo! almost nothing.  I mean you can get magazine subscriptions for a year for the same price as a month of Y! personals, so it’s not really nearly cheap enough when you think about how they don’t supply much content except for some articles with dating tips and some very low transaction cost page loads and database hits.
  2. WTF, I’m seeing advertising on my personals page? I’m paying $15-$30 a month to be advertised to? Yahoo!  You’re really douche bags of the highest order.  I don’t see advertisements on Flickr (which you also own) and I only pay $24.95 a year for that with much higher costs on your end. Maybe get someone from Flickr to help you pull your heads out, huh?  Oh, I forgot no one from Flickr would ever bother because Personals is a warmed over, stale, POS property for you–even if you’re making money because there are suckers born every minute.
  3. So you say it’s about the network of quality people? Pffft.  Your network of quality personals is shrinking all the time.  You’re losing market share hand over fist and have fewer subscribers than 5-10 years ago.  Also a huge majority of people that are shown on the site are non-paid subscribers which means they can’t send anyone a real message or reply unless they pony up way more money than your pathetic service is worth.  I wouldn’t blame them for not paying up.  No one likes feeling like a sucker or having their emotions transparently played on in order to give some stale, manipulative company a free ride.   There are ice-breakers (which are a little sentence you can send for free) like “You caught my eye,” but they’re pretty much useless except as a tool you’re using to try and get everyone to pay your fees.

So basically, what do you actually offer that’s of any value compared to all the other sites out there?

  1. You vet pictures and profiles before you let them go live so that it’s not only just a sex meat market.  This is nice, but other sites achieve the same goal better and more inexpensively.
  2. You make people pay what is a rather high fee to use the service.  This keeps some scammers and people who aren’t that serious out.  On the other hand it also keeps out anyone who has a clue that your site isn’t all that great of a value and that they’re being overcharged and manipulated by you.
  3. You have a large pool of people . . . though other sites probably have larger pools.  On the other hand,  someone who has paid their money can’t really communicate back and forth freely with whoever they choose.  Your supposedly large pool is full of people who can’t talk back to you.  There are a lot of inactive and unpaid people who can’t talk to you even if the other person has paid the fee.  The double-activation (as Melinda mentions) is just douchey.

I know you want people to pay, but manipulating them is evil.  Too bad Google, whose unofficial motto is “don’t be evil” doesn’t do personals.  They would never be this bad (even if they are sometimes evil-ish themselves).  I’ve even seen some sites that limit the emails for non-paids to a handful a week or something, which is certainly less evil and a better compromise to get those who really use it to pay while casual or non-users don’t pay for what they don’t use.  Plus this helps keep those casual users from ruining the service for those who pay (so they don’t feel like suckers).

K.  Enjoy your upcoming irrelevance, Yahoo!

IE6 could you go away now . . . please?

I haven’t posted in a while since I was in the middle of a big public release of The Web Archiving Service a couple of weeks ago.

I had pushed myself pretty hard to get things done early and one of the big last-minute changes was a cosmetic makeover on a set of our pages from a graphic designer.  The design needed to be pretty much “pixel perfect” and that’s when I remembered why I hate IE6.

After fighting some bad javascript libraries for rounded corners and fixing things up, all the browsers on my computer seemed to pretty much agree with each other in the way they laid things out.  Even Safari on Mac and on an iPhone didn’t do anything crazy.

Then I found out we’d be supporting IE 6.  Thats when I rediscovered that it completely destroyed css standards.  It did retarded things like doubling my  margins or making fixed size divs expand when they shouldn’t.  I had to search around for all the known problems and the random hacks that fix or work around them.   Fully 1/3 of my time in creating the new layout was dedicated to fixing IE 6 bugs.  No other commonly-used browser causes so many problems.

That experience hit home the fact that IE6 should be very, very dead by now, though 15% of people still seem to be using it.  Yikes.

Even Google seems to be about done with IE6

Even Google seems to be about done with IE6

I’m not the only person who hates IE 6.  It seems many big-name sites such as Facebook are now telling people to move on from IE 6 in order to use their services.  It’s about time.  This bad, buggy 8-year-old dinosaur of a browser needs to go away now.

If you want to help push the reluctant Luddites along, Michael Garmahis has some suggestions on how you can have your web pages encourage them to move along after 8 years of stagnating with IE6.

If you’re really missing IE6 and all it’s problems, you can always use the IE6IFY bookmarklet which should successfully remind you of “the good old days.”

Maybe the upcoming release of HTML 5 will be the last nail in the IE6 coffin.  I can only hope so.

A school at Menlo

I’m dismayed at the differences that cultural exposure and expectations make in a kid’s future.  Let me elaborate.

I was on the 38 Geary bus in San Francisco a few weeks back and overheard some urban, basketball-playing kids talking about their friends on the team who were looking at college scholarships.  The gist of the conversation was that someone had screwed up their game and was only getting into a California State college somewhere.

When asked why this guy wasn’t going to UCLA by one of the younger kids, the more knowledgeable kid explained that UCLA was almost as hard to get in to as Berkeley.  When the younger kid asked why they were hard to get in to, the older one couldn’t give any reasons.

That lead to another story about a school called “Menlo” that one kid had seen while at a basketball tournament and how there was some big school.  He really couldn’t come up with what it was called.  There was also another story about how their coach wouldn’t let them wander far from the  dorm they were staying at (seemingly so as not to alarm rich locals).

A few things amazed me. One kid lived less than 50 miles from Stanford and didn’t know the name of the school, while apparently the rest of the kids had no idea it even existed.  These were kids who seemed to be hoping to be college bound (on a basketball scholarships presumably).  They knew extremely little about the schools from their peers, their parents, the news, no one?  They’re basing their future on this?  Not even a little input or planning by parents or anyone else?  Meanwhile their chances of making a good living off basketball are only slightly higher than winning the lottery, so where does that leave them?

The point of the story isn’t that these kids are dumb, because they didn’t seem like it to me.  They seemed like inquisitive, mostly good-natured kids who had never gotten the same basic information that most suburban kids would’ve gotten from their parents, school and their environment.   It makes me nervous to think of them charging blindly into their future without being prepared in the slightest.  I wonder how it will all work out for them?

San Francisco Neighborhoods

Here is a map with comments about some of the neighborhoods in San Francisco. As with most Google maps you can scroll and zoom in and out on the map. Click a colored block to get information.


View Larger Map