Hi Petr - I've had a busy weekend, sorry I didn't get back earlier... I've CC'd the OWFS list since the people there may have more insight into temperature reading rates and hot swaping 1-wire modules on the network.
I'm not sure about the performance on reading temperature. For what I did on the bike and other projects where I use 1-wire, the performance is just fine. But I never thought about it before. The same for removing / adding devices from a live 1-wire network. It's not something that I've done before so I'm not sure what the issues would be. Hopefully someone on the list will be able to chime up and speak more on performance and hot swapping... - Peter On 8/5/05, Petr <[EMAIL PROTECTED]> wrote: > Thanks for the reply. > > I am just wondering, why is temperature reading so slow. According to > the http://pdfserv.maxim-ic.com/en/an/onewirebus.pdf > > "For example, it takes about 12 s to do a search command on a mix of > 500 1-wire devices using a COM port adapter on a PC. Since timing is > controlled by the UART, microprocessor clock speed has no impact on > the search time." > > The strange thing is even s.useCache(False) is used, you can't plug > and unplug thermometers on the fly. You can try the behaviour of the > code mentioned below for say 50 readings (for z in range(50):) > > just can't imagine how to monitor if the I-button (DS1990A for example) > is connected to the bus for a while (for example to switch ON/OFF the > security system on the motorbike or in the car). > > PEtr > > PK> Don't worry, I'm glad to help... > > PK> [EMAIL PROTECTED]:/space/src/owfs> cat /tmp/petr_time.py > PK> import sys > PK> import ow > PK> import timeit > > > PK> def nothing(): > PK> pass > > > PK> def init(): > PK> ow.init('u') > PK> a = ['/10.B7B64D000800', '/26.AF2E15000000'] > > PK> for z in range(1): > PK> for saddr in a: > PK> s = ow.Sensor(saddr) > PK> s.useCache(False) > PK> print s.temperature > > PK> ow.finish() > > > PK> for f in ['nothing', 'init']: > PK> t = timeit.Timer(f+'()', 'from __main__ import ' + f) > PK> l = t.timeit(1) > PK> print f, l > PK> [EMAIL PROTECTED]:/space/src/owfs> sudo python /tmp/petr_time.py > PK> nothing 8.82148742676e-06 > PK> 25.1875 > PK> 25.2188 > PK> init 1.32225704193 > PK> [EMAIL PROTECTED]:/space/src/owfs> > > PK> - Peter > > > PK> On 8/4/05, Petr <[EMAIL PROTECTED]> wrote: > >> Peter, > >> > >> Sorry to bother you, I did some measurement as well (I have to > >> underline, I am working with the DS9097 pasive! adapter and according > >> to the Dallas datasheet the maximum effective 1-Wire transfer rate is > >> 14.4 kbits/s (regular speed)) > >> > >> Just curious, what is the similar measurement on the USB bus (of > >> course it is not a big issue right now, so I can wait for my own USB > >> adapter and do such a measurement later :) > >> > >> import sys > >> import ow > >> import timeit > >> > >> def nothing(): > >> pass > >> > >> def init(): > >> ow.init("/dev/ttyS0") > >> > >> a = ['/10B2D0BE0008003E', '/10FBCABE0008001C'] > >> > >> for z in range(1): > >> for saddr in a: > >> s = ow.Sensor(saddr) > >> s.useCache(False) > >> print s.temperature > >> > >> ow.finish() > >> > >> for f in ["nothing", "init"]: > >> t = timeit.Timer(f+"()", "from __main__ import " + f) > >> l = t.timeit(1) > >> print f, l > >> > >> Output is: > >> nothing 1.69277191162e-05 > >> 21.1875 > >> 21.0625 > >> init 3.04429793358 > >> > >> > >> again, have a nice weekend > >> > >> Petr > >> > >> > > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers