On Sat, February 17, 2007 22:14, Tim Sailer said:
> On Sat, February 17, 2007 19:53, Tim Sailer said:
>>> It looks like the read timed out or something, and then each subsequent
>>> read is off. If it matters, the temperature readings had been reading
>>> 185
>>> (wrongly) up until the misread.
>>
>> I think I found the problem. I tried just about everything, but when I
>> started owserver with '--timeout_serial 20', all my problems seem to
>> have
>> gone away for the devices that take a while to read, like the AAG
>> barometer and the temp sensors. I'll load the bus up with every device I
>> have and give it a try.
>
> Nope, that wasn't it. There's something about the timing. The read is
> issued, but the code seems to give up, and every subsequent read is off by
> one value, since the reply to the read acatually happens. Paul, is there
> any to clear the read buffer in OWNet.pm?
Well, it ain't pretty, but it works...
my $bpressure;
$bpressure=$owserver->read("/$bus/$sn/TAI8570/pressure");
if (!defined($bpressure))
{
$bpressure=$owserver->read("/");
$owserver=OWNet->new("localhost:4304 -F");
}
This pulls the value waiting in the 'queue', and then resets the
connection. I guess this is the bad part of persistant connections...
Tim
--
Tim Sailer
Coastal Internet, Inc.
www.buoy.com
631-399-2910
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers