Linksys NSLU2 - Network Storage Link for USB 2.0 Disk Drives
The Linksys NSLU2 is a small (130×21x91 mm) and cheap (~100€) consumer NAS device. It is used to make USB Flash memory or hard disk devices accessible over a network to share music, video, or data files with managed access by user name or group.
Hardware specs are:
- Intel IXP420 (ARMv5TE) CPU running at 266MHz (Originally at 133MHz)
- 32MB SDRAM
- 8MB NOR flash
- 10/100 Ethernet (built-in)
- 2x USB 2.0 host
The original OS is a proprietary Linux based system developed by linksys. It runs internal SAMBA server for file sharing and all configurations are done by web-browser. There is no other way to access the device! (At least from the original OS) …
1- Releasing the real potential of this little box:
I’ve installed an alternative OS from this great Linux community www.nslu2-linux.org. The UnSlung 6.8 Beta V23R63 will keep the original linksys web-interface and samba server but will open doors for the world. With this OS it is now possible to telnet or ssh into the Linux distro and install available packages for that specific distro. There are a lot of cool things that you can do with this little box, please check the howto section.
I’ve tested myself some of the howto all with success:
RedBoot/Flash
Hardware
Network Services
Remote Access
Email Services
Other
2- Debian 4.0R2 - Go that extra mile …
[installed: 02-01-2008]
[last updated: 20-11-2008]
I’ve have recently discover that Linux distro Debian is now prepared to run on this little box! This will give the slug the possibility to install almost everything available at the Debian repository, or at least the most common Linux apps. This can be done by following this great tutorial (Thanks Martin Michlmayr for this tutorial):
I’ve configured my slug to run from a 4GB USB Flash device, 500GB USB Hard drive for data storage and a 320GB USB Hard drive for backup.
After the installation I’ve started to tweak my new Debian slug:
-
Synchronize Slug’s clock from internet time server:
apt-get install ntpdate
-
Tips for running Linux on a flash device:
-
Change the function of the power button to shut the system down as opposed to rebooting it?
-
Beep ip address trough internal speaker / Beep when the NSLU2 has finished booting
-
Lighttpd With PHP5 Support
-
Install and configure SAMBA server
-
Running command to configure PT language:
dpkg-reconfigure -p low locales (added pt_PT ISO-88591) -
Install Dyndns update tool:
apt-get install ddclient (selected interface web)
-
Install HD spindown utility:http://hd-idle.sourceforge.net/(Need more testing - HD is not spinning down)Spindown optimizations (Method5): -
Spindown alternative method:
apt-get install sg3-utils
/usr/bin/sg_start –stop /dev/sdb
source -
Install rdiff-backup for internall backup solution:
apt-get install rdiff-backup
-
Screen - Keep Your Processes Running Despite A Dropped Connection:
-
Send email with scripts by using sendEmail tool:
-
Install disk usage tool durep:
apt-get install durep
(will create html files with data and bar graphs for better visualization)
http://linux.com.hk/penguin/man/1/durep.html
http://www.ubuntugeek.com/create-disk-usage-reports-with-durep… -
Change console colors:
http://jfmitre.blogspot.com/2006/04/arquivo-colourrc.html (Brasil)
Apply point 2. of http://www.ibiblio.org/pub/Linux/docs/HOWTO/unmaintained/Colour-ls -
Run script to a pre-defined time (nice to use when you need to wait for all files to be copied before running a backup): at -f /bin/beep_1234.sh now + 5 minutes
Can also use sleep [seconds] command for shorter periods:
sleep 300; /bin/beep_1234.sh;
-
Install htop tool:
apt-get install htop
-
Install multitail tool:
apt-get install multitail
-
Change network configurations:
http://www.youritronics.com/how-to-set-the-mac-address-from-etcnetworkinterfaces-in-debian/
-
Add external DNS server to /etc/resolv.conf to fix problem from DSL router (stops resolving domains). Can also be fixed by adding IP/domain to /etc/hosts
-
The slug fails to reboot with 2 drives connected:
-
Auto mount/unmount external harddrive with autofs: http://www.greenfly.org/tips/autofs.html
-
Auto mount/unmount remote fs with autofs and sshfs:
-
Get a copy of my currently flashed image (dump):
cat /dev/mtdblock* > image.bin
-
Restore slug’s flash from .bin image file (require that slug is in “upgrade mode”):
upslug2 –image=”image.bin” (send command and file from a remote linux machine)
-
Compile/Install webcam drivers (Logitech QuickCam Web):
-
InstalUsbWebcam HTTP Server - Motion
-
How do I get X applications to correctly forward over SSH to my X server from Debian/NSLU2 ?
-
Playing sound files on the Debian Slug:
-
Adding a WIFI dongle:
http://sunspot.co.uk/Projects/SWEEX/slug/notes/Debian_notes.html
-
Change Swap label (on ubuntu machine):
mkswap -L SlugSwap /dev/sdb2
- Update slug’s flash:update-initramfs -u; flash-kernel
After having some problems with my slug resolving domain names I found that some package called resolvconf was cleaning my nameserver configs. Solution, remove it:
apt-get remove resolvconf;
update file with nameserver manual settings:
/etc/resolv.conf
search lan
nameserver 192.168.1.254 # dsl router
nameserver 208.67.222.222 # opendns.org
/etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.77
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
dns-nameservers 192.168.1.254
dns-search lan
2.1- Slug Performance using Debian + Apache + PHP5 + MySQL + PERL
http://www.nslu2-linux.org/wiki/uploads/SLUG_performance_report.pdf
2.3- Psion 5mx terminal connected to Slug’s serial port
(AddASerialPort-RS232 connection without a kit mod required)
Every time I need to check something on my Slug I have to connect my PC and SSH into Slug’s to gain access to a shell … I finally decided to use my old psion 5mx series to connect to slug’s console via serial port. Hurray, now my Slug has it’s own screen and keyboard!
Note: no software required to install, console is already running on serial port. If you check slug’s debian file /etc/inittab you will find these lines that will start getty on boot:
…
# Example how to put a getty on a serial line (for a terminal)
#
T0:23:respawn:/sbin/getty -L ttyS0 115200 linux
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
…
After the boot is completed you will get a console to login. Also dmesg will output debug messages, you can always check if the USB device is being recognized by the Debian.
.
2.4- Other Interesting Projects
- A High-Resolution IP Webcam: http://johnarthur.wordpress.com/2008/03/25/a-high-resolution-ip-webcam/
- Further notes on the NSLU2 and QuickCam Pro 9000: http://johnarthur.wordpress.com/2008/03/29/further-notes-on-the-nslu2-and-quickcam-pro-9000/
- A Megapixel Time-lapse Camera System: http://johnarthur.wordpress.com/2008/05/24/a-megapixel-time-lapse-camera-system/
- A Battery-powered Time-Lapse Camera: http://johnarthur.wordpress.com/2008/06/26/a-battery-powered-time-lapse-camera/
2.5- View Slug’s webcam stream in Chumby
[Last Test: 24-07-2008]
I have been making some tests with my Slug and Debian distro in how to stream images and video (Jpeg / MJPEG) from webcam. Still making some tests but finally got to the point of getting Logitech Quickam Pro 9000 (High resolution webcam) to work with my Slug. I’m using mjpg-streamer application to serve images/stream, it works like a mini webserver that can be accessed from webbrowser. The webcam Motion JPEG streaming works quite well (requires Firefox webbrowser), I can actually get video stream with 960×720@15fps, Slug’s CPU load at 30% and still have some free RAM.
Has tests were running fine, I have decided to play around with a new gadget that one friend of mine has just bought, Chumby! It is a very interesting gadget, also with linux OS and the hardware is better than Slug (but also more expensive):
- 350 MHz ARM controller (MX21 by Freescale)
- 32-bit 64 MB SDR SDRAM running at 117 MHz bus speed
- 64 MB NAND FLASH ROM
- 320×240 3.5? TFT LCD with 3-state LED backlighting
- Touchscreen input
- Stereo 2W speakers with hardware mute
- Headphone output with headphone presence detection
- Microphone input with programmable AGC
- Squeeze sensor (to pick up when you squeeze the chumby)
- 3-axis Accelerometer (+/-2g range @ 12 bits resolution)
- Three USB 2.0 full-speed (12 mbps) ports, one on the main board and one on the outerware electronics
- 802.11g connectivity via a USB dongle plugged into the main board
- Circuitry to detect the presence of wall adapter power and auto-fallback to backup battery power
- Switching power supply network that can eat between 6V and 14V
- Cryptoprocessor for authentication and system management (full device access over JTAG)
- Daughtercard ID management system for device personalization
- Available SPI bus on the chumbilical bus
- Serial debug port set to 38400 8N1
Is main aim is to display widgets, little flash movies (.swf) that can do a lot of cool stuff but will mainly consume data from internet and display it in a very presentable way.
One of the tests that I made with this little guy was to display my Slug’s webcam stream in a widget. Wow, I’m in heaven! I have used this flash webcam template, just required to change webcam url or IP, publish .swf and upload new widget to Chumby website using my friends account! Then is just a matter of adding the widget to a specific channel and refresh Chumby’s channels. The widget will be automatically downloaded and available to be played! Here are some images:
Running Flickr Widget …
Using the widget directly from network I was able to get pictures at frame rate of 3fps using 320×240 resolution . Well, I’m not achieving the full 15fps but remember that I’m also not getting Motion-JPEG stream has I was previously in Firefox webbrowser. I’m requesting JPEG image individually and if I select the snapshot option, using Firefox, I will get the same 3fps. Motion-JPEG is not supported by flash, unfortunately! (please read errata)
Well, it worked just fine and I’m quite impressed! My next step will be to test the slug’s webcam streaming from internet:
Errata: [07-08-2008]
I was able to make some more tests to determine streaming low speed and found that I had some hardware problem in my network that was limiting my experience! I can now get full 320×240@15fps from firefox (requesting individual JPEG images or video stream MJPEG)! I have also made a small C++ application that request JPEG images to the slug webcam and I can also get 320×240@15fps. Unfortunately with the flash wigdet I was only able to test it from a PC (no chumby available) wich only achieved 320×240@6fps.