iButton Project
I've eventually managed to get hold of a DS9097U! It is from Maxim/Dallas Direct in the UK, so I recommend them if you need parts yourself.
My new active interface allowed me to start building things based on the "Public Domain" 1-wire library available from Dallas.
Python One Wire Network Library
I used SWIG to wrap the PD 1-wire library, and then wrote a couple of python classes to create a more OO API. This lets you do this such as (exact syntax may not be quite this in the version downloadable below):
own = onewirenet.onewirenet("/dev/iButton")
for ibutton in own:
print ibutton
ibutton = own["2600FC043621BE0C"]
if ibutton.verify():
f = ibutton.open("FILE.001")
print f.read()
f.close()
own.close()
You can download version 0.0.1 of my code:
- python-onewire-0.0.1.tgz
Warning: filesize() [function.filesize]: stat failed for ibutton/python-onewire-0.0.1.tgz in /var/www/www.nickpiper.co.uk/iButton_2.php3 on line 40
0.00MB
Much thanks to the guys on OPN/#python for their help.
Security Daemon
When I leave my room, my security daemon does stuff like:
- Make sure my Palm Pilot is off and locked (via X10)
- Lock my X display
- Start the motion sensor
- Turn off the music
- Turn a small light on dimly (via X10)
Then if someone I've given an iButton two comes in, it allows them access to only what they should be able to use (in my case, only the "Room"; so motion sensor is turned off for them).
When motion IS detected, it is recorded into an mpeg (check out motion on freshmeat for the binary part), and then emailed to me along with an SMS.
My python script to do this (has a few requirements, but you should be able to figure it out, if not just give me a yell) is here. Requires Python 2.2 or a hacked Python 2.1 (like I used).
Since my last rewrite it has become quite a nifty script, using threading. It can cope with multiple iButtons, merging the Authentication Tokens together. For example, if two iButtons have AuthTok "Bedroom", only when they are both removed will the system lockdown "Bedroom".
The xscreensaver I use is a bit hacked to get this to work better, if you ask I should be able to dig out my changes.
![The Website of Nicholas Piper [14.08203125]](./maintitle.gif)