tailieunhanh - Apress - Smart Home Automation with Linux (2010)- P51

Apress - Smart Home Automation with Linux (2010)- P51: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 | CHAPTER 7 CONTROL HUBS system usr local minerva bin msgrcv vox auth cmd This causes any existing command script called cmd present in usr local minerva etc msg vox cmd to be executed and includes typical commands to control the lights lightson lightsoff audio mixer mute quiet next and status reports such with time and status . Also you know that any text written to the output is returned by the same conduit. Since this uses the vox voice input conduit the output will be via the voice output conduit Festival through say . You can therefore persuade the computer to enact simplistic conversations by creating scripts such as hello usr local minerva etc msg vox cmd hello echo Hello and time usr local minerva etc msg vox cmd time MINBASE usr local minerva MINBASE bin hdate MINBASE bin htime TODO Building a Conduit Although there are many necessary small files and directories in the creation of a conduit the process has been made simpler by a short script that generates them all automatically so you need only to call the following msgconduit create todo You should see the extra directories created MINBASE etc msg todo addr MINBASE etc msg todo auth MINBASE etc msg todo cmd MINBASE etc msg todo xmit By default the output command MINBASE etc msg todo xmit cmd is symlinked to MINBASE bin mxtodo. This is currently empty and there is no reason to bend the standard for the sake of it so you can edit this file to create the code that will run whenever a message is sent into the TODO conduit. Since you have a Bearskin command that does all the processing it s simply a matter of taking out the arguments and passing them into MINBASE bin todo bin bash MINBASE usr local minerva CONDUIT 1 shift USER 1 shift MSG MINBASE bin todo add USER MSG 233 CHAPTER 7 CONTROL HUBS And again you need to ensure that this script can be executed chmod ugo x usr local minerva bin mxtodo And that s it It s ready for testing msgxmit todo steev Write the web applet for TODO Message Relays Minerva also .

TỪ KHÓA LIÊN QUAN