From: Bruce W. <br...@mi...> - 2004-04-07 02:44:18
|
I recently had problems reading iButtons when setting up a friends box, due to the goofy serial card that he had. I found, however, that the digitemp software from http://www.digitemp.com worked ok with all his tempurature ibuttons, so I wrote the attached code to simply use that software and bypass the mh perl iButton software. I'll include this as public/iButton_temps.pl in the next release. Bruce ---- # Category = iButtons #@ Use digitemp to read ibuttons, when the built in mh perl code has problems reading ibutton temps. #@ Download linux or windows digitemp from: http://www.digitemp.com $v_iButton_readtemps = new Voice_Cmd "Read the iButton temperature buttons"; $v_iButton_readtemps-> set_info('This reads all all iButton temperature devices.'); $ibutton_read = new Process_Item('digitemp.exe -c/bin/digitemp.cfg -a'); if (new_minute 1 or said $v_iButton_readtemps) { set_output $ibutton_read '/misterhouse/data/ibutton.data'; start $ibutton_read; } # Data looks like this: Feb 28 22:44:16 Sensor 0 C: 3.01 F: 37.42 if (done_now $ibutton_read) { for my $data (file_read '/misterhouse/data/ibutton.data') { next unless $data =~ /Sensor (\d+) C: (\S+) F: (\S+)/; next if $3 > 180; # False readings look like 185 print "ibutton sensor==$1 temp=$3\n"; $Weather{"TempSpare$1"} = $3; } } ---- -----Original Message----- Curently running MH on a Win 98SE box and would like to upgrade to XP. Problem is I cannot get the iButtons to cooperate. Under XP I can use MH to connect and disconnect from the iButton network as well as correctly list all the devices on the ibutton network (which confirms connectivity) which consist of Temperature sensors. But when I try to read the sensors all I get is 0.00 data sent back. I'm confused! Anyone have any ideas on this? Thanks in advance! Peter |