I wrote this stuff a while ago.  At the time, I had a DS9490R USB-to-1wire adaptor which is not supported by MH so I used owfs (one wire file system) (http://owfs.sourceforge.net/) as the interface.

 

It relies on the fact that owfs creates a pseudo file system and within it, it creates a file called “present” in the token’s directory whenever an ID token is connected to the system.

 

If you’re already using the 1-wire support from with MH then it should be possible to replicate the logic – I’ve just never tried.

 

<QUOTE>

#Category=iButtons

 

my $owfs_dir = "/mnt/owfs/";

$f_dongle = new File_Item($owfs_dir."81.3BBE20000000"."/present");

$f_token_chris = new File_Item($owfs_dir."01.AA0B3A090000"."/present");

$f_token_lisa = new File_Item($owfs_dir."01.0EDED90A0000"."/present");

 

### Dongle Initialisation ###

 

if ($New_Minute && (! exist $f_dongle)) {

  print_log "ERROR: OW::dongle - problem detected with OWFS - attempting to fix";

  run qq|umount $owfs_dir|;

  sleep 2;

  run qq|pkill owfs|;

  sleep 2; 

  run qq|owfs -u $owfs_dir|;

  sleep 2;

  if (exist $f_dongle) {

    print_log "1-wire dongle has been re-initialised";

  } else {

    print_log "1-wire dongle has failed to re-initialise";

  }

}

 

my %exists_now;

 

### Chris ###

 

if (exist $f_dongle) {

  if (exist $f_token_chris) {

    $exists_now{"Chris"} = 1;

  } else {

    if ($exists_now{"Chris"} == 1) {

      print_log "Goodbye Chris";

      speak "Goodbye Chris";

    }

    $exists_now{"Chris"} = 0;

  }

}

 

if (exist_now $f_token_chris) {

  print_log "Hello Chris";

  speak "Hello Chris" unless $Reload;

}

 

### Lisa ###

 

if (exist $f_dongle) {

  if (exist $f_token_lisa) {

    $exists_now{"Lisa"} = 1;

  } else {

    if ($exists_now{"Lisa"} == 1) {

      print_log "Goodbye Lisa";

      speak "Goodbye Lisa";

    }

    $exists_now{"Lisa"} = 0;

  }

}

 

if (exist_now $f_token_lisa) {

  print_log "Hello Lisa";

  speak "Hello Lisa" unless $Reload;

}

</QUOTE>

 

 


From: misterhouse-users-admin@lists.sourceforge.net [mailto:misterhouse-users-admin@lists.sourceforge.net] On Behalf Of Peter Woodall
Sent: Friday, 29 April 2005 12:29 AM
To: misterhouse-users@lists.sourceforge.net
Subject: [mh] iButton ID Only use

 

I would like to use the ID only ibutton to alert MH to a particular person or event.  I recall someone that used it but don’t see any code designed for it (I would think that the ibutton monitor would somehow get involved).

 

Anyone have any ideas?

 

Thanks

 

Peter Woodall