How to Install to NSLU2 RAM
Installing TwonkyMedia in RAM is a recent TwonkyVision innovation. Veteran users express surprise, and some doubt, about this approach but it appears to work fine. It's my impression that TwonkyVision was able to reduce the program's size so it can run quite comfortably in the NSLU2's RAM. A crucial requirement is that TwonkyMedia's database must be stored on a flash drive attached to the NSLU2's "Disk2" port (or stored on the "Disk1" hard drive if you modify their installation script).
Being interested in energy conservation (and silent machines) I'm tempted to switch from the traditional "uNSLUng hard-drive" installation to a RAM installation because it may ensure that my Seagate USB hard drive will spin-down when the music server isn't in use. With my current hard-drive-based installation the drive sometimes spins-down, but not always; a behavior I haven't quite figured out.
Whichever method you choose, know that you can always restore the NSLU2 to its original Linksys firmware and start over.
Assuming you've assembled the ingredients, let's get started.
Verify Normal NSLU2 Operation
The first step is to verify that the computer, NSLU2 and USB hard drive are all talking to each other. Because uploading firmware to the NSLU2 is a critical procedure it is best to connect your PC directly to the NSLU2—no switch, no hub, no LAN—just a CAT5 cable between the two devices. I used a laptop PC connected directly to the NSLU2 with a standard CAT5 cable.
- The NSLU2's default IP address is 192.168.1.77. If yours is not using this address you'll have to transpose these instructions.
- For your PC to communicate with the NSLU2 the PC must be in the same subnet. Set the PC's IP address to 192.168.1.nnn (where nnn is any number other than 77).
- Connect the target USB hard drive to the NSLU2's "Disk1" port.
- Power up the NSLU2 and the drive. Wait several seconds for the NSLU2 to beep.
- Open a web browser and in the Address field enter: 192.167.1.77
- "Go" there.
- If the NSLU2's GUI appears and the hard drive appears next to "USB Port 1", you're ready to move to the next step.
Start with a Clean Slate
To help ensure that this recipe will work I suggest resetting the NSLU2 to its default configuration unless it is new, right out of the box, or its default configuration has never been changed. I also suggest reformatting the drive using the NSLU2's built-in disk format function. For this recipe to succeed the drive must have been formatted by the NSLU2. I've read that it is possible to install uNSLUng and TwonkyMedia on an already in-use NSLU2 and drive, with files and folders on the drive; custom users, groups, shares and other personal settings in place; but I didn't want to take any chances. You can skip the next two steps if you feel confident about doing your own translating between my recipe and your unique configuration.
Restore NSLU2 Default Configuration
- As above, browse to 192.167.1.77
- Click Administration .
- Click Setup .
- Scroll down and click Restore Default Config .
- Before proceeding I think it's a good idea to change some of the NSLU2's settings and fill in some of the empty fields. Here's a list (menu names included):
- Administration - LAN - Gateway your router's IP address (but leave blank if the NSLU2 will not be used on a LAN connected to the Internet)
- Administration - LAN - Primary and Backup 1 DNS Server addresses provided by your ISP (but leave blank if the NSLU2 will not be used on a LAN connected to the Internet)
- Administration - System - Server Name NAS is my choice because it's memorable and you can substitute //NAS for //192.168.1.77 in the browser and Windows Explorer.
Format the drive
If the NSLU2 has not yet formatted the drive, do it now. I've read that the NSLU2's format function works best on a drive with a single FAT32 partition; in other words: not a drive with multiple partitions, not even a drive previously formatted by an NSLU2. USB drives usually come pre-formatted as a single FAT32 partition, which is perfect. (Note that using another program to format the drive for EXT3 will not work; the NSLU2 creates one big partition and two small ones, and my impression is they must be created by the NSLU2. Otherwise, the NSLU2 may not recognize the drive—a problem that frequently appears in the various NSLU2 forums.)
At the time of this writing some people are saying that if you install TwonkyMedia in RAM you can then use a FAT32 drive as NSLU2 "Disk1". After several tests I have yet to make that work reliably. Plus, even when I can get the NSLU2 to recognize a FAT32 drive file, transfers to and from the FAT32 drive were terribly slow. So I suggest you stick with the NSLU2's EXT3 format until others prove FAT32 works comparably.
- Click on Administration .
- Enter admin for both user name and password.
- Click Advanced .
- Click Disk
- If "Disk 1 Status" is "Not Installed" click Format Disk1 and take a break. Eventually, the NSLU2 will display "Formatted" next to Disk 1 Status after it's finished.
Install uNSLUng Firmware
If the NSLU2 is still on, it's time to turn it and the hard drive OFF.
- Click Administration .
- Click Status .
- Click Shutdown Now .
- Disconnect or power off the drive attached to your NSLU2.
You will use the NSLU2's built-in firmware upgrade feature to install uNSLUng.
- Download the Unslung 5.5 beta firmware here.
- Unzip/Extract the file "Unslung-5.5-beta-firmware.zip" to an easily found folder, like "C:\unslung".
Be sure the hard drive is either disconnected or switched OFF
- Using a web browser go to the NSLU2's GUI at 192.168.1.77 (or //NAS if you renamed the NSLU2).
- Click on Administration .
- Enter admin for both user name and password.
- Click Advanced .
- Click Upgrade .
- Click Browse and find the "Unslung-5.5-beta.bin" file.
- Click Start Upgrade . A popup window will appear saying that "The upgrade progress(sic) will take 5 minutes". Press OK to continue.
- Wait several minutes for the process to finish.
- After the upgrade finishes a popup window will appear saying "Upgrading OK! System will reboot in 10 seconds." Click OK and wait until the NSLU2 beeps to indicate it's fully rebooted, then shut it off using its power button.
Decisions to Make
At the time of this writing, if you run the TwonkyMedia installer without modification, it is assumed that a USB flash drive will be inserted in the NSLU2's "Disk2" port and remain there permanently. The following information will help you decide how you want to deal with this.
When I wrote this, the TwonkyMedia software package contained two different installation scripts (actually, three, but "install.nas" + "install.sh" = "install-twonkymedia-on-nslu2.sh"). Despite knowing nothing about Linux, I could see disparities between them. The process of deciphering and comparing these scripts lead me to a couple of discoveries worth mentioning:
In the section of one script that creates twonkyvision-mediaserver.ini, there's a line:
dbdir=/share/flash/data/twonkymedia.db
This tells TwonkyMedia its database will be on a USB flash drive attached to the "Disk 2" port. I asked TwonkyVision why they assume the database will go on a flash drive instead of the "Disk 1" hard drive. Reinhard, one of their incredibly responsive support people, replied that a flash drive will yield faster database access because it uses memory I/O instead of disk I/O.
I then recalled reading that flash drives have a limited number of erase cycles (called "write endurance"). Imation says their flash drives have between 10K and 100K erase cycles. Do the math. If TwonkyMedia rescans the drive and rebuilds its database at the default of "every 90 minutes" it could feasibly wear out a flash drive in a couple of years. I thought about this. Since I edit photos and rip CDs on a PC I'll probably copy these files to the NSLU2 in batches, so I can set TwonkyMedia's "scantime" to zero and then manually tell it to rescan the database after I've uploaded a batch of files. This should extend the flash drive's lifespan indefinitely.
Soโฆ if you plan on leaving a USB flash drive attached to the NSLU2 permanently, to handle the database, choose the drive now. This dedicated flash drive must be large enough for the database, which TwonkyVision says requires approximately 1MB per 5000 files (then double it because during rescans it creates a copy of itself). Sounds like a tiny 64MB stick should be fine.
Edit the install.sh Script if Desired
If you prefer to store the database on the hard drive, you must modify the script before proceeding. Using Windows Explorer, open the folder into which you unzipped or extracted the TwonkyMedia files. TwonkyVision uses two scripts to install TwonkyMedia from within Windows. One of them is named "install.sh". You can't edit this script using just any text editor; it must be one that supports Linux line endings, which means line-feeds only (no carriage returns). I use Vedit. Cream is one of several you can download for free.
- Once you've opened "install.sh" in an appropriate editor look for the line that says:
dbdir=/share/flash/data/twonkymedia.db
dbdir=/share/hdd/data/twonkymedia.db
- While you're editing the script you might want to change the following settings, too:
scantime = 90 to scantime = 0
friendlyname = Twonky NSLU2 to friendlyname = NAS
- Save it back to the same folder using the same name.
If your NSLU2 will be connected to a LAN with Internet access, connect it to the LAN now. Connect the PC you've been using to the LAN, too.
- If you decided to store the database on a USB flash drive, connect the flash drive to the NSLU2's "Disk2" port.
- Connect the hard drive to the NSLU2 and turn it on.
- Power up the NSLU2.
When the NSLU2 beeps, it's ready.
- Browse to the NSLU2's home page at http://192.168.1.77
- Verify that Disk1 is ready.
- If a flash drive is installed, verify that Disk2 is ready.
- Using Windows Explorer, open the folder where the TwonkyMedia files are.
- Locate the NASSetup program. Double-click to run it. The following screen will appear.
- If the address is correct, click Send Server -> NAS
A lot of text will whiz by in the "Messages" window. It was a bit disconcerting to catch glimpses of words like "no process killed", "cannot remove", and "no such file or directory", but if the last line in the window ends up being: "server installed", it probably worked.
Click DONE .
Here's the entire contents of the Messages window so you'll have some idea of what to expect. (TwonkyVision may change their installation script(s) so this is for reference only.)
Verifying the Installation
- Browse to the NSLU2's home page at http://192.168.1.77
- Click Administration .
- Click Status .
- Click Restart Now .
- When the NSLU2 beeps and is ready, click Home in your browser.
- Insert the cursor in the Address field and edit it to read:http://192.168.1.77:9000, and press Enter.
- The TwonkyMedia GUI should appear.
If you see the GUI on your screen, CONGRATULATIONS!! (and skip to the last section).
During one of my tests the GUI didn't appear. I figured I'd slung the wrong sling or something. To make a long story short, it turned out that the NSLU2 was hanging up trying to connect to the Internet because I had filled in the DNS and Gateway fields in its configuration.
Normally, the NSLU2 would be connected to a LAN and thus to the Internet, but while flashing its firmware I had it connected directly to my laptop. That's when I learned the following rule:
If the NSLU2 will not be connected to the Internet, leave the Gateway and DNS fields blank.
Eventually, if not immediately, the TwonkyMedia GUI should appear in your browser's window even if the NSLU2 is not connected to the Internet. If the GUI doesn't appear after several minutes, remember what I said in the Introduction, this recipe has no warranty, express or implied... (In the top SideBar see Troubleshooting.)
Testing the Installation
Once you see TwonkyMedia's GUI, what's next? The GUI is just for configuring TwonkyMedia; I wanted to see what using it is like! At the time I didn't have a Roku or other UPnP player to test it with. So Google found me a software client: Cidero. It's free, and very non-invasive. It doesn't actually play any media, but it does let you see how TwonkyMedia's database gives you various views of your music library.
An alternative client, one that will actually play music and videos, is WinDVD. Be aware that when you install the trial version you'll see messages like "installing 3rd party applications" and "installing Interactual player" so... you may get more than you bargained for.
Before doing anything else, though, I suggest you see my article, Configuring TwonkyMedia.
Top
Comments (0)
You don't have permission to comment on this page.