joedornan
Group: Members
Posts: 8
Joined: May 2005 |
|
Posted: June 23 2005,05:20 |
|
A Step-by-Step Guide to Setting up DSL for a digital picture frame
[edited to correct misinformation & added more descriptions of XV commands]
After days of fiddling and learning about linux and DSL for the first time, I've gotten everything up and running. I will share what I did and what I learned along the way for my own records, and in case someone else finds this thread and wants to turn their old laptop into a digital picture frame using DSL.
Before I dismantle my computer and put it inside the photo frame, I need DSL to boot up, auto connect to my wireless lan, access my photo server via SMB, display those photos in a slideshow, and boot up vnc server so I can make changes without needing to have a keyboard/mouse.
STEP ONE - INSTALLING DSL
DSL is excellent for the purposes of a digital photo frame. 1- it is small and can run on really old laptops. This is good if you want to use a silent/cool but often small compact flash card as your hard drive. It is also good if you have limited RAM as the base OS easily fits into 64mb of RAM. 2- it has "frugal install" which allows you to run with almost no caching or accessing of the hard drive. This is espcially good if you want to use compact flash cards because they have limited read/write cycles...
I burned a DSL CD, but unfortunately it didn't "just work" on my IBM thinkpad. I had to learn the special command at bootup which allowed it to use the laptop's lcd screen.
fb1024x768
http://damnsmalllinux.org/cgi-bin....;t=4646
To fool my computer into thinking the CF card was my hard drive, I bought a compact flash to 2.5" IDE bus adaptor. http://adis.ca/cfdisk.2.php
Now that DSL was booting properly from the CD, I partitioned my 256mb drive by typing at a shell prompt:
cfdisk
A root shell prompt can be found in DSL's main menu by right-clicking on the desktop. select >xshells>root access>
I chose 156mb as hda1 primary/bootable, 100mb as hda5 (logical)
Next format your hda5 partition (I believe your hda1 partition is auto-formatted by the frugal install script).
mkfs -t ext2 /dev/hda5
see: http://damnsmalllinux.org/cgi-bin....94;st=5
Then I went into the main menu again and selected apps>tools>frugal install> and installed DSL onto the CFcard-cum-hard-drive. http://damnsmalllinux.org/cgi-bin....;t=4440 ftp://ibiblio.org/pub....wto.pdf
Make sure to specify a separate partition for backup/restore (in my case hda5) and make sure to specify a separate partition for mydsl extensions (in my case hda5).
STEP TWO - PERSISTENCE OF DATA
With a Frugal install, everything in your /home and /opt directories are in ramdisk, and all changes to these directories are lost unless you specify which files you want to keep (aka backup for later restoration upon reboot).
To backup files you need to list them in the filetool.lst file (in your /home/dsl/ directory). http://damnsmalllinux.org/cgi-bin....;t=5613
For further explanations, see: http://damnsmalllinux.org/cgi-bin....;t=6441
Also, when you download new MyDSL extensions (aka new applications), if you put them in the mydsl location you specified in your frugal install, they will be automatically installed (but not launched) upon your next reboot. To integrate these new extensions into the system proper (to avoid re-installing them on each boot) you can always re-master your DSL CD and do a new frugal install... but for me the re-install on boot was just fine.
Another tip: if you have another partition (like my hda5) and you think you will use it often, you may want to have it automatically mounted on each reboot. I just put this line in /opt/bootlocal.sh :
mount /dev/hda5/ /mnt/hda5/
STEP THREE - CONNECTING VIA WIRELESS LAN
If your card is supported 'out-of-the-box' with DSL, you can skip this section. I however have a linksys wpc54g (v.2), so I had to download the windows drivers for my card onto on my hard drive. If you put your driver files in your /home/dsl/ directory, be sure to mark it in filetool.lst to be backed up for future use. Once downloaded you use NDISWRAPPER to load those windows drivers into Linux.
Open >main menu>system>net setup>ndiswrapper>
and enter: inf file: (the path to your driver's primary "INF" file) in my case it was: /home/dsl/linksys/lsbcmnds.inf device: (should be already filled in?) in my case it was wlan0 sid: (the name of your wireless network name) wep: (the hex value of your wireless password) format: XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XX
Two things to note: formatting of your WEP key is important. The above 26 digits/letters separated by colons was derived by using the following website: http://centricle.com/tools/ascii-hex At this site, I just entered the plain text password I used in both my mac and my windows box, and converted it to this longer hexadecimal format.
I believe once this script is run, you can make sure it runs on reboot by adding /opt/myndis.sh to your filetool.lst file, and then adding the line myndis.sh & to your /opt/bootlocal.sh file. http://damnsmalllinux.org/cgi-bin....;t=3229
or a fancier way to automate is to create your very own mydsl package... http://damnsmalllinux.org/cgi-bin....;t=4474
Then go to >main menu>system>net setup>netcardsetup>
It will ask you if you want to use DHCP, and you should probably say yes. If you know otherwise... you're on your own filling out the specific fields.
If it helps, I was also able to connect without scripts in the main menu by using the following three commands at the prompt of a root shell:
ndiswrapper -i /home/dsl/linksys/lsbcmnds.inf wlan0 NNNNNNN XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XX modprobe ndiswrapper netcardconfig
(where NNNNNN is the name of your network - your SSID)
One good way to determing if ndiswrapper is working is to type in:
dmesg | grep ndis*
If you see it show up, you're in business...
One good way to determine if your card is seen by the system is to type:
lspci -v
One good way to review your network settings is to type in:
ifconfig
(you should see either eth0 or wlan0 etc. in addition to lo)
STEP FOUR - CONNECTING THROUGH WINDOWS NETWORKING aka SMB
If you have internet connectivity, and like me you want to access your photos on your windows-based HTPC, you should install the SAMBA application available through the MyDSL system. I assume in the example below that you put all your photos for the slideshow in a shared folder on your HTPC called "photos." Choose >main menu>apps>tools>myDSLBrowser look in the network directory for samba.
I downloaded it to the root of the partition that I identified in my frugal install setup. In my case this was /mnt/hda5/
To install this newly downloaded mydsl package, I typed in:
mydsl-load mnt/hda5/samba.dsl
(it will automatically install on boot-up if you were able to place it in your specified MyDSL partition. If you want to have the option of installing it mannually upon reboot, then put it in a subfolder called /mnt/hda5/options/)
Now create the "mount point" for mounting your SMB accessed share:
mkdir /mnt/photos
You may want to put this line in your /opt/bootlocal.sh file so that you don't have to do it every time you reboot. Be sure your bootlocal.sh file's path is listed in your filetool.lst file!
smbmount //HTPC/photos /mnt/photos -o username=UUUUUUU%PPPPPPPP
This command logs into the SMB server (in this case called HTPC) and mounts the photos share to the local /mnt/photos directory. UUUUUU stands for your username on HTPC, and PPPPPP stands for your password on HTPC.
STEP FIVE - THE SLIDESHOW
So now that we have SMB connectivity and we've mounted the windows share with all our photos, we install XV a better slideshow app than DSL's default xzgv. >mainmenu>apps>tools>myDSLBrowser> in the apps directory near the bottom of the list. If you downloaded it to your hda5 partition, then to install type:
mydsl-load /mnt/hda5/xv.dsl
Once installed, you can type this to launch XV and start your slideshow:
xv -random -wloop -wait 120 -geom 640x480 -fixed -root -rmode 5 $/mnt/photos/*.jpg
-random = randomizes the selection of photos -wloop = repeats the slideshow when it is done. -wait 120 = pauses 120 seconds between photos -geom 640x480 = indicates the size of the window in which to display your photos. useful if you retain the cardboard border inside your picture frame and only want to use the centre of your screen. -fixed = prevents your photos from losing the original aspect ratio when squeezed into the above window size $/mnt/photos/*.jpg = tells xv where to look for photos -root = puts the slideshow on your 'desktop.' Allows you to use: -rmode 5 = centers the picture on a solid background. useful if you retain the cardboard border inside your picture frame.
If you want to display your photos in a window, and you want to fill up a 1024x768 screen, then I would try something like:
xv -random -wloop -wait 120 -geom 1024x768 -fixed $/mnt/photos/*.jpg
To learn more about XV's commands, you can download the documentation from here:
ftp://ftp.cis.upenn.edu/pub/xv
Again, if you downloaded xv to the root of the partition identified as the mydsl partition during frugal install, it should load automatically on reboot.
STEP SIX - AUTOMATING EVERYTHING ON BOOT-UP
Here is where I still have some work to do.
At the moment, I haven't been able to automate connecting to the network, connecting to the SMB share, launching XV with the above option, and launching VNC server. By the way, VNC server is also available through MyDSL. I will post back here when I figure it out. Advice would be welcome.
If I have the time, I will post my experiences with the hardware side of things as well. Suggestions for improving this little guide are welcome!
Cheers, -Joe
|