| Solid State webserver/AP |
Purpose |
Less filling... |
| Design |
Tastes great! |
|
[2008-06-02]
For many years boozhoundlabs.com was hosted on a dual Pentium server in my basement with loud fans, loud disks, and basically a whole lot of horsepower for something as relatively lightweight as serving a bunch of webpages. The treehugging hippie in me also felt like I was wasting a lot of electricity on this. I read that Google chooses hardware not based on size, speed, or capability, but on searches per Watt or something like that. So off I went on a search for the cheapest, lowest power hardware I could find that would host this site. I started by installing Centos on my old laptop, but the power supply is so intermittent that it wouldn't stay up for more than a few hours even with a new battery. So that was out. In the meantime, I got a second tivo and wanted to be able to move shows between it and my desktop PC and between tivos. Well, my Meraki mesh network doesn't allow connections between machines on the network without VPN. Just from hosts to the internet. Probably the right choice for security reasons and since that is what most people use it for, but it is a deal-breaker for me since I need for my tivos and Pc to talk to each other on the same broadcast domain. Meanwhile, Meraki changed their EULA so that it is "illegal" to modify the code that runs on their hardware. Frankly, fuck that. I unplugged my Meraki nodes and dug out the Netgear WGT634us that I had run the early versions of roofnet on. The WGT634u will happily run OpenWRT, which is the coolest software in the world. It is a barebones linux build designed for embedded devices and wireless networking. It seems to have almost everything you could want, and almost nothing you don't. I say almost because there was one thing I couldn't get working, but more on that later. I got mine refurbished from Justdeals.com, and they appear to still have them. Installing OpenWRT on a new Netgear would be easy, but I had one with the roofnet software on it, and couldn't get into it via ssh. Fortunately the Netgear has 4 little pins sticking out of it that are a serial port. You can buy or build a cable to use as a USB to serial/TTL adapter and talk to the router directly. This is key because you can get to it before it boots an OS. I used a mobile phone data cable from Radio Shack, and spliced it to a floppy drive power connector. This page tells you all you need to know, including the pinouts and color codes for popular phone cables. I had a hell of a time figuring out what driver to use for a home made serial cable, until I actually read the page instead of scroll-wheeling from picture to picture :) It turns out you use the driver for the chip that does the USB to TTL conversion - the Prolific TL-2303. Drivers here. Once you get a suitable device and can talk to it via ssh, web interface, or serial port, installing OpenWRT becomes fairly trivial. Everything you need is in the OpenWRT wiki.
Configuration is a breeze. Files are where you would expect them to be, and things are much easier to find because there isn't a ton of confusing stuff everywhere. For example, a ps listing is less than a page and you can pretty much tell what everything does. It is reassuring to have a pretty good grasp of what all is going on. Or at least more of a grasp than with a full blown distro. OpenWRT has a package manager called ipkg that makes installing and removing packages super easy. I'm not a build-from-source guy, so that is a good thing. Here is a list of packages as of June 2008 to give you an idea what you can do with OpenWRT. I installed lighttpd because the built in httpd server (part of busybox) doesn't do ssi, which boozhoundlabs needs. I also therefore installed the ssi lighttpd module. Bam - webserver works. But now I need more space to host my whole site. I followed this page to get the router to mount a usb flash drive to hold my web content. This would also work with an external usb hard drive enclosure, and would make a very cool fileserver, but I wanted something low power, super reliable, super quiet, and solid state. The only non-cookbook thing I had to do was to change the defualt boot order so that the usb drive mounts before the httpd server starts. I am leet. The one thing that I couldn't get working is mail. I used to run postfix to simply accept mail to my boozhoundlabs.com address and forward it to my gmail address, which is where I read my mail. The only package prebuilt for OpenWRT that appears to be able to do this is xmail, and it was very poorly documented and strange. Yes, that is just my opinion. I'm sure someone more familiar with it would be able to make it work. I ended up paying my domain registrar for a mail account and set that to forward to gmail. Probably a good thing. I have had power outages and lost mail and that sucks. Speaking of power outages and disaster recovery, I have tarred up the config files and have a spare router in case something happens. An easier solution would be to have the router boot from the usb and store the whole system there so that it can plug into any router for recovery. I might try that in the future.
I wanted to use some of the external antennas I had left over from a neighborhood mesh project so I replaced the stock card with a Wistron CM9 since it has antenna connectors. I have also had luck soldering pigtails directly to the stock cards, but it is tricky and the performance is hit or miss. These are refurbished units, and I may have some bad cards, so I can't say for sure that the soldering is the problem. I didn't mention that this is also my wireless access point. It seems work pretty well. I get a solid 14Mbps out of it. Not as fast as 802.11g can technically go, but not bad for the real world. And definitely faster than the stock Netgear firmware. It is fast enough to watch standard def tivo content stored on my PC without having to wait for it to buffer. Future developments: I would like to get a solar setup to make this whole thing off-grid, or at least off grid until it connects to the telco for DSL. I need to find a 12VDC DSL modem and a cheap solar panel and charge controller. I have a deep cycle battery I use for my Ham radio that I can use for storage. In fact, I might run that with a small charger as a sort of super simple UPS. There are also a couple efforts underway to come up with a mesh networking system/environment to take over where Meraki left us hanging. It sounds like it is almost there, and I plan to play with that on my Meraki hardware.
|