Jay's WebLog

Mobile Devices, Xbox, and all things fun

Digital Picture Frame Part 1

Digital Picture Frame (Part 1)!

I was inspired to create a digital picture frame after seeing the Junktop Revival Wiki as well as Mike Hall's project. I wanted to reuse one of my old laptops, a Thinkpad, but the issue was that I didn't want a hard drive - a hard drive would just be too noisy for me. So out went XP, in came Windows CE.

Here are the features of the laptop digital picture frame:

  • No hard drive
  • Boots off a CD-ROM
  • Recognizes and reads random pictures off of a USB Mass Storage device, fired by a timer. Storage device is hot-swappable.
  • no keyboard or mouse necessary for basic operation
  • two keyboard keys can increase or decrease the image display timer interval
  • spacebar can jump to the next image
  • after bootup, no more CD-ROM access is required. The whole Windows CE operating system is less than 10 megs, and fits neatly in ROM. (I can cut it down further if I looked hard enough )

The Application

The software was relatively straightforward.  Upon startup, it maximizes to take up the full screen and gives it a black background. It polls every five seconds for files.  The frequent polling is necessary because the USB storage device isn't ready immediately after the OS boots up.  Anyway, after the first time it reads the files, the timer interval goes to 60 seconds, which is adjustible by the keyboard.

For each tick of the timer, the program gets a list of the files in "\Hard Disk" (that's what Windows CE recognizes the USB Mass Storage device as) and displays a random image.  That's pretty much it.  If there's an error reading a file, the program simply just leaves the existing image up and waits for the next tick.

The image stretch logic is pretty simple - the app gets the dimensions from the Bitmap object, and stretches the picturebox that the Bitmap is displayed in to such that the proportions are maintained while maximizing the real estate of the screen.

The Operating System

I took Windows CE's Platform Builder 4.2, and generated a custom Windows CE OS.  I based it off the Mobile Handheld design, but took out a bunch of things, and added .Net CF and USB support.  Ideally, I wanted PCMCIA support in my device so then I could plug in a WiFi card, but I couldn't find a driver for the PCMCIA chipset, a TI1225 (note, this wasn't my Thinkpad I was looking at, this was in my Dell Inspiron. I flipped back and forth between the two laptops for this project ).

Windows CE 4.2 and 5.0 both came with drivers for the TI1250 chipset, but not the 1225. I went online and found a vendor who offered a TI1225 driver, but they didn't seem to be interested in giving me a copy  so I decided to forego it.  I didn't want to write a driver for this project. So, as I said, I added USB support for Mass Storage.

For the platforms, I added a CEPC and Emulator platform.

There were two custom modifications I had to make: Change the taskbar to be auto-hide and not on top, and launch my app (called "pictureframe.exe" for you creative types).

To set the taskbar state, I added these .reg keys to %_PROJECTOAKROOT%\files\project.reg

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell]

    ; If your browser doesn't display it, there is an 0x01 ASCII below

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\AutoHide]
      @=""

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shell\OnTop]
      @=""

I got these reg keys by manually setting them in the emulator, and using Platform Builder's remote registry editor to see what changes in HKLM\Software\Microsoft\Shell.

The second task - to boot up my app, I first added this line to my project.bib file:

    pictureframe.exe pictureframe.exe NK S

to include the application in the image. Then I added these lines to project.reg to have the OS automatically boot up my app:

    [HKEY_LOCAL_MACHINE\init]
    ; @CESYSGEN IF CE_MODULES_SHELL
         "Launch99"="pictureframe.exe"
         "Depend99"=hex:32,00

The first value specifies that pictureframe.exe is to be launched, and the second line says to wait for Launch50 (hex 32) to be executed before launching pictureframe.  Launch50 is explorer.exe (you can find this in shell.reg in the release directory).

That's pretty much it. Next is the:

CD Preparation

I took a standard CEPC boot floppy disk (there is none in the final version), and modified it so that it will mount the CD-ROM drive as drive R:, and execute:

    loadcepc /L:800x600x16 r:\nk.bin

The image is nk.bin, and the /L flag is the resolution to run the OS at (the Thinkpad could only do 800x600, the Dell could do 1024x768).  After I created the CEPC boot disk, I booted up Nero, selected CD-ROM (boot) as the CD type, and had designated the floppy drive to be the source of the boot image.  I was surprised at how complicated this was, actually. I thought that Nero could just put a DOS boot sector on the CD, but it needs a source drive to copy it from. When you think about it, it kinda makes sense (copyrights of DOS 6.22 and all that). 

In the end, I had a spanking usable Windows CE image with my software on it!  (OK, it wasn't this simple, it was a very iterative process ).

I'll post the hardware hacking part next time. I'm trying to keep these entries short!  If anyone wants more specifics on the source code (ugly) or the Windows CE project (easy), just drop me a line.

Published Thursday, July 08, 2004 2:22 PM by swingbeat

Comments

 

Brad said:

Oh man, you got my brain going with this one. I have an old Latitude CPa laying around without a hard drive just itching to become a picture frame ....

I may need a bit more info on how you got the image burned to CD to allow the lappy to boot to CE, but I'll fumble around for a bit first ...
July 8, 2004 2:58 PM
 

Mikehall's Embedded WebLog said:

July 8, 2004 5:59 PM
 

Jay Ongg said:

Totally cool man. I got inspired from other peoples' blogs myself :).

What software do you use to burn CDs? Alternatively, if you have both a CD and a floppy drive on your laptop, you can just use a CEPC boot disk floppy to read the image from your CD (or other mass storage devices).

I recommend first getting the software image before hacking the laptop :).
July 8, 2004 3:07 PM
 

