glennji.com

Because life's too short to save your work

automation

Homebrew always-on server

Required: A small, low-current-draw server to act as file-storage, database, version control, asterisk controller, security-system ...

== Hardware ==

For me, the hardware requirements are that the server be small enough to fit on my bookshelf, and low-powered so I can leave it on all the time. This points to: a mini-ITX motherboard and case, as the nano ones are still too expensive, and; an AMD Sempron CPU, as it has the lowest power requirements.

Add to this some RAM (1GB should be enough for now) and hard-drives such as the 500GB from Samsung - reputably quiet and cool, and often used in media centres. So something like the Biostar IDEQ AMD Sempron 3300+, with capacity for 2 SATA drives and up to 2GB PC3200 RAM, looks ideal!

== Software ==
For the operating system, I've chosen Ubuntu 7.10 Server, a [[Linux]] distribution. You could just as easily use Debian or another Linux distro, or OS X Server. The good thing about Ubuntu and Debian is the APT installation system - installing many of the software packages listed below is as easy as typing "sudo apt-get install {package}" on the command line.

There's no point having an always-on server if it's not doing anything. Before anything else, install:
* [[Webmin]] Administration - A nice [[web-based GUI]] for administration of the server.

Some other ideas are:
* [[Amanda]] backup.
* [[Asterisk]] VOIP Server.
* [[Azureus]] Bittorrent Downloader - A [[Java]] app, but can be run "headless".
* [[BIND]] DNS server - resolve local names (because the ADSL router can't).
* [[Cfengine]] configuration engine.
* [[FreeSwan]] VPN.
* [[Icecast]] Streaming Server - MP3 streaming audio which can work with MPD.
* [[Mediatomb]] UPnP - With 1TB of file storage, this will be an ideal repository for video, and [[UPnP]] is a standard protocol for streaming video and audio content.
* [[MPD]] Music Player Daemon - remote control music playback.
* [[MySQL]] Database - many other services need or benefit from a "real" database (as opposed to the file-based SQLite), and it may be useful for making your own data-centric apps.
* [[Nagios]] system monitoring
* [[Samba]] Windows File Sharing - if you have Windows clients.
* [[Subversion]] Version Control - always handy for developers.
* [[Shorewall]] network firewall.
* [[Zoneminder]] Security System.

Hardware

== HA-systems ==
* [[X10]]
* [[Insteon]]
* [[UPB]]
* [[Zigbee]]
* [[Z-Wave]]

== Media ==
* Microsoft [[XBox]] (and [[XBMC]])
* [[Squeezebox]]
* [[AppleTV]]
* Nintendo [[Wii]]
* [[Homebrew Wireless Music Player]]

== Other ==
* [[Digital Photo Frames]]
* [[homebrew-always-server|Homebrew always-on server]]
* [[HomeLink]] - remote garage opener
* [[LCD]] - "liquid crystal display"
* [[NabazTag]] - robotic bunny
* [[Roomba]] - robotic floor cleaner
* [[Scooba]] - robotic floor mopper
* [[Stompbox]] - mobile [[WiFi]]-[[EVDO]] gateway
* [[TuxDroid]] - robotic penguin

== Power ==
* [[Smart Power Strip]]

== Remote-control ==
* [[WiFi]]
* [[Bluetooth]]
* [[IR]] (infra-red remote controls)
* [[RF]] (radio-frequency remote controls)
* [[Web-based GUI]]

== Sensors ==
* [[Sensor interface]]
* [[Temperature Sensor]]
* [[Electronics Sensor]]
* [[Touch Sensor]]
* [[Motion Detector]]

== Servers ==
* [[NSLU2]] - network storage device
* [[Buffalo Linkstation]] - network storage device

== User interface devices ==
* [[3Com Audrey]]
* [[Chumby]]
* [[Games console]]s
* Microsoft [[XBox]]
* [[Nokia 770]] and [[Nokia N800]]
* [[PocketPC]] handheld
* [[Palm]] handheld
* Nintendo [[Wii]]
* [[X10 Wall Switch]]

Nokia 770

[[Image:Nokia_770.jpg|right]]The [http://www.nokiausa.com/770 Nokia 770] (and the latest incarnation, the [[Nokia N800]]) are "internet tablets": small, portable devices specifically for accessing the Internet, including web-browsing, email, instant messaging and [[VOIP]]. The Nokia 770 has a large touchscreen, a small directional keypad and some other function buttons. It can connect to the Internet via [[Wifi]] (IEEE802.11b/g) or [[Bluetooth]] (i.e. connecting through your phone to use dial-up or a data plan).

The 770 is based on [[Linux]] and a [[Gnome]]-derivative user interface called "[[Maemo]]". As both Maemo and Linux are open source, there is an active developer and hacker community writing different applications and software for all sorts of things -- e-book readers, intrusion (detection) tools, integrated media browsers and players, automotive telemetry, GPS and even aeronautical displays for experimental aeroplane designs.

For home automation, the 770 supports application programming in a number of languages, including [[Python]]. Also, the default browser (a version of Opera) can do [[AJAX]], which opens the way for dynamic web-based interfaces.

== Resources ==
* [http://maemo.org/maemowiki/ApplicationCatalog Application Catalog]

=== Developer ===
* [http://maemo.org Maemo] - Programming environment
* [http://maemo.org/maemowiki/HowTo Nokia 770 HowTo]

== Tips ==
* [http://wiki.slimdevices.com/index.cgi?SlimserverAndNokia770 SlimServer Wiki on Nokia 770]
* [http://benklaas.com/slimserver/ Controlling SlimServer with the Nokia 770] ([[SlimServer]], [[Squeezebox]])

I just watched Rise of the Silver Surfer. That's a Nokia 770 that Reed Richards is obsessed with! I hadn't thought of hooking the tablet into a world-wide satellite network, I must admit ...
--[[User:GlennjiAtWork|glennji]] 03:58, 4 October 2007 (PDT)

WorkInProgress

== Current Setup ==
I'm not really particularly far into the evolution of my perfect intelligent home. What's more, I've just moved so even the stuff I had working earlier is still awaiting unpacking.

My haven consists of:
* a secure [[Wifi]] network

* [http://www.debian-administration.org/articles/152 Password-less SSH logins] and [http://fuse.sourceforge.net/sshfs.html SSHFS] for secure file shares

* The [[nokia-770|Nokia 770]] - an infinitely hackable [[Linux]] device, but also one less reason to switch on the PC if I only want to surf the web, chat or access [[web-based GUI]]s

* an [[XBox]] Media Center ([[XBMC]])

* a [[Buffalo Linkstation]] NAS running [[Linux]] for file shares and version control

* a shiny silver Intel Core2 Duo (Ubuntu [[Linux]]), ready to be overclocked and watercooled!

* A "smart" power plug. Plug the main device (in this case, the PC) into the master socket and the slave sockets will switch off completely when the master is not drawing a charge.

* an ancient Toshiba laptop which will end it's days as either a digital photo frame, waterproofed digital map display for a motorcycle tankbag or kitchen display.

* Scheduled downloads with [[Azureus]]

* [[Password-less-logins-with-PAM|Password-less logins with PAM]] in Ubuntu

* [[Homebrew always-on server]]

* TV tuner & [[MythTV]] streaming to XBMC

* a couple of [[Nintendo DS]] consoles with the [http://www.r4ds.com R4 for DS]

* Linksys Sipura 3102 [[VOIP gateway]] for IP telephony (and cheap calls to Oz)

* Synchronised calendars with [[GCalDaemon]]

Some other things which may prove useful:
* some random work laptops (Windows, ugh)
* an iPod dock and speakers which are crying out for hackification
* permanent webspace and multiple domain-names for offsite backups and/or synch services
* a DAB and FM clock radio

== Work in Progress ==
Things I'm planning or working on now:
* [[Asterisk]] [[VOIP]] server

* Low-power energy-efficient globes, with a significantly lower current draw.
* Use ACPI to schedule a computer "ON" time, and anacron or GShutdown for an "OFF". [http://www.mythtv.org/wiki/index.php/ACPI_Wakeup This] could be handy
* Web-based remote control of media playback
* [[Screenlets]]-based feedback and control of media playback
* Synchronization of personal information
* Music streaming with [[MPD]] and [[Icecast]]
* [[Nagios]]: [http://www.onlamp.com/pub/a/onlamp/2006/05/25/self-healing-networks.html service monitoring with Nagios]
* Publishing IPP printers with [[Avahi]]
* Remote reporting/control via [[VOIP]] with [[Asterisk]]
* Remote reporting/control via [[Jabber]]
* Surveillance with [[ZoneMinder]]
* Lighting and motion sensors so lamps can turn off when not in use (may conflict with energy efficient globes)

* [[User:GlennjiMason/Security]]

== Thoughts for the future ==
=== Appliance control ===
I haven't decided on which appliance control system I should use, although it will probably be either [[X10]] or [[Insteon]]. Once I figure that out I'll be experimenting with [[xPL]] and [[MisterHouse]], with ''curiousity'' as the controller (although I may want one of the always-on devices to do it, the [[Buffalo Linkstation]] or the new ''tranquility'' music player.

=== Remote Control ===

* The [[Chumby]] is almost ready to buy, and should only be ~£90!
* Some kind of firewalled secure access to web GUIs from outside the network (still undecided on the best way to do this)
* Asterisk-enabled "dial-in" remote control
* Remote-control bots via a private Jabber server

=== Security ===
Recently we witnessed an attempted burglary. We called the police, who apprehended one of the would-be-thieves, but a week later someone threw a firebomb over our fence and burnt up some motorcycles. Just this morning we saw a guy walking along casing cars. Maybe we should just move It made me realise just how subjective experience was i.e. how little we could trust our own recollections of the events.

So I want a security/surveillance system which can, if not protect me, at least keep a record of exactly what's going on down there in the big bad world. Information technology can act as our agents for this, a crude intelligence augmentation (IA).

* [[ZoneMinder]] surveillance

=== Robotics ===
* [[TuxDroid]] - by the gods, I want one of these!

=== The far distant future ===
* Kitchen touchscreen (wish I could find an [[Audrey]])
* Voice activation
* Security system
* GPS and music player on the treadley, powered by solar, wind and/or dynamo (thanks Make)
* [[Stompbox]] for GPS and telemetry on the Ducati

== Random ideas, thoughts and links ==
* Notification via libnotify over [[DBUS]]
** Oooh, a [http://rory.netsoc.ucd.ie/linux/notify-more/ command line client to libnotify] in [[Python]]!
* Pop ups on [[XBMC]]
* Audible notifications/control -- python-mpdclient API
* Notifications via Jabber - [http://xmpppy.sourceforge.net/ xmpppy] Jabber API in [[Python]]
* X10 [[screenlets]]?
* Introduction to writing [http://www.double.co.nz/nintendo_ds/index.html DS homebrew]
* Synchronisation with [http://www.cis.upenn.edu/~bcpierce/unison/ Unison], and [http://linux.spiney.org/debian_linux_maemo_nokia_770_unison_port works on the Nokia] too!
* Should really try iPodLinux - if only for the [http://ipodlinux.org/Category:Emulators emulators]
* Can use the [http://linkstationwiki.net/index.php/Asterisk_-_the_open_source_soft_PBX_%28MIPSel%29 Linkstation as an Asterisk server]
* Argos are selling the Juicebox for £4.99 ... a couple of these for digital photo frames, perhaps?
* USB key drive as a "shadow home" with [http://www.unionfs.org/ UnionFS] -- plug it in and it mounts the encrypted volume, then mounts over your dotfiles so you get your own settings (but still possible to use PC without key drive)
* Make Magazine and the Internet have instructions for building both ECGs and EEGs ... I'd like to wire myself up to the PC for some experimentation (with sbagen binaural beats generator)
* If I make a little FM transmitter ("micromitter") I could stream digital audio (OGG and MP3) to the DAB radio in the bedroom. Wouldn't be using the DAB part of it of course, but it might be good if you want to listen to music in the bedroom but nowhere else.
* AWM (Avant Window Manager) now has plugins! And icons can be updated via dbus-send!

UserStory

== User Story (with notes) ==
''Glennji (and Deeji) are woken gently by the gradual illumination of a lamp and the smell of freshly brewed coffee. The music increases in volume; the flat panel on the wall comes to life displaying useful information: the weather forecast, news headlines scrolling by, the time and today's schedule for each of them.''

X10 plugs can be used to simulate "daylight" or "sunrise" lighting; this is important because if it were up to me I'd sleep all day (and play all night). Music is nice to wake up to, but it's hard to pick the correct volume. We want a general-purpose TV in our room for TV, movies, even MAME games when someone else is using the main TV.

''During breakfast Glennji and his beloved Deeji talk, read news and email on the web-tablet, and watch TV. Afterwards, if both working onsite, he picks up his web-tablet, phone and keys and they head out the door. Behind them the workstation signs them both out of instant messenger networks and hibernates. A low-power "always on" server redirects the landline to voicemail for most numbers; certain numbers will redirect to one of their mobiles. The security system is activated and any lights are switched off.''

''On the way to work, Deeji reminds Glennji about the Zoo on the weekend and he enters it into the web-tablet or phone, happy that both will synchronise with his desktop and Google calendars. They part ways on Brick Lane and head into their respective offices.''

''Once logged on Glennji checks his email - a utility company called just after they left, and the voicemail is attached in MP3 format. He adds the phone number to his phone and synchronises with the web-tablet, desktop and online contacts list. He connects to home and cues up the latest episode of "Flight Of The Conchords" to watch that evening, then starts streaming music from the collection to work. Curious, he clicks through the security cameras, but all is well - he would receive an email, instant message or SMS if there was a break-in, anyway.''

''When they arrive home that evening, the lights and the workstation switch on. They listen to music, watch live (pauseable) or pre-recorded TV or hack Java code before preparing dinner from an online recipe displayed on a splash-proof screen in the kitchen. With dinner eaten, the dishes done and tomorrow's coffee prepared they settle in for the night. Glennji activates the movie settings via the web tablet: the lights dim and home theatre comes to life.''

''The phone rings: it's Deeji's mum, so the movie pauses itself and announces who is calling. She picks up the cordless handset and presses 9 to transfer it there, rather than the workstation or mobile headset. Glennji sits down at the computer and updates a wiki or three.''

Home Automation

This is pretty much a recreation of the content from http://automation.highearthorbit.com/wiki/index.php?title=Main_Page and should probably be considered a backup, or perhaps a secondary cache. Either way, HEO is the authoritative source; I've written a bunch of stuff on there and just wanted a "local" copy too. This means that you're likely to find missing pages here, at least until I sort out the import.

  • [[Hardware]]
  • [[Software]]
  • [[Scripts]]

'''Read the [[UserStory]] to get an idea of where I'm going with this, or check out the [[WorkInProgress]].'''

== Overview ==

I am trying to get into home automation as I'm fascinated by the possibilities: an intelligent home which recognizes and adapts to its occupants, modifying the environment to best use the resources at hand; non-intrusive, pervasive technologies and a self-configuring, secure and ubiquitous information-mesh with auto-discovery of services. In "plainspeak", the kind of thing you learn to use very quickly and soon take for granted.

I also want ecologically sensible and planet-friendly solutions and experiments - wiring up your home (and subsequently your life) should use ''less'' energy because the intelligent home is smart enough to take advantage of environmental efficiency-tuning.

I'm renting, which means anything rigged up has to be just as easily removed without permanent damage, but the technology these days allows exactly that. It also means I'm unlikely to be able to run fibre-optics inside the walls, embed an LCD in the kitchen bench or behind the bathroom mirror, or rewire the electricity grid to take a feed from a solar-panel or/and wind turbine array. Perhaps when (if?) I buy my own place ...

=== Self-configuring, self-healing, secure, pervasive, ubiquitous information-mesh ===
(The longest heading ever.) I have a particular requirement for my network of intelligent (PCs), semi-intelligent (embedded controllers) and simple devices (remote switches and sensors) -- they should work seamlessly together, be able to automatically reconfigure quite quickly, and provide discoverable services to one another in a secure, non-intrusive way.

"Ubiquity" in this context refers to the services being discoverable and available via a number of different mechanisms -- i.e. remote control/reporting interfaces via web/HTTP, IM bots, VOIP, voice-activation and other interfaces.

In practice this means a number of things:

  • The wireless (802.11g) computer network should be secure (WPA with PSK) and self-configuring ([[Zeroconf]])
  • Services should be published via [[Avahi]]/[[DNS-SD]] (printers, music libraries, fileshares, web-interfaces)
  • * Service-monitoring and self-repair should be running whenever possible

=== Eco considerations ===
There are a couple of reasons to try to be as energy efficient as possible when it comes to electronics and electrical goods: fiscal and ecological responsibility.

Electricity, for now at least, ''costs money'' and a few devices left on or on standby can quickly add up. In the past I've tended to have at least a couple of PCs on at any one time, and subsequently our power bill was always quite large -- that is money I could be spending on other things!

As for the impact we're having on poor Starship Earth, we ''need'' to increase efficiency just to continue life-support for our growing global population. Yup, I'm a fan of R. Buckminster Fuller's ephemeralization and intelligent designs -- always "doing more with less" and taking the full system into consideration "holistically".