Ben Griffith wrote:
> Hi Paul,
> 
> Thanks for your reply.  I think my questions were based on some 
> misconceptions and you have cleared them up.  A couple comments and one 
> more question (which I think I've already answered) inline below....
> 
> On 12/11/06, *Paul Alfille* <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
> 
>     On 12/11/06, *Ben Griffith* < [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
> 
>         Hi,
> 
>         There was some talk about simultaneous a while back, and I'm
>         wondering if I could benefit from using it.  I'm using
>         MisterHouse, which is basically a big perl loop.  I use owperl
>         to read a different temperature sensor every 15 seconds.  There
>         is, of course, a short pause when reading a sensor.  Could I use
>         simultaneous to reduce the number of pauses, and would the
>         pauses I'd still see be of the same duration or longer than what
>         I'm seeing while reading one sensor at a time?  How would I use
>         owperl with the simultaneous feature.  All of the examples I saw
>         were from the command line. 
> 
> 
>     Just call the simultaneous conversion at the start of the loop. All
>     the values (except perhaps the first) will be waiting for you.
>     OW::put("/simultaneous",1) ;
> 
> 
> I think I completely misunderstood how simultaneous works.  I thought 
> the "simultaneous" object was a flag, and that when it was set I could 
> request more than one temperature at once.  So setting it actually 
> causes all of the temperatures on the network to be read and loaded into 
> the cache, in about the same time as it would normally take to read just 
> one sensor.  Much better than what I thought it did.

Not quite. Simultaneous conversion is a command sent out on the 1-wire 
bus. All the appropriate devices start a read cycle. They will all be 
ready to read after a conversion time (.25 to 1s depending on the 
device.) Then you can read them all into owfs/owperl. They don't 
actually make it to the cache until they are read. an owput to the 
correct name in the simultaneous directory will start it all off.

It should be noted that simultaneous requires that you have a powered 
bus rather than using parasitic power.

On my system with a bunch of 18B20s, I issue a simultaneous, then the 
reads for the sensors of interest. The timing I get back is that the 
first one takes about 1 second and each one afterwards takes about .2 
seconds. I am using owpython and doing some database work for each one, 
but I think most all of the time is spent waiting for the data coming 
from the owserver process.

> 
> .....
> 
>         I know that the delay is due to the A/D conversion on the chip. 
>         During that conversion, can other 1wire operations be going on? 
>         So, could you send the command for the conversion, then go poll
>         a few 1wire switches, then come back and read the converted
>         temperature?  I know owfs can't do this, but I just wondered if
>         the 1wire protocol allows it. 
> 
>     owfs can certainly do this (if powered rather than parasytic). You
>     need a multithreaded application to take advantage of it, however.
> 
> 
> Or two applications?  What would happen in my example below of reading 
> temperatures with an external application if MH tries to poll a switch 
> during the conversion period?  I thought before that MH would have to 
> wait, but now I think maybe that's not the case.
> 
>         I realize I could have an external (to MH) process reading
>         temperatures.  Since I do have some switches that I'm polling I
>         think I would get no benefit because MH would still have to wait
>         for the 1wire bus to be free.  The same would be true of my
>         "pre-reading" idea above I suppose. 

I chose a different approach. There is a program that all it does is the 
1-wire sensor reading, then it runs it through a 3 stage median filter 
(take the last three reading, sort and pick the middle one.) This causes 
a single wacko reading to be completely ignored. I then dump that value 
into a database, and everything that cares about current temperature 
reads the median value of the sensor. (It's a personal gripe I have for 
people using mean filters and not understanding the failure modes of the 
sensors.) Also as noted in another thread, you have to discard the 85C 
reading (AA00) that indicates some sort of error.

There are other ways to connect the sensor reader to other apps, but the 
database is flexible if slow. In my case it buys me enough useful things 
to be worth the work.

enjoy,
jerry

> 
> 
> .....
> 
> 
> Thanks again Paul.
> 
> -Ben
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> 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
> Owfs-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
> 


-------------------------------------------------------------------------
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
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to