Monday, June 23, 2008

Pork Loin, Served by Proxy

If anything could peg the Meter-o-Machismo and firmly cement myself in the top Alpha Geek ranks, this would be it...

I want to internet enable my bar-b-que.

The backstory, like all of my stories, is fairly long and complex so we'll suffice it to say that I have wanted to undertake a project such as this for quite some time. After my most recent technical project (the storage server, covered earlier in the blog), I find myself still "jonesing" to do some hybrid creative/technical work. And since my Traeger (best. food. ever.) needs torn apart to fix the auger, I figured it would be a good time to muck about in its electronic innards.

My initial requirements:
  • After all modifications it must still function as a smoker/bbq.
  • The BBQ will interface with my network via a wireless signal (802.11 b/g).
  • The user should be able to set a temperature (in degrees Fahrenheit) via the control panel.
  • The temperature control may also be set securely via the network.
  • BBQ will monitor one or two temperature probes (one for BBQ temp, one for food temp) and attempt to maintain the set temperature.
  • Statistics (temperature settings, temperature measurement history) will be available via the network (and potentially the internet)
  • [Optional] Cooking "profiles" (ideal temperature curves over time) may be loaded and run.
Here are some of the components I'm looking at using (not necessarily any or all of them will make the final "cut"):
Processor:
Right now I'm torn between the Arduino or the Propeller. Both have their pros & cons.

Wireless Interface: the Matchport Pro b/g wireless embedded device server -- this thing is pretty cool. It's basically a secure web-server combined with a wireless radio chipset. I should be able to interface to this with whatever processor I choose.

I had been looking at just using a Gumstix system with a wi-fi add-on card, but putting together a system that would do what I wanted seemed to be a bit on the spendy side.

I obviously have a lot more thinking and planning to do, but if I do end up going ahead with this project I will of course let everyone know how it went.

Wednesday, June 18, 2008

WTF, doesn't Solaris speak Linux? (The NAS Project, part 3)

[covering software installation, configuration, troubleshooting]

When we last left our hero, he had just successfully powered on his newly assembled NAS and was rejoicing. The emotion was short lived.
Prior to ordering everything, I did some searches against the solaris hardware compatibility list and didn't really turn up anything untoward.
I still had some issues, however. By far, the biggest stumbling blocks for me were getting the network adaptors functioning and having the operating system recognize my sata drives.

But I'm getting ahead of myself. The first step was to actually install the OS. I had downloaded the opensolaris 2005.08 iso and burned it to disc. It's a live-cd, so I was able to boot into it, and then run the install. Unfortunately, I must have had some corruptions in the download or the burn, because the install didn't work correctly. I tried again, and this time the download was good (verified the hash check, which I should have done originally - shame on me). But the burn didn't work -- great, another coaster. The third time was the charm, though.
Opensolaris was installed and booting.

Then it freaked out. It would start, but as soon as the bios would post the video would go out. Or the video would go out when I logged into the gui. Or it would start, then the video would go out when the screensaver kicked in, and never come back.

