This page describes how to create the appropriate operating system environment on the router to use the software available for download from this site. First, it is assumed that the router was ordered with a version of DD-WRT already installed. While it is certainly possible to install DD-WRT on an off-the-shelf E4200, FlashRouters.com does this for you at a modest price and will support the product if anything goes wrong. The Flash Routers support department is very proactive.
It is also assumed that you are fairly comfortable working with routers and have an understanding of Linux and networking. It is also assumed that you realize that this prototype is exactly that — a prototype. A certain amount of trial and error must be presumed. As the MediaHub project matures, these assumptions will be less and less problematic.
As a caveat, the DD-WRT software is fairly fluid. Configuration web pages and settings often do not precisely match the tutorials and instructions on the DD-WRT wiki or forum. It is often the case that dire warnings and other issues discussed on the DD-WRT site do not apply to more modern routers and are out of date. This site will attempt to note these circumstances wherever possible. An excellent reference is the tutorials page on the DD-WRT wiki. Information regarding all of the discussions below can be found in the tutorials.
Upgrade the Router FirmwareThe usual release supplied by FlashRouters.com has reasonable functionality for most home wireless router use cases. To enable the USB hard drive, DLNA, and other features for the Open MediaHub, the 'King Kong' version of DD-WRT is recommended. Once this firmware is installed, it is relatively easy to enable other functions and use the router as a true experimental test bed.
Once you have turned on the router, you can connect to the web site and open up the administration page. By default, the site will be at http://192.168.1.1 with user name 'flashrouter' and password 'ddwrt'. All of this can be changed, of course, through the configuration web site.
Navigate to the Software Upgrade page (http://192.168.1.1/Upgrade.asp) and click the “Choose File” button. Select the recommended firmware supplied on the Open MediaHub software download page. Once the file has been successfully selected, click the “Upgrade” button at the bottom of the page.
Don't do anything, aka power off, reset, etc., to the router while the upgrade is in progress.
After a few minutes, you should be able to open the router control site (http://192.168.1.1) again. If it doesn't come back immediately, wait a few minutes and try again.
Rebooting the RouterIn many of the sections below, a router reboot is the only way to make sure everything is configured correctly. To reboot the router, click the “Administration” tab on the router control site and then the “Management” sub tab. Scroll to the bottom of the page to find the “Reboot Router” button. The router can also be rebooted directly from a shell console (See the SSH section below) by issuing the command “reboot”.
"Save" vs. "Apply Settings"On the control web site, almost every page that allows data entry has a “Save”, an “Apply Settings” and a “Cancel” button. It should be noted that the “Save” button supposedly saves the settings but does not apply them while the “Apply Settings” button should both save and apply the settings from the page. On some pages, this behavior does not seem to work for some fields. Generally, clicking “Save” then “Apply Settings” makes sure all of the entries are saved and applied to the router. Most of the web sites and tutorials always recommend clicking “Save” and “Apply Settings” just to make sure everything works. On this page, when it says “Save and Apply” it means click the “Save” button followed by the “Apply Settings” button.
Install the NetDock Hard DriveIt is assumed that you have already partitioned and formatted the hard drive in the NetDock per the disk setup instructions.
Connect the square USB host adapter to the “To PC” port on the NetDock and connect the other end to the USB port on the E4200. The NetDock light should come on and you should hear the drive spin up.
On the router web site, navigate to the “Services” tab and then the “USB” sub tab. The table below indicates how to fill in the form:
Then click the “Save and Apply” buttons. The router will enable the drivers for USB and will mount the hard drive. Wait a few seconds and then refresh the page. The hard drive information should show up in the panel on the lower part of the page labeled “Disk Info”. If this doesn't happen it may be necessary to reboot the router for all the drivers to load and for the disk to auto-mount. The oddities in this behavior seem to be from timing related to driver loading and whatnot. Rebooting the router does everything in the correct order.
Once the disk info is available, the partitions will be shown. Find the UUID for the partition 3 and copy it to the field labeled: “Mount this Partition to /mnt” (second field down). Similarly, place the UUID from partition 1 in the field labeled “Mount this Partition to /opt” (fourth field). When copying the UUIDs, make sure not to include any spurious characters or spaces at the beginning or end. After both UUIDs are defined, click the “Save and Apply” buttons. The partition mount points will be displayed at the bottom of the “Disk Info” section once the page is refreshed. If the partitions don't appear to be mounted correctly or the information doesn't show up in a few minutes, reboot the router and check this page again.
Opening a shell using SSHDD-WRT is a Linux operating system so has the typical Linux shells and interfaces available. To enable remote shell login, the SSH functionality needs to be enabled. Click on the “Services” tab on the control web site and then the “Services” sub tab. Scroll to the “Secure Shell” section and enable “SSHd” and “Password Login”. Then click the “Save and Apply” buttons.
You can open a ssh connection to the router now using the “root” user name. From Linux, use “ssh root@192.168.1.1”. The password is “ddwrt”. Note that you will be logged in as root so can do virtually anything to the router software. Care must be exercised. There is a way to add additional users but this is rather more convoluted than a typical Linux distro. It may be better to simply exercise caution while ssh'ed into the router. Also note that only machines connected to the router LAN can connect via ssh. It is possible to allow ssh login from the WAN interface but this is not advised if the router is connected to the Internet.
Install OptwareWith this version of DD-WRT, it is possible to install Optware packages from NSLU2-Linux project. This port of Optware is tailored for DD-WRT and extends the router to full feature Linux if enough storage is provided for packages. The main feature of this package is that it installs all required files under /opt with 1000 ported applications including many useful packages that can be used to experiment with Open MediaHub functions and features. The package is necessary to support Squid which is used as the transparent proxy for Open MediaHub.
First, review the tutorial on installing "Optware, the Right Way". The information below was taken directly from that tutorial for convenience. Another tutorial for Optware is also available if more information is desired. The Optware tutorial references the “Right Way” tutorial.
ssh into the router and verify that the /opt and /mnt partitions are correct:
root@openMediaHub:~# df -h Filesystem Size Used Avail Use% Mounted on rootfs 8.9M 8.9M 0 100% / /dev/root 8.9M 8.9M 0 100% / /dev/scsi/host0/bus0/target0/lun0/part1 1008M 273M 685M 29% /opt /dev/sda3 916G 25G 845G 3% /mnt Note that /opt and /mnt correspond to roughly the 1G and 900G sizes assigned to them (this example was performed on an already initialized hub with media already installed).
If the partitions are mounted correctly, execute the following commands (output is not show):
root@openMediaHub:~# wget -O /tmp/prep_optware http://ddwrt.basmaf.com/prep_optware root@openMediaHub:~# sh /tmp/prep_optware NOTE: More details can be found in the forum on this topic.
This will load all the necessary Optware and supporting scripts.
This will take about 10-20 mins. depending on your connection. Close the Web control interface if it is open as this consumes precious memory and CPU resources.
Once everything has completed, wait…. you will be returned to a root prompt. Wait a minimum of 1 minute more, then type “reboot” into either the ssh shell (why not? you're right there) or reboot via Web Interface.
Important: After rebooting, wait again at least another minute before logging back into the SSH session!
Other Services: Samba and miniDLNAThe Kong version of DD-WRT comes pre-built with a DLNA server, miniDLNA, and Samba which provides Windows directory sharing. These can be enabled from the router control web site.
miniDLNAThe Digital Living Network Alliance (DLNA) is a non-profit collaborative trade organization established by Sony in June 2003, that is responsible for defining interoperability guidelines to enable sharing of digital media between multimedia devices. These guidelines are built upon existing public standards, but the guidelines themselves are private (available for a fee). These guidelines specify a set of restricted ways of using the standards to achieve interoperability.
DLNA uses Universal Plug and Play (UPnP) for media management, discovery and control. UPnP defines the type of device that DLNA supports (“server”, “renderer”, “controller”) and the mechanisms for accessing media over a network. The DLNA guidelines then apply a layer of restrictions over the types of media file format, encodings and resolutions that a device must support.
First, it is useful to create directories where the miniDLNA content will reside. The large amount of storage available on partition 3 (/mnt) is an obvious location. To create the necessary directories, ssh into the router and perform the following commands:
root@openMediaHub:~# cd /mnt root@openMediaHub:~# mkdir minidlna root@openMediaHub:~# mkdir minidlna/Pictures root@openMediaHub:~# mkdir minidlna/Videos root@openMediaHub:~# mkdir minidlna/Music root@openMediaHub:~# chmod -r 777 minidlna The miniDLNA configuration for DD-WRT can be found on the router control web site by clicking the “Services” tab followed by the “NAS” sub tab. The DLNA Server section controls the miniDLNA server. Click the enable radio button to show the configuration fields for the service. In the “Server Identification” field, enter the name of the service as it will be displayed on the various devices supporting DLNA. An example name would be “Open MediaHub”. In the “Pictures”, “Videos”, and “Music” fields, enter the paths as defined above, respectively. For example, for “Pictures” enter ”
/mnt/minidlna/Pictures ”. The “Update Interval” defines how often the DLNA server will update its content directories. In other words, the server exposes a directory of content to the potential clients. When content is added to the underlying file system, the server must check the file system for changes and reflect those changes in the directory. The interval defines how often that happens in seconds. The “DB Path” value indicates where the miniDLNA server will maintain its database of information. The /mnt/minidlna directory is a reasonable choice.Click the “Save and Apply” buttons to enable the service with the configured parameters.
SambaSamba is used to make directories within Linux available as Windows “Shares”. The configuration for Samba can be done entirely from the router control site though it may be necessary to change directory permissions depending on whether you want clients to have write access or not.
The Samba configuration page is on the router web set under the “Services” tab and the “NAS” sub-tab. Scroll until the section on “File Sharing”. Click the “Enable” radio button to turn on the Samba server.
To configure the server, define the “Server String” with the name that will appear when you search for Windows shares under your network. Add a “Workgroup” if you want the server to be associated with other machines in a particular work group. Next, click the “Add Share” button to add a shared directory. The pull-down under “Path” shows the partitions that are available for sharing. Add a name as it you wish it to appear on the network under the server name. The “Public” check box indicates whether the share should be visible or not when all shares for the server are shown. The “Access” column indicates whether the share should be writable or read only.
The “Users” configuration allows users to be created and associated with shares. If multiple shares are defined, there will be multiple check boxes under the “Access Shares” column for each user. The users are not Windows domain users but are only associated with the router itself.
Click the “Save and Apply” buttons to save the file sharing configuration once completed.
|
Router Prototype >