Steve Perry said:

Here's an idea. use a usb wifi adapter instead of the PCMCIA. You can get one that is nearly the same size as your usb drive key
July 8, 2004 4:50 PM
 

Jay Ongg said:

Thanks for the idea. I actually looked at that as an option. However, the only USB network drivers that ship with Windows CE are USB RNDIS drivers. I talked a bit with some of the Windows CE test team to see what they tested this with, and they pretty much said that few (if any?) USB WiFi adapters use RNDIS. I guess they did their testing with wired RNDIS devices.

The existing USB WiFi devices use their own proprietary drivers (and they might not have x86 CE versions of them).

Another idea that I'm toying with for the future is to have it work with Bluetooth. The USB port worked with a Belkin Bluetooth USB dongle, so I theoretically can do something there if I wanted connectivity... Version 2.0 :)
July 8, 2004 4:57 PM
 

Mike L said:

Jay - Way cool :)

Now for the artistic part...
Cant the L/T be positioned differently behind the matte, or is it restricted by form factor? Visually, the image is more "balanced" with a little more width (depth?) at the bottom of the frame, sort of a support/grounding effect...

Having seen it in action, I must say you've shown quite a bit of ingenuity :)
July 8, 2004 4:57 PM
 

Jay Ongg said:

So the support/grounding effect is good or bad? I admit I have no artistic capabilities :) Oh, I can definitely reposition the laptop behind the matting, i actually discovered that I can't cut perfect 90 degree angles even with a T-Square. <sigh>
July 8, 2004 5:07 PM
 

Brad said:

Cool. I got an imaged burned and booted on the old Latitude CPi, but the keyboard is a train wreck. Still, very cool to see it come up!
July 9, 2004 8:05 AM
 

Jay Ongg said:

Awesome!
What do you mean the keyboard is a train wreck? Because you took it apart? or because it doesn't work with your image?
July 9, 2004 10:08 AM
 

Brad said:

For whatever reason, it doesn't work with the image. I get characters, but not the ones I expect or in the quantities expected. Pushing 'A' makes 14 'd's and such. I tried image on a different lappy and had same result. Maybe I'll try on one of my workstations and we'll see. Any assistance greatly appreciated!
July 9, 2004 11:28 AM
 

Jay Ongg said:

Weird... I never had those problems with the two laptops I tried. Did you make any changes to the keyboard drivers? Did you update anything? Which laptops do you have, and which design? Maybe you can try Internet Appliance and see if that works...?

So I assume you got the CD burning part working? how are you getting the image onto the device?
July 9, 2004 11:33 AM
 

Brad said:

I just tried the image on a "white box" workstation and it worked fine, so it's someting about the laptops, one a Dell CPi (266 proc) the other a Dell CPiA (366 proc).

As far as the image goes, I just built up a simple image (no extras) and burned it to CD, then followed the steps in one of the MSDN articles for creating a CEPC boot disk. A bit of tweaking of the boot disk (adding CD driver, mounting drive, etc.) and it came right up.

Very cool, actually. Frustrated by the darn KB thing though, and suspect that I will be equally frustrated by lack of drivers for PC Card network interface. I've tried a couple of different ones, and the image recognizes something in the slot and asks for the driver name, but none of the drivers seem to work and the vendors sites are less than helpful. Any more thoughts on how you're going to make yours talk to the world?
July 9, 2004 11:49 AM
 

Jay Ongg said:

Well, does USB work on your laptop? (does it exist?) You can use a USB Bluetooth adapter. I'm gonna blog about that in my "future directions" section :). As for PCMCIA - yeah that's annoying. Do you know what chipset you have? you can check if you boot it up in Windows XP and it's loaded up and you look in device manager.

Which image did you use? Internet Appliance? Mobile Handheld? Try it with an Internet Appliance - there's a built-in keyboard there. I don't recall if the handheld design had one by default.
July 9, 2004 11:54 AM
 

Windows Mobile Team Blog said:

July 9, 2004 6:28 PM
 

Jay's WebLog said:

July 10, 2004 1:15 AM
 

Jay Ongg said:

Just so you all know, I posted a <a href="http://weblogs.asp.net/swingbeat/archive/2004/07/09/179024.aspx">part 2</a> to this :). Let's follow up comments there!
July 9, 2004 10:17 PM
 

Jay's WebLog said:

July 10, 2004 1:20 AM
 

MSDN Webcasts Weblog said:

July 10, 2004 3:53 PM
 

Martin's .Net Diary said:

July 24, 2004 5:29 AM
 

Martin's .Net Blog said:

July 24, 2004 5:36 AM
 

Martin Dolphin's TechBlog said:

October 28, 2004 2:34 PM
 

digital photo frame hack said:

June 10, 2008 6:38 PM
 

hacking digital picture frame said:

June 14, 2008 3:54 AM
 

Jay s WebLog Digital Picture Frame Part 1 | Quick Diets said:

June 13, 2009 10:20 AM
 

Jay s WebLog Digital Picture Frame Part 1 | storage bench said:

June 19, 2009 4:04 AM
 

Jay s WebLog Digital Picture Frame Part 1 | debt consolidator said:

June 19, 2009 10:50 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker