*scottstuff*

*scottstuff* *scottstuff* live search: sata staggered-spinup posted by scott laird tue, 23 oct 2007 00:06:37 gmt interesting trivia: staggered drive spin-up is an optional part of the sata ii spec. unlike most scsi drives, though, it’s not controlled through a jumper. instead, it uses one pin on the sata power connector. if pin 11 is floating, then the drive is supposed to wait to start spinning. apparently the 650w power supply in my new server only provides enough current to spin up 10 drives at once, because adding an 11th drive makes it turn off on its own immediately. sigh. i wonder if anyone makes delayed-spin sata power dongles? tags power, sata, server | 4 comments gigabyte gc-ramdisk / i-ram review(-ish) posted by scott laird mon, 22 oct 2007 21:39:47 gmt i mentioned that i bought a gigabyte gc-ramdisk (a.k.a. i-ram) to go in my new home file server, largely to see if using it as a solid-state log device would improve zfs performance. unfortunately, i’ve been completely and totally unable to get the card to do anything at all. i’m not sure if i have a defective card or if gigabyte’s sata implementation is just really buggy. when i plugged it into the motherboard’s ich9r sata ports, the bios didn’t even show it on the boot-up scan and solaris reported it as failing to initialize correctly. when i plugged it into the supermicro aoc-sat2-mv8 8-port sata card, the bios could see it but solaris gave a similar error. connecting it to the motherboard’s marvell esata ports made the marvell hang at bootup and made solaris really unhappy, spewing drive failure messages all over the console. i can’t find a single review that suggests that anyone has got this to work with a recent motherboard. digging through the linux kernel mailing list suggests that it has a really spotty sata implementation. apparently they developed it using a couple windows drivers as a comparison, instead of actually paying attention to the sata spec. so, it’s going back to amazon today. it was a nice idea, but it just doesn’t appear to work. i don’t know if it’s broken or just poorly designed, but either way it’s not useful to me. tags broken, gc, gigabyte, i, ram, ramdisk, ssd, zfs | 5 comments notes from installing opensolaris snv_74 posted by scott laird sun, 21 oct 2007 03:33:00 gmt i now have solaris up and running and reasonably stable-looking, after only 12 hours of work. a number of things turned out to be bigger issues than i’d anticipated, largely because it’s been years since i last used solaris and, frankly, solaris’s disk partitioning and formatting tools suck. my first problem is still unresolved: my bios refuses to boot from the ide dvd drive that i installed. once the system boots, it works just fine, so i’m not sure what’s up. maybe a bios bug. fortunately, the system’s perfectly happy booting off a usb dvd drive, and (amazingly) solaris is happy installing from it. the gc-ramdisk card that i was looking forward to testing is a complete failure so far. i don’t know if i have a bad card or if it’s simply incompatible with both sata chips in the system, but the bios completely ignores it if its plugged into the motherboard, and solaris fails to talk to it on either bus. if it’s plugged into the mb, then i get a device failed initialization error; if it’s plugged into the pci-x sata card then i get device on port 5 still busy after reset. i’ve swapped cables and ram. i’d really like to get it to work, so i’m going to try it with an older system before rmaing it. actually getting a working solaris install took me 3 tries. the first time i installed it to the wrong drive (the first disk on the pci-x card, not the first disk on the motherboard), and it was unable to mount the root partition after rebooting. next, i managed to install it onto an efi partition, and that wouldn’t boot either. finally, i installed it onto the second drive on the right bus, and that worked. since solaris’s installer doesn’t support zfs yet, i had to manually copy the root filesystem onto a newly created zfs filesystem mirrored across a pair of drives. the directions are helpful, but i kept screwing things up. first, i accidentally created the zfs pool using the entire disk, which made zfs re-label the drives with efi, which makes them unbootable. then, i missed the line in the directions that says to run format -e instead of using format; that left me with a pair of nicely partitioned drives that still used efi. the third try worked, and the system is now booting off of zfs via grub without problems. er… well, one problem–i can’t change the grub menu.lst file for some reason. i don’t know where grub is looking for it, but it’s not in /boot/grub/menu.lst on my boot array. my changes are being completely ignored. i can live with this for the weekend. opensolaris doesn’t ship with drivers for the asus p5k ws’s onboard ethernet chips. i had to grab them from marvell, but it was easy enough to install. creating an 8-drive zfs filesystem is trivial. one command takes care of raid, logical volume management, creates the filesystem, and mounts it: zpool create -f space raidz2 c0t1d0 c0t2d0 c0t3d0 c0t4d0 c3t2d0 c3t3d0 c3t4d0 c3t5d0. zfs performance is decent. here’s a bonnie with and without zfs compression, using 10 gb of data on a box with 2 gb of ram: -------sequential output-------- ---sequential input-- --random-- -per char- --block--- -rewrite-- -per char- --block--- --seeks--- machine gb m/sec %cpu m/sec %cpu m/sec %cpu m/sec %cpu m/sec %cpu /sec %cpu zfs 10 105.0 55.3 163.3 27.3 121.0 30.4 119.2 88.4 287.1 36.2 169 1.8 zfs+c 10 112.9 59.7 181.5 30.3 127.8 29.1 118.1 86.0 424.9 52.2 198 2.1 163 mb/sec writing and 287 mb/sec reading is good enough for me. i was expecting slightly higher numbers, but there’s nothing here to complain about. adding compression improves writing a bit and makes a big difference reading. it’s quite a bit faster then gige, which was my goal. tags gs, opensolaris, ramdisk, server, zfs | 3 comments a new server (part 1) posted by scott laird sat, 20 oct 2007 04:56:19 gmt a few days ago, i mentioned that my home nas box had failed, and that i was considering replacing it with a pc server running opensolaris and zfs. i’ve read a pile of zfs docs, and it looks like the best option available to me today, so i decided to order some suitable hardware. at that point, pretty much everything broke down. i have a hard enough time keeping track of which hardware works with linux this week, and opensolaris is completely new to me. sun’s list of officially-supported hardware is pretty sparse, and digging through their mailing list archives gets frustrating quickly. from what i can tell, it boils down to: current intel and amd cpus are all fine. most of intel’s chipsets are fine. most of nvidia’s amd chipsets are fine. nvidia and intel video chips are good. most common ethernet chipsets are either supported natively or have drivers available. the only sata controllers that work are intel’s ich southbridges, silicon image’s pci and pci-e chips, marvell’s pci chips, and nvidia’s southbridges. it’s not clear that marvell’s pci-e chips work. most motherboards with additional, non-southbridge sata ports probably won’t work. venturing too far outside of this list will probably result in problems. i was looking for a motherboard with 8 sata ports, and was hoping that the intel d975xbx2 (“bad axe 2”) would work, but 4 of its 8 sata ports belong to a marvell pci-e sata chip that doesn’t appear to be supported. i went through every single 8-port motherboard in newegg’s (the ‘ws’ is important–the p5k is a different board). it only has 6 on-board sata ports, but it includes a pci-x slot. that’ll let me use the supermicro aoc-sat2-mv8, which is far and away the cheapest 8-port sata card on the market. that’ll give me a total of 14 sata ports, which should be enough for a whatever i want to throw at it. the marvell pci-x chip at the heart of the supermicro card is the same one used in sun’s sun fire x4500 48-drive server, so it’s safe to assume that sun has put a lot of effort into the driver. most of the test of the system is fairly generic–a cheap nvidia 7200gs video card (the cheapest pci-e card that newegg carries), a nice case and power supply, ram, and a boatload of drives. the one odd component that i’ve added is a gigabyte gc-ramdisk with 1 gb of ram. the gc-ramdisk is a battery-backed sata ramdisk; it looks like a hard drive to the system and can survive up to 18 hours without power. i’ve had my eye on this thing for years, and it looks like it’ll be a perfect external log device for gfs. i had to ask to see how zfs will behave if the device fails, and it looks like manual intervention may be required after an 18+ hour power outage, but it should be pretty minimal. i’m planning on posting some benchmarks here once i’ve had a chance to try it out. assuming that i’m able to get this whole mess to work at all, i should have lots to write about here over the next week or so. i’m going to start by explaining why i want to use solaris instead of linux or *bsd, and why i’m building something instead of buying a pre-build nas box. tags home, opensolaris, raid, server, zfs | 3 comments why not linux (new server part 2) posted by scott laird fri, 19 oct 2007 23:28:44 gmt so, as part of my new home server series, i want to explain why i’m using opensolaris instead of linux. i’ve used linux since 0.97.1, in august of 1992. i’ve had at least one linux box at home continuously since 1993 or so. i’ve had a few small chunks of my code added to the kernel over the years. i’ve built several install disks and one embedded appliance distro from scratch, starting with a kernel and busybox and going on up from there. i’ve written x drivers, camera drivers, and drivers for embedded devices on the motherboard. i’ve managed great heaping big gobs of hardware at various jobs. basically, i know linux well, and i’ve used it for almost half of my life. that in itself might mean that it’s time for a change–professionally, i’ve been very tightly focused on linux, and diversity is a good thing. but that’s not why i’m using solaris this week. i’m using it because i’m fed up with losing data to weird raid issues with linux, and i believe that opensolaris with zfs will be substantially more reliable long-term. things i’m specifically fed up with: md (the linux raid driver)’s response to any sort of drive error, even a transient timeout, is to kick the drive from the array, no matter what. most of the ide drives that i’ve had over the years have been prone to random timeouts every few months, at least once you bundle more then 2 or 3 of them in a single box and then try snaking massive ribbon cable through the case. my sata experiences haven’t been substantially better. linux will happily bump an otherwise working 4-drive raid 5 array to a 3-drive degraded raid 5 array on the first failure, and then on to a 2-drive failed array on the second failure. even when a simple retry would have cleared both errors. this has cost me data repeatedly, because i’ve been forced to manually intervene and re-add “failed” disks to raid arrays. if i was too slow, then a second drive failure risked total data loss. even worse, these random transient failures blind you to real drive failures, like the one that ate my nas box last weekend. actual drive failures can hang the kernel. i’ve had at least 3 cases at home where broken drives either caused system lockups or completely kept the system from booting. that sucks. odds are some drivers are good while others are broken; apparently i’ve just had bad luck. none of linux’s filesystems are particularly resilient in the face of on-disk data corruption. compare with zfs, which checksums everything that it reads or writes. in short: everything works great when things are perfect, but building a reliable multi-drive storage system requires careful component and kernel compatibility work, and then you have to stay right on top of things if you want everything to keep working. when things stop working, they usually fail badly. that’s almost the complete antithesis of what i want for home: plug it in, and it just keeps working. i don’t want small failures to cascade through the system. little failures should isolated, identified, and automatically repaired whenever possible. opensolaris and zfs seems to provide that, while linux with md and ext3 does not. that’s why i’m planning on using zfs. my logic for building a server vs. buying another little nas box is simple: none of the little nas boxes on the market use zfs right now, and none of the cheap ones have room for more then 5 drives. i’m planning on using a double-parity system (raid 6 or zfs’s raidz2, where the system can cope with a 2-drive failure) plus a spare drive, and that’d only leave me with 2 data disks. the only way that i can get enough data with only 2 disks would be to use 1tb drives, and they’re too pricy right now. so, i’m willing to spend the time to build a somewhat complex server because i believe (hope?) that it’ll save me time in the future, and it’ll let me avoid ever having to do the reconstruct-from-the-source dance again. i don’t think i lost anything critical last weekend, and i’m reasonably confident that i’ll be able to get things limping along well enough to recover data anyway, but i’ve now done this 3 times in the past 4 years, and i’ve had it. coming up soon: backups, opensolaris hardware compatibility, and gc-ramdisk performance benchamarks. stay tuned :-). tags linux, opensolaris, raid, solaris, storage, zfs | no comments zfs and the holy grail of storage posted by scott laird tue, 16 oct 2007 11:40:48 gmt so, the comments on yesterday’s post about my nasty raid failure encouraged me to spend some time looking at zfs on opensolaris, and i really like what i see. i’ve ordered some new hardware, so i should have lots to write about by next weekend. reading the zfs docs reminded me of my holy grail of storage: a storage system that could actually do reasonably smart things with 3–5 drives. imagine a system where you could start with 3 drives and simply plug new drives in as you need more space, without worrying about raid or data layout. when you run out of slots, then just unplug the oldest, smallest drive and plug in a new, larger one, and the data will resync, giving you more disk space without needing any special work on your part. for bonus points, you’d be able to designate specific bits of your data as more or less important, so bittorrent files might not be replicated at all, while your word documents might be replicated onto every available drive. i’ve wanted that for years, but i’ve largely dismissed it as a pipe dream, because it doesn’t fit cleanly into the drive/raid/lvm/filesystem model that everything uses. the only thing that i’ve seen that even comes close is drobo, and it’s supposedly fairly slow and really just too “magic” for me to trust. i realized this morning that it’d be easy to build a storage system like this using zfs. just create a zpool with 3 drives to start, and then create zfs filesystems with copies=2 on top of it. when you add new drives, just add them to the pool. blindly removing a single old drive will only leave you with a single copy of some of your files, but that shouldn’t be fatal, and zfs can copy everything off of it if you give it a chance. there are some corner cases that will give you less redundancy–if you manage to fill the system 98% full before adding a new drive, then all of the replicas of new data will probably end up on the same disk. there are a couple obvious workarounds, and sun will probably add replication rebalancing at some point, if it isn’t there already. tags opensolaris, raid, storage, zfs | no comments what's worse then the sound of one hard drive going "click, click?" posted by scott laird sun, 14 oct 2007 12:47:00 gmt what’s worse then the sound of one hard drive going “click, click?” why, two drives going “click, click, click” in the same raid 5 array, of course. i’m not very happy with my little infrant nas box right now. i think i’ve had it with raid 5–if i’m going to pile my life onto a disk array, then i really want something that can survive a 2-drive failure without croaking, and that’s basically impossible in a 4-drive enclosure. i’m seriously considering replacing the infrant with an opensolaris box running zfs over raid-z2 with 6–10 drives; that should live through 2-drive failures, right? anyone feel the need to talk me out of it? tags broken, hardware | 9 comments halting state mini-review posted by scott laird tue, 02 oct 2007 07:33:15 gmt today’s the big release day for charlie stross’s new book, halting state. i had the good fortune to pick up a review copy through work last week, since we’re one of the official stops on his tour schedule (w00t!). short review: go buy it. you can thank me later. slightly longer review: stross is my favorite science fiction (-ish) author right now, and has been for a few years. he’s written a number of amazing short stories, but his novels have been a bit hit-or-miss. the atrocity archives is deeply awesome, as is accelerando (which is basically a collection of 9 of his short stories), but singularity sky didn’t really work for me. halting state, on the other hand, is the best science fiction novel that i’ve read in years; perhaps since the atrocity archives. like most of his work, halting state is less scifi then “geekfi”–it’s about people and technology extrapolated slightly into the future. in this case, it’s set in 2014-ish scotland, newly independent from england. it all started with a police call. the caller, panicked, reported a theft. something about a bank robbery, which made the police operator sit up and take notice, until the caller started blathering about orcs and a dragon. they didn’t send anyone out to investigate until the second call, which still had orcs and the dragon, but sounded more insistent. the detective follows the address provided and ends up in the middle of nowhere, at a former nuclear command bunker surrounded by expensive cars, to discover that someone did rob a bank. not a brick-and-mortar bank, though–this bank’s is inside of a mmorpg. the total take? about 120 million euros, once you count the ebay-able value of the missing goods and the hit to the newly-ipoed “in-game economic stabilization” company. the dragon blew the doors off of the bank and the orcs grabbed the loot. they escaped into a portal to another mmorpg where the bank’s managers don’t have root access. the cop’s stumped–how do you investigate this? you can’t dust for dragon prints. so she logs back into copspace to see what she can find… by the time stross is done, he’s wrapped up gaming, gamers, virtual reality, cryptographic security, in-game economics, the nanny state run amok, mobile phones, and something much more sinister then any of the characters expected to find. just go read it, and thank me afterwards. or thank stross, that’s probably more appropriate. tags books, stross | no comments canon 40d, 1ds mk iii, and a new 14/2.8? posted by scott laird sun, 19 aug 2007 05:53:00 gmt it looks like canon’s finally about to announce the long-rumored 40d and 1ds mk iii. they’ve been rumored forever, but they now have product pages at amazon, so they’re probably legitimate this time: canon 40d canon 1ds mk iii canon ef 14/2.8l ii the 40d looks fantastic–they increased the resolution slightly to 10 mp, which isn’t all that exciting, but they also raised the frame rate to 6.5 fps, bumped the buffer to 75 jpeg/17 raw images, added their anti-dust shaker, sraw, 14-bit dacs, weather shielding, and live view. they also completely re-did the af unit–it still uses the same 9-point format as the 30d, but all nine sensors are now cross-type sensors up to f/5.6; this should make a huge difference in af accuracy. they don’t appear to have improved the camera’s iso range; it’s still 100-1600 + 3200, but other then that they seem to have picked up almost every other improvement that the 1d mk iii added. i’m impressed; in the past canon left features out of their mid-range series to avoid competing with higher-end models, but that doesn’t seem to have happened this time. there’s also a new wireless module, the wft-e3a, but amazon doesn’t have any details yet. presumably it’s a very slight change from the 1d mk iii’s new wireless transmitter, hopefully at a lower price point. it doesn’t make a lot of sense to pay $999 for a wireless transmitter for a $1,299 camera. i could actually see myself picking up a 40d in addition to my 5d–it looks like a great camera for taking sports pictures, and the 1.6x multiplier would make my 100-400 lens a lot more useful for bird pics. the 1ds mk iii is a bit out of my price range at $7,999. it’s up to 21.1 mp now, at 5 fps. it looks like they added everything from the 1d mk iii, plus a new udma cf module, doubling write speeds with sandisk extreme iv and the equivalent lexar cards. amazon doesn’t mention iso sensitivity at all, so it’s not clear if they now support iso 6400 or not. finally, they updated their 14mm lens for better compatibility with the 1ds mk iii. yawn. all in all, this looks pretty good. way to go canon. tags canon, canon40d, photography | no comments lightweight home security with indigo and asterisk posted by scott laird wed, 15 aug 2007 16:16:00 gmt i mentioned last week that i’ve been working on building sort of a lightweight home security system for my house so my 4-year-old daughter won’t be able to sneak out of the house again. i spent about a day researching possible solutions, to see if there was something simple that i could buy that would make me happy, and i couldn’t find anything on the market that was cheap and would tell me which of my 6 exterior doors had been opened loudly enough to hear from across the house. there’s no point in putting a door buzzer on the basement door if you can’t hear it from the master bedroom. the only solutions that i found were from professional alarm companies, and they probably would have charged me a couple thousand for installation plus $30-$50 per month for monitoring. i’m just not willing to pay that much, and it’s not really what i was looking for–it’s gross overkill for my problem. so, i decided to build it myself. after a few hours’ searching, i decided to use perceptive automation’s indigo home-automation software for the mac. it’s commercial software, but i like its user interface and capabilities better then any of the open-source solutions that i’ve seen. it’s under active development, supports just about everything that i need, it’s client-server so i can access it from any mac i own, and it comes with a nice web interface that i can get to via my phone. i figured that it’d be cheaper to pay the money for indigo then to spend most of a week hacking away at one of the open-source packages to get them to do what i want. plus, er, pretty much every open source home automation program that i could find was written in perl, and i’ve been successfully avoiding perl for almost 5 years now. the last thing i really want to do is spend a week modifying someone else’s perl. that kind of thing gives me nightmares. so i fired indigo up on an old powerbook that i had laying around and bought a bunch of hardware from machomestore and smarthome.com. the important bits are a w800rf32a wireless reciever and a whole bunch of $12 ds10a door and window sensors. the sensors broadcast their state over the air, and the receiver feeds them into my mac. that took care of the input side of the equation, but i still needed some relatively cheap way to play audio around my house. i poked around for a while looking at random x10 hardware and radio solutions before i realized that most voip phones support audio paging. since my house is full of voip phones and i run my own asterisk server, all i’d really need to do was write a couple dozen lines of asterisk dialplan code, and everything should just work. i ended up ordering two new voip phones (grandstream gxp-2020s) because two of the phones that i have are too old to be usable for paging. i probably could have used $45 budgetones, but i have future plans for the gxp-2020’s big displays, so i decided to spend a bit more for them. it took me about 30 minutes to unpack everything, install indigo, and have it receiving data from a test sensor. each sensor assigns itself a random 8-bit id when it’s powered up, so the first problem was mapping semi-random sensor ids onto logical names. indigo comes with a blob of sample applescript for doing this, and it only took me 5 minutes to modify it so that one of indigo’s internal variables changed state to reflect the state of the door sensor–true when the door is closed and false when opened. five more minutes and i had a nifty web page with a green blob that turned red when the door opened. a half-hour after that, i had a png floorplan of my house that i could use as a backdrop for a bunch of little red/green blobs: after this, it’s all just a matter of plumbing. first, i modified indigo’s sensor-handling applescript example into something that knows how to talk to asterisk, using one of the asterisk/applescript integration examples on the voip-info.org wiki. here’s i ended up with: (* door sensor tracking code for indigo and asterisk. by scott laird <scott@sigkill.org> http://scottstuff.net this code handles incoming security events, maps each numeric device id onto a logical name, and then tells asterisk to page all voip phones with a device-specific message. net effect: opening the front door causes "front door opened" to echo throughout the house. i'm calling dodialout directly rather then using an indigo trigger for 4 reasons: 1. i have the extension name handy here, while i'd have to parse it back out of the variable name if i used triggers. 2. creating an identical trigger for each of 10+ sensors is a pain in the neck. 3. we need to do *something* with unknown sensor events, but creating variables for them is pretty clearly wrong. 4. my applescript is lousy, and i can't get triggers to call dodialout correctly. *) using terms from application "indigoserver" on receive security event of eventtype with code devid set extension to "unknown" -- map sensor ids onto logical names. in a real language, -- i'd use some sort of hash and skip the if ... else if ... code, -- but i don't see anything suitable in applescript. sigh. i'm -- stuck writing code in blub. if devid is 95 then set extension to "frontdoor" else if devid is 175 then set extension to "deckdoor" else if devid is 99 then set extension to "stairs" else if devid is 201 then set extension to "backyard" else if devid is 55 then set extension to "upgarage" else if devid is 155 then set extension to "downgarage" else if devid is 253 then set extension to "slider" end if -- if we get a request for an unknown devid, then send it on to asterisk -- so we get an audible indication that *something* happened. since batteries -- falling out of ds10 modules can cause the id to change, i'd rather not ignore -- these. ymmv, however. if extension is "unknown" then my dodialout(devid) else -- indigo variable names are derived from asterisk extension names. -- in retrospect, doorclosed_ is a great name for doors, but not so hot -- for doorbells or motion sensors. feel free to change this. set var to ("doorclosed_" & extension) set seen_var to ("lastseen_" & extension) set change_var to ("lastchanged_" & extension) set timestamp to (current date) as string -- figure out if it opened or closed. there are actually 4 different -- results that the sensors can return (normal/active x min/max), -- but we only care about normal/active. if eventtype is sec_sensornormal_min then set val to "true" else if eventtype is sec_sensornormal_max then set val to "true" else set val to "false" end if -- create the indigo variables if they don't already exist. if not (variable var exists) then make new variable with properties {name:var, value:val} end if if not (variable seen_var exists) then make new variable with properties {name:seen_var, value:timestamp} end if if not (variable change_var exists) then make new variable with properties {name:change_var, value:timestamp} end if -- did the value of this variable just change? if not (value of variable var is val) then set value of variable change_var to timestamp -- if it just changed and it's now false, then send an alert. -- the ds10a sensors send a signal once per hour, even if nothing's changed. -- so we don't want to alert *unless* something's changed. if val is "false" then my dodialout(extension) end if end if -- we need to keep track of the time that each ds10 was last seen. -- this way we can spot bad batteries. set value of variable seen_var to timestamp set value of variable var to val end if end receive security event -- dodialout tells asterisk to dial a specific extension using -- asterisk's management interface. this doesn't require that asterisk -- runs on the same machine as indigo. -- -- to get this to work in your environment, you'll need to change the ip -- address, username, and password, and possibly the contexts and/or -- extension names used at the bottom. on dodialout(extension) log "paging extension " & extension using type "dialer" set expectscript to "set timeout 20; spawn telnet 10.0.0.1 5038; expect \"asterisk call manager/1.0\"; send \"action: login username: my_username secret: secretsecret \"; expect \"message: authentication accepted\"; send \"action: originate exten: " & extension & " context: security-paging channel: local/all@paging priority: 1 callerid: security: " & extension & " <0> \"; sleep 1; send \"action: logoff \"; " set results to do shell script "/usr/bin/expect -c '" & expectscript & "'" end dodialout end using terms from in addition to simply monitoring the current state of the sensors, this also tracks their last change as well as the last time each sensor sent out a “nothing’s changed” report. eventually i’ll add monitoring for this so i can spot failing batteries immediately, and not two months later when i discover that two doors aren’t monitored anymore. indigo tracks each variable internally, and gives you a handy window for viewing and modifying them: once all of that was in place, it was time to add paging logic to asterisk. i created two new contexts, security-paging to contain the messages that need to be played back and paging to handle the phones. the applescript above basically glues the two ends together, sending ‘deckdoor@security-paging’ to ‘all@paging’. here’s the relevant bit of my asterisk config: [security-paging] exten => frontdoor,1,playback(security/frontdoor) exten => deckdoor,1,playback(security/deckdoor) exten => backyard,1,playback(security/backyard) exten => stairs,1,playback(security/stairs) exten => upgarage,1,playback(security/upgarage) exten => downgarage,1,playback(security/downgarage) exten => slider,1,playback(security/slider) exten => _.,1,saynumber(${exten}) [paging] exten => all,1,page(local/203@paging&local/204@paging&local/205@paging&local/206@paging) ; cisco 7940; no call-info support, but you can create a new line and turn on auto-answer on the phone. exten => 203,1,dial(sip/203aa) ; sipura 841. it needs a semicolon before answer-after. exten => 204,1,sipaddheader(call-info: \;answer-after=0) exten => 204,n,dial(sip/204) ; grandstream gxp-2020s, although the same config will work for most modern phones. exten => 205,1,sipaddheader(call-info: answer-after=0) exten => 205,n,dial(sip/205) exten => 206,1,sipaddheader(call-info: answer-after=0) exten => 206,n,dial(sip/206) then i just had to record some audio files to use for annoucements. the easiest way to do this is just to call yourself up and leave voicemail, and then copy the vm files over into asterisk’s sound file directory, usually /var/lib/asterisk/sounds. you could get better quality recordings with a good microphone and audio-processing app, but i’m not sure that there’s really a point, given the quality of most speakerphone speakers. all told, it took me about 8 hours of research to put this all together, and maybe 10 hours to implement it all, including learning a bit of applescript. now i have a programmable system for monitoring my house, and all of the pieces in place for adding x10 or insteon components as they make sense. it’s all under my control; if i can code it, then i can make it happen. so, does it all work? yep–monday morning it caught my daughter trying to sneak into the garage. mission accomplished. tags asterisk, home, indigo, insteon, security | 11 comments really, really dumb nokia e61 sip bug posted by scott laird tue, 07 aug 2007 16:45:00 gmt one of the things i really like about my nokia e61 is that it’s not just a cell phone, it’s also a voip phone. it includes a sip client that works with asterisk, mostly, so i’m able to get by with just one phone at home–incoming calls headed to either my cell number *or* my home number ring to the same phone. which is great. except it all stopped working when i upgraded to the latest e61 firmware a couple months ago. i re-created my sip settings, but the phone just wouldn’t register with asterisk. deleting and re-creating the settings didn’t make much of a difference, and eventually i decided to put off debugging it and wait until i had more time. so, this morning i spent about an hour and a half trying to fix the phone. i re-configured it using several different configs that i found on line, and none of them worked. they all just generated “registration failed” messages on the phone. so i turned on sip debugging in asterisk, but it wasn’t very helpful–it didn’t show the phone trying to register at all. so i fired up tcpdump and discovered that the phone wasn’t actually sending any sip requests at all–it was failing locally without ever talking to the network at all. so i did a bit more digging, and found a nokia forum comment that suggests that the upgrade from firmware 2.x to 3.x corrupts the sip settings, and simply deleting sip configurations won’t fix it. the poster recommended deleting sip connections before upgrading, and then re-creating them after. that isn’t an option for me anymore–i can’t downgrade the phone back to 2.x–but a simple backup/restore cycle (using the built-in backup to memory card option) fixed everything. it took about 10 minutes, but my e61 is now registering with asterisk again. tags asterisk, nokia, sip | no comments electronic home improvement posted by scott laird mon, 06 aug 2007 17:11:00 gmt it’s been a big year for home improvements–i’ve painted two rooms, replaced the carpet in both, added a new light fixture, torn off a deck, and replaced a fence. somehow, after all of that, i still feel behind–i need to re-do my back yard and add a new patio before the dark and cold sets in for the year. before that happens, though, i’m planning on spending some time updating the electronic side of the house. my home asterisk server is getting long in the tooth, and lately it’s been bouncing incoming phone calls. my config files are almost 3.5 years old, and the old thing’s getting kind of crufty, plus nufone seems to be going through one of their annual crisises. on top of that, my wife’s perpetually worried about our 4-year-old sneaking out of the house without us noticing–we’ve already caught her playing in the middle of the cul-de-sac once, and since she has no real fear of cars (or strangers, or getting lost), we’d like to add some sort of warning system to know when one of the exterior doors have been opened. you know what they say–when all you have is a big pile of computer equipment and a credit card, then everything looks like an excuse to buy more hardware and write some code… so, i have a small mountain of x10 and insteon hardware due in later this week, and i’m going to set up door monitoring via a bunch of cheap rf door sensors. i’m planning on monitoring everything via indigo running on an old mac, and then announcing open doors via auto-answer on voip phones using asterisk. sounds easy enough, right? i can’t see any indication that anyone has ever done any indigo-asterisk integration work, but it doesn’t look all that hard. along the way, i guess i’m going to have to completely re-write my asterisk dial plan, because it’s really too crufty to live. while i’m at it, i’m planning on adding a couple “smart” light switches, just to cut down on the number of basement and garage lights that get left on for days at a stretch. i figure they’ll pay for themselves, eventually… hopefully all of this’ll give me something to talk about at mindcamp this year. tags asterisk, insteon, sensors, smarthome | no comments free to good home: rails-app-installer posted by scott laird tue, 24 jul 2007 14:20:00 gmt i really should have done this nine months ago, but i just don’t have time to devote to my rails-app-installer project, and i’d love it if someone would volunteer to take it over. this is the installer used in the typo gem; it’s designed to make it easy to turn any rails app into an easily-installed gem. the code lives in google code; feel free to take a look around. if you’re interested, then please either send me mail or let me know in person at oscon this week. tags installer, rails, ruby, typo | no comments oscon posted by scott laird mon, 23 jul 2007 22:21:00 gmt i just arrived in portland for oscon. i’ll be wandering around most of the week, but if anyone really wants to flag me down, either send me mail at scott@sigkill.org, or drop by the google booth either wednesday or thursday morning. tags conference, oscon, portland | no comments google gears: offline support for ajax apps posted by scott laird wed, 30 may 2007 23:01:00 gmt i usually avoid promoting products that i’m paid to work with, but i just love this one: google gears. it’s an open-source, cross-browser (ie and win/mac/linux ff for now) plugin that provides a bunch of enhancements for developers of ajax apps. most importantly, it lets you add offline support to your ajax apps without requiring a rewrite or fork. you just replace your existing xmlhttprequest calls with a wrapper and off you go. the wrapper’s designed to fail gracefully if the plugin’s not available, so one set of code will work for everyone–with or without the plugin, online or offline. presumably someone will integrate this into prototype and other js frameworks shortly, making it easy for thousands of developers to build offline-enabled web apps. that’s not all that google gears is good for; it also includes javascript thread support and an in-browser sql database. i’ll let you use your imagination on those. i’ve been watching this develop for the past few months, and i’m really excited about it. i can’t wait to see how people integrate this into rails and other frameworks. tags gears, google, javascript | 5 comments older posts: 1 2 3 ... 46 about about the author tags apple asterisk blog broken hardware home linux macosx nokia palm phone photography rails ruby rubyonrails rumors seattle tiger typo voip ads links seattle book events my photo gallery my software typo technorati profile random tracking bits syndicate articles comments valid xhtml 1.0 valid css

