E-Book, Englisch, 303 Seiten
Goodwin Smart Home Automation with Linux
1. ed
ISBN: 978-1-4302-2779-3
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
E-Book, Englisch, 303 Seiten
ISBN: 978-1-4302-2779-3
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Linux users can now control their homes remotely! Are you a Linux user who has ever wanted to turn on the lights in your house, or open and close the curtains, while away on holiday? Want to be able to play the same music in every room, controlled from your laptop or mobile phone? Do you want to do these things without an expensive off-the-shelf kit? In Smart Home Automation with Linux, Steven Goodwin will show you how a house can be fully controlled by its occupants, all using open source software. From appliances to kettles to curtains, control your home remotely!
Steven Goodwin has been involved in science and technology from an early age, and built his first synthesizer while still in his teens. Since then, his projects have been varied. He has sold over a million computer games, written two books, built robots, and automated a house that can be controlled from the Internet. He has spoken at many conferences, including NotCon '04 and the BBC Backstage OpenTech event.
Autoren/Hrsg.
Weitere Infos & Material
1;Title Page;2
2;Copyright Page;3
3;Contents at a Glance;5
4;Table of Contents;6
5;About the Author;13
6;About the Technical Reviewers;14
7;Acknowledgments;15
8;Introduction;16
9;CHAPTER 1 Appliance Control;18
9.1;Making Things Do Stuff;18
9.2;X10;18
9.2.1;About X10;19
9.2.2;General Design;21
9.2.2.1;Simple Case;21
9.2.2.2;Standard Case;21
9.2.2.3;Fully Automated;22
9.2.2.4;Assigning Addresses;22
9.2.2.5;Using Multiple House Codes;23
9.2.3;Device Modules;23
9.2.3.1;Controlling Lights;24
9.2.3.1.1;Lamp Module (LM12U);24
9.2.3.1.2;Bayonet Lamp Module (LM15EB);25
9.2.3.1.3;Wall Switch (LW10U);26
9.2.3.1.4;MicroModule with Dimmer (LWM1);27
9.2.3.1.5;DIN Rail Dimmer (LD11);28
9.2.3.1.6;Appliance MicroModule (AWM2);28
9.2.3.2;Controlling Appliances;29
9.2.3.2.1;Appliance Module (AM12U);29
9.2.3.2.2;Appliance MicroModule (AWM2);30
9.2.3.3;Internal Devices;31
9.2.3.4;Combination Devices;31
9.2.3.4.1;Electronic Curtain Rails: Retrofit;32
9.2.3.4.2;Electronic Curtain Rails: Prebuilt;32
9.2.4;Stand-Alone Controllers;32
9.2.4.1;Tabletop Transmitter Modules;32
9.2.4.1.1;Mini Controller (MC460);33
9.2.4.1.2;Sundowner Dusk/Dawn Controller (SD7233/SD533);33
9.2.4.1.3;Mini Timer (MT10U);33
9.2.4.1.4;Maxi Controller (SC2800);34
9.2.4.2;Handheld Transmitter Modules;35
9.2.4.2.1;Handheld RF Remote (HR10U);35
9.2.4.2.2;Keyfob Remote (KR22E);35
9.2.4.2.3;EasyTouch Panel10 RF;36
9.2.4.2.4;EasyTouch35 Universal Remote Control;36
9.2.4.3;In-Wall Transmitter Modules;36
9.2.4.4;Motion Sensors;37
9.2.5;Gateways and Other Exotic Devices;37
9.2.6;Computer Control;40
9.2.6.1;Heyu;41
9.2.6.1.1;Configuration;42
9.2.6.1.2;Sending Messages;42
9.2.6.1.3;Receiving Messages;43
9.2.6.1.4;Programming the EEPROM;44
9.3;C-Bus;45
9.3.1;About C-Bus;45
9.3.2;Differences Between X10 and C-Bus;45
9.3.3;Devices;46
9.3.3.1;Controlling Lights;46
9.3.3.2;Controlling Appliances;47
9.3.4;Controllers;47
9.3.5;Gateways;48
9.4;Networked Devices;48
9.4.1;Ethernet Devices;48
9.4.2;Networking Primer;48
9.4.2.1;Concepts;49
9.4.2.2;Addressing;49
9.4.2.3;Computer Names;52
9.4.2.4;Network Services;53
9.4.3;CCTV Cameras;55
9.4.3.1;Wireless Cameras That Aren’t;56
9.4.3.2;Custom Hardware;57
9.4.3.3;Linux Software;57
9.4.4;Stand-Alone BitTorrent Clients;58
9.5;Infrared Remote Control;58
9.5.1;All-in-One Remotes;59
9.5.2;IR Relays;59
9.5.2.1;Over the Aerial Cable;59
9.5.2.2;IR-RF-IR Gateways;60
9.5.2.3;IR Over IP;60
9.5.3;IR Control;63
9.6;Conclusion;65
10;CHAPTER 2 Appliance Hacking;66
10.1;Converting Existing Technology;66
10.2;Software Hacks;66
10.2.1;Linksys NSLU2;66
10.2.1.1;Unslung;67
10.2.1.2;SlugOS;68
10.2.2;Developing on the Slug;68
10.2.3;Hacking Game Consoles;69
10.2.3.1;Sega Dreamcast;69
10.2.3.2;Sony PlayStation;70
10.2.3.2.1;PlayStation 1;70
10.2.3.2.2;PlayStation 2;71
10.2.3.2.3;PlayStation Portable;72
10.2.3.3;Microsoft Xbox;72
10.2.3.3.1;Running Linux;73
10.2.3.3.2;Xbox Media Center;74
10.3;Hardware Hacks;75
10.3.1;Linksys NSLU2;75
10.3.1.1;Always On;75
10.3.1.2;Overclocking;75
10.3.1.3;Serial Port;76
10.3.2;LEGO Mindstorms;77
10.3.3;Arduino as an I/O Device;78
10.3.3.1;Installation and Setup;79
10.3.3.2;Arduino Software;80
10.3.3.2.1;Reading Digital Inputs;81
10.3.3.2.2;Reading Analog Inputs;84
10.3.3.2.3;Sending Digital Outputs;85
10.3.3.2.4;Sending Analog Outputs;86
10.3.3.2.5;Creating Audio Outputs;87
10.3.3.3;Communication with a PC;87
10.3.3.4;Arduino Hardware;89
10.3.3.4.1;Ethernet Networking;90
10.3.3.4.2;Wireless Control;90
10.3.3.4.3;Sound;90
10.3.3.4.4;Motors;90
10.3.3.5;Example: The Arduino Welcome Mat;90
10.3.3.6;Example: The Arduino Dictaphone;93
10.3.4;Joysticks for Input;96
10.3.5;Other Input Controllers;97
10.3.6;Hacking Laptops;97
10.3.7;Your Own X10 Devices;98
10.4;Conclusion;100
11;CHAPTER 3 Media Systems;101
11.1;Incorporating the TV and the HiFi;101
11.2;The Data Chain;101
11.2.1;Extracting the Data;102
11.2.1.1;Compact Disc;102
11.2.1.2;DVD;103
11.2.1.2.1;Rip As ISO;104
11.2.1.2.2;Rip As Movie Files;104
11.2.1.2.3;Issues with Movies;105
11.2.1.3;Cassette Tapes and Vinyl;106
11.3;Storage;107
11.3.1;Stand-Alone NAS Systems;107
11.3.1.1;Hard Drive Considerations;107
11.3.1.2;Networking Considerations;109
11.3.1.3;Extra Functionality;110
11.3.2;NAS with Media Playback;110
11.3.3;Configuring a Linux Box;111
11.3.3.1;Preparing a Machine;112
11.3.3.2;Preparing a Filesystem;113
11.3.3.3;Preparing a Master Server;113
11.4;Media Extenders;114
11.4.1;Stand-Alone Hardware;115
11.4.1.1;Hauppauge MediaMVP;115
11.4.1.2;Creating a Server;115
11.4.1.3;MediaMVP Media Center;116
11.4.1.3.1;Weather Reports;117
11.4.1.3.2;Video Transcoding;117
11.4.1.3.3;Other Functionality;119
11.4.1.4;The Xtremer;119
11.4.1.5;Squeezebox;119
11.4.1.5.1;Server Software;120
11.4.1.5.2;Other Software;120
11.4.1.6;Emprex ME1;120
11.4.2;Just Linux;121
11.4.2.1;The Operating System;121
11.4.2.2;The Software;121
11.4.2.2.1;MythTV;122
11.4.2.2.2;Freevo;122
11.4.2.2.3;Xbox Media Center;123
11.4.2.2.4;The Video Disk Recorder Project;123
11.5;Distribution;123
11.5.1;Local Processing vs. Remote Processing;123
11.5.2;AV Distribution;123
11.5.2.1;Switching;124
11.5.2.2;Splitting and Merging;124
11.5.3;Wiring Looms;125
11.5.4;Wireless AV Distribution;126
11.5.5;Matrix Switchers;126
11.6;Control;128
11.6.1;Local Control;128
11.6.2;Remote-Control Methods;128
11.6.2.1;Direct Control;128
11.6.2.2;Relay Control;129
11.6.2.3;Server Control;130
11.6.2.3.1;A Web Interface;130
11.6.2.3.2;SMS;130
11.7;Conclusion;131
12;CHAPTER 4 Home Is Home;132
12.1;The Physical Practicalities;132
12.2;Node0;132
12.2.1;Function and Purpose;132
12.2.2;Determining the Best Room;133
12.2.2.1;Lawful Considerations;133
12.2.2.2;Necessary Considerations;133
12.2.2.3;Negative Effects;134
12.2.2.4;Human Considerations;135
12.2.3;Primary Options;136
12.2.4;Building the Rack;137
12.3;Servers;138
12.3.1;Purposes of Servers;138
12.3.1.1;CPU Power;138
12.3.1.2;Disk Space;139
12.3.1.3;Server Extensibility;139
12.3.1.4;Bandwidth Capabilities;139
12.3.2;Types of Server;140
12.3.2.1;Rack Mount;140
12.3.2.2;Desktop PC;140
12.3.2.3;Mini-ITX;141
12.3.2.4;Mini-PC;142
12.3.2.5;Custom Embedded;143
12.3.3;Power Consumption;143
12.3.4;Server Coordination;146
12.3.5;UPS;147
12.3.6;Backups;151
12.3.7;Hiding Your Home;155
12.4;Adding to Your Home;156
12.4.1;General Considerations;157
12.4.2;Wired Network;158
12.4.3;Wireless Points;160
12.4.4;Audio Cabling;161
12.4.5;Other Access Points?;162
12.5;Conclusion;163
13;CHAPTER 5 Communication;164
13.1;Humans Talk. Computers Talk.;164
13.2;Why Comms?;164
13.3;IP Telephony;165
13.3.1;Skype;165
13.3.2;Asterisk;166
13.4;E-mail;166
13.4.1;Preparing E-mail in Linux;166
13.4.2;Sending E-mail;167
13.4.3;Autoprocessing E-mails;168
13.4.4;Security Issues;171
13.5;Voice;172
13.5.1;The Software for Voice Recognition;173
13.5.2;Remote Voice Control;175
13.5.3;Speech Synthesis;176
13.5.4;Piecemeal Samples;179
13.6;Web Access;180
13.6.1;Building a Web Server;181
13.6.1.1;Virtual Sites;181
13.6.1.2;Secure Server;183
13.6.1.3;Controlling the Machine;187
13.6.1.4;Media Access;188
13.7;SMS;189
13.7.1;Processing with a Phone;190
13.7.2;Custom Numbers and APIs;193
13.7.2.1;Sending Messages;193
13.7.2.2;Receiving Messages;196
13.8;Conclusion;199
14;CHAPTER 6 Data Sources;200
14.1;Making Homes Smart;200
14.2;Why Data Is Important;200
14.2.1;Legalities;200
14.2.1.1;Screen Scraping;201
14.2.1.2;Data Through APIs;204
14.2.2;Distribution;205
14.3;Public Data;205
14.3.1;TV Guides;205
14.3.2;Train Times;206
14.3.3;Road Traffic;208
14.3.4;Weather;208
14.3.4.1;Forecasts;208
14.3.4.2;Local Reporting;212
14.3.5;Radio;212
14.3.6;CD Data;214
14.3.7;News;216
14.3.7.1;Reported Stories: Push;216
14.3.7.2;Retrieving Data: Pull;218
14.4;Private Data;219
14.4.1;Calendar;219
14.4.2;Webmail;221
14.4.3;Twitter;223
14.4.3.1;Posting Tweets with cURL;224
14.4.3.2;Reading Tweets with cURL;224
14.4.3.3;Reading Tweets with RSS;225
14.4.4;Facebook;225
14.5;Automation;225
14.5.1;Timed Events;226
14.5.1.1;Periodic Control with Cron Jobs;226
14.5.1.2;Occasional Control with At;228
14.5.2;Error Handling;228
14.6;Conclusion;229
15;CHAPTER 7 Control Hubs;230
15.1;Bringing It All Together;230
15.2;Integration of Technologies;230
15.3;The Teakettle: An Example;231
15.4;Minerva;233
15.4.1;Overview;234
15.4.2;Linux Users Are Not HA Users;235
15.4.2.1;The Minerva User;237
15.4.2.2;The Public User;237
15.4.3;Device Abstractions;237
15.4.3.1;Typical Application Abstractions;238
15.4.3.2;Monexec;239
15.4.3.3;TODO: A Worked Example;240
15.4.4;Conduits;241
15.4.4.1;Echo;242
15.4.4.2;Email;242
15.4.4.3;Infrared Remote Control;242
15.4.4.4;Logging;242
15.4.4.5;SMS;242
15.4.4.6;Twitter;242
15.4.4.7;The Voice Conduit;243
15.4.4.8;Web Log;243
15.4.4.9;Window Alert;243
15.4.4.10;Administering Conduits;243
15.4.5;Messaging Conduits;244
15.4.5.1;Output Conduits: Transmission;244
15.4.5.2;Input Conduits: Receiving Messages;246
15.4.5.3;TODO: Building a Conduit;248
15.4.6;Message Relays;249
15.4.7;Time-Based Messaging;249
15.4.7.1;Other Uses for MTS;251
15.4.8;Location-Based Messaging;251
15.4.9;Cosmic;252
15.4.9.1;Configuration;252
15.4.9.2;Creating Modes;254
15.4.10;Web Applets;254
15.4.10.1;Zinc: Between Web and Native;255
15.4.10.2;Of Web Pages and Applets;255
15.4.10.3;Existing Applets;258
15.4.10.3.1;Media;258
15.4.10.3.2;Lifestyle;260
15.4.10.3.3;Information;263
15.4.10.3.4;Administration;264
15.4.10.4;Creating Your Own Applets;265
15.4.10.4.1;The WARP Directories;266
15.4.10.4.2;The Components of WebFace;266
15.4.10.4.3;The Basic Structure;266
15.4.10.4.4;TODO: Controlling the Applet;267
15.4.10.4.5;Global Configuration;269
15.4.10.4.6;Applet Configuration;270
15.4.10.4.7;Utilities;271
15.4.10.4.8;Release;271
15.4.11;Manifest;271
15.4.12;Marple;272
15.4.12.1;The Workings;273
15.4.12.2;Handling Protocols;273
15.4.12.3;Bearskin Compatibility;275
15.4.13;Utility Scripts;276
15.4.13.1;Status;276
15.4.13.2;User Tools;276
15.5;Topology Ideas;277
15.5.1;Networking;277
15.5.2;Wiring Looms;279
15.6;Conclusion;282
16;Index;283
"Chapter 5 Communication (S. 149-150)
Humans Talk. Computers Talk.
It is often said that language is the invention that makes all others possible. Within the world of technology, language is the protocol that makes all others live. Writing software for a stand-alone machine is all very nice, but when it manages to interface with the outside world, interface with another program across a network, or control an external piece of hardware, it seems so much more satisfying.
Controlling even the simplest of robots with a computer is infinitely more impressive to the layperson (and many geeks!) than the demonstration of an optimized implementation of marching cubes.1 Having already covered a number of devices in Chapter 1 that are able to talk with external hardware, I’ll now cover human-computer communication and demonstrate how we can interact with one machine or piece of software and have it control another somewhere else. This includes the use of email, SMS, and web pages. However, the onset of new technology is relentless, and with devices such as the iPhone offering a broadband2 experience, its use as a device for voice calls, SMS, or e-mail is very much reduced.
Why Comms?
There are four methods of communication within the technology arena:
• Computer-to-computer
• Human-to-human
• Computer-to-human
• Human-to-computer
These are all important to us for different reasons. The first was covered in Chapter 1 and allows devices to be controlled automatically according to some time- or logic-based programming. Human-to-human communications are those that take place every day but can now be facilitated by technology.
Before the advent of the telephone, our only form of real-time communication was faceto- face. Now we have e-mail, Internet relay chat (IRC), instant messaging (IM), and SMS to perform the same task. All remove the “face” element. We have also streamlined our existing communication mediums. Telephones, which were once low quality and hardwired to a physical location, are now mobile. Through Voice over IP (VoIP) technology, you can make use of the (near) free cost of the Internet to provide financial savings and, when combined with mobile technology, facilitates the amusing situation where using a mobile phone is used to order pizza online through a web page, when it would have been normally used to call them!
When we talk of computer-to-human communication, we are looking at reports and information about the house that the computer sends to us, as appropriate. In the simplest of cases, this might be the daily wake-up call or an e-mail containing the day’s TV schedule. In more complex scenarios, it could be a full report of the computers in the house and how they are performing.3 And finally, human-to-computer communication takes place most often and involves us telling the machine what we want to do via e-mail, SMS, or a web page. To be a truly smart and automated house, this list would include haptic interfaces."




