Hardware Reference
In-Depth Information
The location can be determined with the mtspick program, issued as follows, where a two-character code is
returned:
mtspick steev error
You can then look up this value in a key to determine how (and to whom) the message should be sent. To allow
multiple receivers and protocols, you create a script for each two-letter code that takes a username as input and
outputs a conduit protocol and username. This also allows you to consider the importance of the message and vary
the e-mail address, as I discussed earlier.
This is then combined with the original message and passed onto the msgxmit code that I've already covered.
We shall later cover a technology called mashmodes that allow you to change house-wide on a large grain basis.
This allows the mts configuration file to change between working and holiday schedules, for example.
Other Uses for MTS
The mtspick part of the procedure accepts two parameters, a user and a priority. This is normally hidden from the
user by mtsxmit . However, it can be reappropriated to create some additional home-spun functionality.
You could create a user called mixer and prepare a crontab so that the master volume of the house changes over
time, automatically lowering over the last few hours of the night so you're naturally lulled to sleep. The same effect can
be used to dim the bedroom lights gradually.
It can also be used to trigger preprepared e-mails asking whether you got into work okay and, if it receives no
reply, issues an alert.
You can also create your own radio station by using the codes as program schedule slots. These can govern which
particular MP3 folder is used to randomly select music for a given time of day or night. Some codes might initiate
Festival into reading news items and reporting the weather.
Location-Based Messaging
Being able to deduce your location can have its uses too, as a way of directing output more accurately. As we've just
seen, MTS can provide a very large part of that functionality. But there's always room for improvement.
We can enlist the support of hardware, such as PIRs, or doormat pressure sensors to get an approximate idea of
which room you're in. If you use two pressure sensors on the stairs (one at the top and one at the bottom), then you
could work out the direction of travel to enable the current audio loom, flooding your music to only where you'd hear it.
If you've adopted a voice recognition system and you're using a separate machine for each room, then you can
create a simple voice command like here to inform the server of your location.
By using the Bluetooth monitor software, you can determine the strength of the signal that, with experimentation,
you can sometimes use to deduce your position within the house. It works better when you have a large house and/or
lots of obstructions in the signal, both of which create an obvious distinction between near and far.
For fine-grained location-based determination, an RFID tag can be used to give more accurate details, although
you will need a fairly powerful tag for it to be detected naturally as you move around the house. One possible solution
here is to mount them in the soles of shoes or slippers, for example, so they can be detected when you walk over the
threshold of any particular room.
And, finally, the best method for determining the location is to employ your local knowledge of the problem.
If the request came from a web page at 192.168.1.132, then you can determine its MAC address (from the DHCPD log)
and therefore which machine it is and where it's located. Furthermore, if you always send personal e-mails from your
laptop in the lounge, then build that information into the system so that any messages sent from that e-mail account
controls the devices in the lounge. Sometimes you can look at the e-mail headers for the last “Received: from” line that
appears to determine the IP address of the sender, but this is not foolproof.
Search WWH ::




Custom Search