Acceuil

suivante

*scottstuff*  Skirando -- Achat-Ventes - Re: scott pure 188+diamir free ride  Programmez.com - Actus - Scott McNealy quitte ses fonctions ...  JillScott.com  Scott Rosenberg's Links & Comment  scotthodge.org  Emplois Napier Scott Executive Search  The Morning Improv - scottmccloud.com  Scott Kelby - Éditions Eyrolles  Dougray Scott : filmographie & biographie de Dougray Scott  American gangster, l'interview de Ridley Scott  pointblog.com : Scott E. Fahlman, son créateur, à propos de l ...  LES FRÈRES SCOTT SUR TF1 sur lachaine.tf1.fr lachaine programmes ...  Video Les frères Scott 4x07 FR 1/3 - les, freres, scott, 4x07, oth ...  IDI-Prix Scott  Serieslive.com - Fiche série TV : Les Frères Scott (One Tree Hill)  American gangster : Un brigand inspire Ridley Scott Cinéma ...  The FuzzyBlog :: Scott Johnson's Blog  Ridley Scott, DVD & Vidéos sur Fnac.com  Scott Walker - Fluctuat.net  Yahoo! France Guide Web > Acteurs et actrices > Scott Paulin  Yahoo! France Guide Web > SériesTV > Les Frères Scott  Disques - Scott Ross au clavecin (Vol.2)  Scott Janousek  AnnuSeries.com : Frères Scott (Les) - Fiche, guide des épisodes et ...  SCOTT Poland :: www.scott.pl ::  Box-office américain - Ridley Scott fait remonter les chiffres ...  Blankbaby  Les Frères Scott  Scott County Public Schools  Adams, Scott - The Dilbert Blog  Frères Scott (les) - générique et paroles  Actualités des sociétés cotées - Air Liquide : Acquisition de ...  Shtetl-Optimized  Radio-réveil Scott CPX 88 - Radios-réveils Comparez et Achetez ...  Scott CRX i908 Portable avec écran - Lecteurs de DVD Comparez et ...  Location DVD - Ridley Scott - Location de DVD - Vidéo à la demande ...  Air Liquide > Acquisition de la société Scott Specialty Gases  Air Liquide > Acquisition de Scott Specialty Gases  Scott Meyers: Software Development Consultant  Les frères scott  Boot de SCOTT  Sci-Fi/Horror: Scott Sigler's Author site  Architecture Journal : Entretien avec Scott Guthrie  Scott F Bass Place -Acceuil-  Scott Glenn  DVD Portables Scott : avis de consommateurs, comparateur de prix ...  Photoshop Insider  Les frères Scott - FORUM Ados-Television  Ridley Scott - Achat et Vente DVD Ridley Scott neufs et d'occasion ...  Les Frères Scott : la saison 4 arrive ! - Votes - MSN Télévision ...  Tony Scott Ados.fr  Scott Caan Ados.fr  TRUE ROMANCE de Tony Scott / 1993  Vidéo "Les frères Scott 4x21 FR 1/3" de oth5910 (Séries > Séries ...  Vidéo "Les frères Scott 4x21 FR 2/3" de oth5910 (Séries > Séries ...  Les Frères Scott - Le Blog - AlloCiné Blogs  Les Frères Scott - Le Blog - AlloCiné Blogs  Scott : Tout sur Scott - Moto & Scooter - Caradisiac Moto  Scott RDX25S - Minis chaînes (Chaîne Hi-Fi) - Chaînes Hi-Fi Neuves ...  Les Frères Scott saison 1 en DVD