After much hair pulling & a helpful suggestion from the LogicSupply tech support, I tracked the problem down to the memory being in a bad spot. I moved the RAM chip to the other slot, ran a memory test from a bootable disc (http://www.memtest.org/) which showed 100% error free, and everything worked great after that.

The next problem I tackled was getting it to see my network... "N" is the first part of NAS, after all. The network adaptors on my motherboard are Broadcom BCM5787M (vendor id: 14e4, device id: 1693), and not supported natively in opensolaris yet.
After much searching & forum reading and attempting various & sundry things, I stumbled across this thread:
http://opensolaris.org/jive/thread.jspa?messageID=195224
It was during all of this trial and error that I came to realize networking and the various commands in opensolaris were different enough from linux to cause me a decent amount of confusion.

Anyhow, I ended up downloading & installing the archived drivers, and afterward my system says the broadcom devices were "up" -- I just wasn't getting an IP.
Finally, after a week and a half of tweaking & reading through the various forums, I've managed to get everything working & have it persist through restarts.
It still grumbles about configuration errors & forcing things into maintenance mode when I boot but things seem to be working fine.

NOTE: Don't bother with the network gui. Don't even go into it.
NOTE: In opensolaris, your network adaptors are named for their drivers. Since I was using the broadcom driver, my two adaptors are bcme0 and bcme1.
NOTE: hostnames and IP's have been changed to protect the innocent :)
NOTE: the stuff below is mostly from memory. I'll try to double-check it before I post but may not get to it. UPDATE: Double checked, and I think this is complete.

First, I disabled the NWAM service (network auto magic? -- it didn't work, either):
# svcadm disable /network/physical:nwam

I enabled the normal network service:
# svcadm enable /network/physical:default

[EDIT] I forgot to mention the magic bean... the thing that makes all of our networking stuff gel. This is specific to the hardware/drivers, so isn't totally necessary for anyone else not using the bcme.
# svccfg -s network/physical:default setenv DLPI_DEVONLY 1
# svcadm refresh network/physical:default
# svccfg -s network/physical:nwam setenv DLPI_DEVONLY 1
# svcadm refresh network/physical:nwam
# reboot


http://www.opensolaris.org/jive/thread.jspa?threadID=61541&tstart=50

Without doing this, you can have an IP address & snoop the network traffic, but not be able to ping/respond or do anything else.

I put my router's IP in the /etc/defaultrouter file:
# cat /etc/defaultrouter
192.168.0.1

I edited my etc/hosts to add a static IP for the adaptor/box:
# cat /ets/hosts
127.0.0.1 localhost
192.168.0.10 supernas

I added my DNS entries to /etc/resolv.conf (one for my router's IP which should do DNS lookups, as well as one for OpenDNS):
# cat /etc/resolv.conf
nameserver 192.168.0.1
nameserver 208.67.222.222

I edited copied /etc/nsswitch.dns over to /etc/nsswitch.conf and then edited the .conf file so the hosts line read:
# cat /etc/nsswitch.conf | grep hosts
hosts: files dns

I added a default route to my router:
# route -p add default gateway 192.168.0.1 1

I edited /etc/netmasks (for various complicated reasons, I have a couple different subnets at home. Most people will use the default 255.255.255.0):
# cat /etc/netmasks
192.168.0.0 255.255.254.0

I put my system's hostname & some configuration commands in the /etc/hostname.[interface] file:
# cat /etc/hostname.bcme0
supernas netmask + broadcast + up

And that seemed to do it!

The next big problem I had was the fact that opensolaris couldn't see the really cool hot-swap sata drives, no matter how much tweaking I did.
You can find some of my problems in this thread I started (the thread got away from me, but the first few posts are still valid): http://opensolaris.org/jive/thread.jspa?threadID=62493

With the backplane in place & the drives socketed in their bays, opensolaris never recognized them as being anything other than "empty" no matter what bios setting I used (AHCI, legacy, etc.) If I directly connected them to the mobo it recognized them just fine, however. Drat -- I had really wanted to have the hot-swap capability.
Oh well, maybe the chenbro chipset will be supported in a later release of opensolaris.
I decided to just directly connect the drives to the motherboard and removed the backplanes (after some case dissasembly). BTW -- if anyone is developing drivers for this backplane, I'd be willing to temporarily donate one of the backplane boards to the cause, assuming I could get it back once they're supported :)
I then test fit the drive caddys in to see how the cables would fit through the new holes. Nope... had to notch the little metal plate that held the backplanes.
Once that was done, everything fits nicely and opensolaris saw the drives just fine.
I checked the "location" of the new drives:
# cfgadm | grep sata
App_Id Type Receptacle Occupant Condition
sata0/0::dsk/c6t0d0 disk connected configured ok
sata0/1::dsk/c6t1d0 disk connected configured ok
sata0/2::dsk/c6t2d0 disk connected configured ok
sata0/3::dsk/c6t3d0 disk connected configured ok

(or something similar - that's not the exact output)

From that point, creating my 2+ terabyte storage pool was a matter of:
# zpool create tank raidz c6t0d0 c6t1d0 c6t2d0 c6t3d0

Then I downloaded and installed the SMB server, and created a zfs filesystem for sharing stuff (which is covered in several places online, so I won't go into it here).

And the story comes to it's conclusion... I have a 2TB RAID storage server sitting on my network, keeping our photos safe and happily giving movies/media to TVersity (on my primary computer) to serve to my PS3.

Next steps:
  • Before anyone mentions that my stuff still isn't 100% safe -- I'm in the process of figuring out off-site storage for the photos. I may write something (or find something someone else has written) to synchronize my photo filesystem with flickr.com.

  • Obtain another 2.5" hard drive and add it to the operating systems zpool as a mirror (I'll probably have to unplug the optical for this).

  • Get a low-cost managed switch and set my two gigabit network adaptors up with link aggregation.


[edited because I accidentally labeled this "Part 2" instead of "Part 3"; I also forgot a couple commands in the configuration part]

Tuesday, June 17, 2008

Building the *!#&@ thing (The NAS Project, part 2)

[covering assembly]

It was a bit like Christmas -- I got some UPS lovin' and had a great time unboxing all the components I received.


First and foremost let me describe the Chenbro case I ordered -- and I HIGHLY recommend you read the LogicSupply review on it.
They have some essential notes on building with it, as well as some cool pictures:
http://www.logicsupply.com/blog/2008/03/27/the-chenbro-es34069-case-review-part-1/




The Chenbro ES34069 is pretty cool -- it has a fairly small form factor (10"x10"x5" or so), fits a mini-itx mobo, a 2.5" system drive, 4x hot-swappable 3.5" drives, and a slimline optical drive.
The motherboard I went with, the KINO-690S1 supports 4xSATA 2, IDE, 2GB RAM, and a 64-bit AMD processor.

As noted in the LogicSupply blog, the fan that comes with the case was designed for the motherboard I originally wanted -- which won't fit my KINO mobo.
Luckily, I ordered the heatsink/fan combo from them that does fit.

I'll describe how *I* built this thing, and then note how it *should* have been built.
  • Take everything out of the boxes.
  • Take side panel off case.
  • Take front off case.
  • *NOTE: there are 5 little plastic tabs holding the front on. 3 of which you can reach by taking the side panel off, but to get the last two you need to pull the drive caddys out and reach your finger in. Hope you have small bendy fingers :)
  • Test fit mobo in case
  • Snap back connection template panel in case.
  • Screw mobo in.
  • Realize the heatsink needs to screw in to something. Oh, there it is... and it goes under the mobo. Sigh.
  • Unscrew mobo.
  • Put heatsink socket thingy in place.
  • Screw mobo in.
  • Assemble heatsink to CPU w/ silver paste.
  • Screw cpu/heatsink/fan assembly to mobo.
  • Attach 40-44 pin adaptor to 2.5" laptop drive.
  • Realize there's only a single molex available to power both the 2.5" drive & the slimline optical.
  • Do some creative re-wiring (molex Y-adaptor would have been nice, but I didnt' have one on hand at this point).
  • Wonder where the system drive goes... (look up some pics online). Oh. Dang.
  • Realize I can't get the 2.5" drive in place.
  • Unscrew mobo (unnessesary if I had found the LogicSupply blog entry prior to this & realized I could pull the mobo tray out).
  • Place system drive & screw in.
  • Screw mobo in.
  • Prep slimline optical drive - screw the adaptor into the back, screw assembly into removable drive tray.
  • Realize the flat IDE cable I was using wouldn't reach with where I had the 2.5" drive pointing.
  • Unscrew mobo.
  • Remove 2.5" drive & rotate 180-degrees (so back of drive is under cd drive).
  • Screw mobo in.
  • Damn, forgot to screw drive in.
  • Unscrew mobo.
  • Screw 2.5" drive in
  • Screw mobo back in.
  • Shoehorn the IDE cable in place.
  • Put RAM in.
  • Hook power cable from case to mobo.
  • Hook CPU fan power up.
  • Move CPU fan power after noticing that CPU fan power connector was in a different spot.
  • Hook up switch & LED wires from case to the header on the mobo.
  • Realize that the Power LED header is 3 pin (live, center null, live), and the wire is 2 pin.
  • Do some creative re-wiring using a jumper block I had on hand.
  • Test fire for POST, etc.

IT BOOTED! WOOT!

After the fact:
I replaced the flat IDE cable with a round cable I ordered. I had to cut the little rubber boots off the round one to get it to fit, but it works much better than before.
Also as you'll read in part 3, I had to remove the hot-swap sata backplane... which would have been much easier if I had done so before installing anything in the case.

So assuming you'll be running Opensolaris like me, here is how I would recommend putting this together:
  • Completely disassemble case:
  • Remove the side panel (there's a thumb-screw in the back).
  • Pull the four drive caddys.
  • Remove the front panel (don't force it - remember there are 5 plastic tabs).
  • Remove the mobo tray (unroute the cables).
  • Remove the metal perforated backplane panel.
  • Remove the two backplane boards from backplane panel -- they're not compatible with opensolaris. Bye bye hot-swap :(
  • Mark & cut notches in panel for sata data/power plugs.
  • Re-install modified backplane panel.
  • Snap the back connection/port template panel (comes with the mobo) into the case.
  • Screw the 3.5" drives into their caddys.
  • Slot the 3.5" drives/caddys into the case.
  • If you notched the backplane panel like I did, you'll want to:
  • Cut the zip-ties that hold the cable bundle together.
  • Replace the data cables that go to the top two drives with the ones that have right-angle connectors on one end.
  • Plug the various sata/power cables in (you'll need the molex to dual sata power adaptors).
  • Re-zip-tie cable bundle if desired.
  • NOTE: Both the 2.5" drive location and the optical caddy have little metal pointy bits that are supposed to take the place of the screws (occupying the holes) on one side.
  • NOTE: You will need to jumper one of the drives to be the slave. I couldn't find the right jumper on the optical, so I set the 2.5" drive to slave instead.
  • Screw 2.5" drive in place (with its adaptor) -- remember, back of drive is located under optical tray area.
  • Assemble the slimline optical drive: adaptor screws back of drive, drive screws into removable tray.
  • Prep the round IDE cable (cut off the boots) & plug in to the system & optical drives.
  • Build yourself a 3-pin plug for the power LED. I glued a jumper oriented 90-degrees to one side of the 2-pin led cable end, and ran a wire from the center to the side.
  • Put the heatsink/fan socket thingy on the bottom of the mobo.
  • Screw the mobo on to the mobo tray.
  • Route the cables back through the mobo tray.
  • Screw the 3.5" storage drives into their caddys (remove the black plastic placeholder)
  • Slot the drive assemblies into their locations
  • Plug the SATA power & data cables into the drives
  • Screw the mobo tray back in to the case.
  • Assemble the CPU/heatsink/fan & screw on to mobo.
  • Add RAM to mobo.
  • Connect the rest of your cables (good luck w/ the USB headers for the front of the case... I didn't end up getting them working correctly.).

You'll find some pictures I took during the assembly process out on flickr.com
http://www.flickr.com/photos/benjaminellison/sets/72157605600122163/

That should be it. Stay tuned for part 3, or "WTF, doesn't Solaris speak Linux?"
[edited to add some pics & a few assembly points I had forgotten]

Monday, June 16, 2008

The NAS Project, part 1

[covering the background, requirements, ordering]

At various points in the past, both myself and friends of mine have lost their hard-drives (and all associated data). It's catastrophic, and it sucks.
I realized that since most of our pictures are now digital it would suck even worse to lose them all. So I decided that I really should invest in a backup solution.
But I wanted something more robust than one of those external usb drives. Enter: The NAS Project.

Several months ago I was doing some research and ran across the zetabyte file system, or ZFS. Holy moly! This looked like the coolest thing since the inclined plane, sliced bread, and Tivo.
Good introductory information on ZFS can be found here:
http://www.opensolaris.org/os/community/zfs/whatis/
http://www.opensolaris.org/os/community/zfs/docs/zfs_last.pdf (PDF link)

But to put it briefly, ZFS is a filesystem (filesystem: how your data is organized, written to, and retrieved from your storage media (hard drives)).
It has many, many nice features to make protecting and working with your data very easy. I would highly recommend reading the links above.


So I made up my mind -- whatever I was going to run, it would be based around ZFS. So with a bit more research, here are the requirements I developed for my NAS:
  • It had to be small (my current workstation at home is HUGE). I wanted something that could be mounted under my desk or put on a bookshelf.
  • It had to be able to support low power consumption.
  • It would run ZFS. Recommended "requirements" to run ZFS:
  • - It had to have a decent speed processor, preferably 64-bit
  • - It had to have at least 2GB RAM
  • The rest of the hardware needed to be Solaris/Opensolaris compatible
  • Support at a bare minimum 3 storage drives (for a RAID solution) and a separate operating system drive

Hindsight Note: By far my biggest limiting factor was my first (size) requirement. I could have built this thing MUCH cheaper and more quickly if I put it in a big tower case.

Because of the size constraint I decided to base this on the mini-itx form factor. As far as I know the smaller boards (nano, pico) don't support anything but the via processors yet,
and I was looking for a relatively beefy cpu. I found what I thought would be the perfect motherboard, the KI690-AM2...
http://www.albatron.com.tw/english/product/mb/pro_detail.asp?rlink=Overview&no=239
...but had a very difficult time locating a retail supplier. I was in negotiations with a hardware source, but after many email exchanges him/his company disappeared (thank goodness I hadn't ordered from him!).

Meanwhile I was also looking for cases. By far the coolest looking case in my opinion was the Chenbro ES34069 case, however I was having a difficult time finding anyone stateside that sold it.
http://www.chenbro.com/corporatesite/products_detail.php?serno=100

BUT -- at some point in time, everything seemed to come together (I found a new/different motherboard, and a stateside supplier for the case). All the bits and pieces I (thought I) needed became available and I ordered the components for my NAS.

Hardware list, for those interested...
(from newegg):
  • OCZ 2GB 200-Pin DDR2 SO-DIMM DDR2 667 (PC2 5400) Laptop Memory
  • SAMSUNG Spinpoint M Series HM080GC 80GB 5400 RPM ATA-6 Notebook Hard Drive
  • KINAMAX ADP-IDE23 Laptop 2.5" to Desktop 3.5" IDE Hard Drive Adapter Converter
  • 4 x SAMSUNG Spinpoint F1 HD753LJ 750GB 7200 RPM SATA 3.0Gb/s Hard Drives
(from Logic Supply):
  • IEI KINO-690S1 AMD Turion 64 Mini-ITX Mainboard
  • CoolerMaster EPN-41CSS-01 - Socket 479, Socket M, Socket P
  • Panasonic SR-8178-B Slimline Tray-loading CD/DVD-ROM
  • Slimline CD to 40 pin IDE adapter (NOTE: I ended up with two at some point... I think the case I ordered may have come with one).
  • Chenbro ES34069 Mini-ITX Home Server/NAS Chassis
(from CompuVest):
  • 2.0GHz AMD Turion 64 X2 Mobile TL-60 FSB 1600MHz 2x512KB S1

(from Circuit City)
  • ArcticSilver thermal paste

Additional things I forgot to order the first time around & ended up getting after the fact:
  • 2x Low profile SATA cables (one right angle connector, one straight connector)
  • 1x Long, round IDE cable
  • 1x Molex Y-adaptor
  • 2x Molex to double SATA adaptors

Stay tuned for part 2, "Building the *!#&@ thing"

[edited to fix layout issues]

Wednesday, June 11, 2008

The Face Game

I had a few (6 to 10) "happy" minutes with Hunter last night. By that I mean minutes where he wasn't fussy -- because even when he's grumpy and screaming I love him oodles. Besides, his little pouty bottom lip is SO CUTE.
But back to happy time. He was sitting on my lap, leaning back and we were playing at making faces at each other -- and I think he actually was recognizing the fact that I was mimicking his faces! woo hooo :) He'd stick his little tongue out, then I'd stick mine out. Then he'd smile, then I'd smile. Then his eyes would widen slightly, as if he just noticed something. Or he had to fart -- which is a possibility of extreme probability. That kid makes more gas than all the cattle in Sunnyside. I may have to get him a little onsie that says, "I depleted the ozone layer."
We purchased him some simethicone and some sensitive stomach formula (for his evening supplement) yesterday in hopes that he will be less gassy and therefore less fussy. Which would lead to longer naps. Which in turn would hopefully lead to getting things done. And getting things done makes C happy, as anyone who knows her would know. I also have Things That Need To Be Done. But I am an order of magnitude more lazy relaxed about things like that.

Wednesday, June 4, 2008

Mommy, make it stop!

I received a call from Carmen yesterday which started with a phrase that I am sure I will hear many, many times in the next several years: "Would you like to know what your son did?"
Being as how he is only 8 weeks old, there were only so many things running through my head at that point, primarily revolving around diaper incidents. Nope -- completely wrong. Evidently he reached up over his head, grabbed his hair, and started pulling. Of course he really wasn't cognizant of the fact that he was holding his own hair, so when it started hurting, he started screaming. But kept pulling. Poor little doofus :)

PS - I'm still working on getting some more pics uploaded. Be patient.