|Using a WRT54G v2 router running OpenWRT as a web page server off a USB stick for your AREDN node|
Had some trouble making a WRT54G v2 router host a USB stick. Oh, the hardware part isn't too hard to
do, as long as you have some ability to solder and unsolder SMT devices. Be careful when removing
the old resistors, else you might lose the solder pad. I found it better to just crush the old resistor
with a pair of small wirecutters, and then remove the soldered ends one at a time. If you do lose a pad,
try the 2nd USB pair, as described down bottom below. For the USB port I used an
old 5V USB cell phone or GPS charger circuit board. This board provides the 12VDC (from the
router's input power jack) to 5V conversion,
solder connection for the USB signal wires, and
makes a handy mounting, atop the ethernet ports, in the router's back (cut a hole in the cover in back for the USB jack).
The Broadcom chip BCM4712 USB ports are spec'ed as USB 2.0 and appear to operate as such.
Then you do the instructions at the OpenWRT web site.
Thing is, they assume some knowledge of linux and other software procedures. You need to install various packages
(see the handwritten list below right)
as per the above instruction web pages.
Check that your OpenWRT version of Backfire 10.03.1 is 22.214.171.124 (if not, go via an SSH program like SmarTTY into your router's console.
Once in, cut and paste the following lines:
wget http://downloads.openwrt.org/backfire/10.03.1/brcm47xx/openwrt-brcm47xx-squashfs.trx # The file must be the trx file.
mtd write /tmp/openwrt-brcm47xx-squashfs.trx linux && reboot
and then reboot and then check the version again. Assuming it is correct, then proceed). In the OpenWRT web page GUI, go to the "system" tab and then the "software" tab. Connect the router to the Internet and click the green box "update lists" and then look for and install the items in the above right handwritten list. Before, I ended fumbling around with this, the router would seem to realize that a USB thumb drive was inserted, but I couldn't find how to access the files on the thumb drive. Not sure what I did with the first router, but it started to let me see the files on the thumb drive. With the 2nd router, it seemed to take an iteration or two to get it working. You may, or may not, need to fill in the "mount points" section of the mount points page. That the router might find the USB stick without this, and maybe it needs it, try it either way to see what works for you (like in old style hacking). WIth the second WRT54G v2 I modified, I looked to see what items I added to the first WRT54G v2 (compared the list of the virgin router to the first router to identify them, hence the handwritten list), and installed these into the 2nd router, and had quicker success.
Below are the various packages I have installed (see the above handwritten list) on this router, along with preexisting ones:
If you did fill in the "mount points" section above, you could make the "mount point" be "/www/sda1",
"mount options" to "rw,sync",
(and be sure to check the "enabled" box) instead of the following:
To make the files on the USB stick available over your network, add this line to the local startup page:
ln -s /mnt/sda1 /www
To get there, you'd go to the OpenWRT configuration pages, at your OpenWRT router's IP address, log in, then go to the "system" tab, then under that, to the "startup" tab. Scroll down this page to find "Local Startup".
The USB stick's contents are redirected from the mount /mnt/sda1 into the /www/sda1 subdirectory. What this does is to allow someone accessing the router's web pages to access html files stored in the USB stick on the router, as this /mnt/sda1 directory is reflected to the sda1 directory in the /www directory of the router. Leave out the /www part when using your browser or creating an advertised service on your AREDN node.
For example: http://10.0.50.9/sda1/3d/3d.html
where "sda1" is this subdirectory (which is the root of the USB stick) in the /www directory of the OpenWRT router. The rest of the path is per usual.
Assuming you got one USB stick to work, you can easily add another.
The Broadcom chip has a 2nd set of USB pins, and these are what we will connect to here. The above picture lists the resistors to connect to, and which USB stick they go with, and which are data + and data -. On a router with only one USB port connected, I found that, at least the USB hub I tried, will work to allow a second stick if you don't want to do more soldering here. This 2nd USB stick will be sdb1.
and you'll need to add another line to the local startup page in the OpenWRT web GUI, like above.
ln -s /mnt/sdb1 /www