> Don't forget to scan the "uncached" directory if you want to monitor > changes immediately. >
I did try the USB-1Wire *DS9490R<http://www.maxim-ic.com/datasheet/index.mvp/id/3834> * adapter and the iButton was detected almost immediately when touched to the 1-Wire bus. Switching the cache on/off does not give speed improvement (in both cases with USB or with RS-232 passive adapter). I just wonder why it is necessary to declare root in each loop over and over again ( root = Connection("/dev/ttyS1") )? Why it is not possible to declare it just once at the beginning of the code before jumping in to the infinitive loop. Petr Jakes ======== working example ============== import time from pyowfs import Connection while 1: try: t1 = time.time() root = Connection("/dev/ttyS1") # root = Connection("u") s = root.find(type="DS2401")[0] # iButton ROM s.use_cache (0) for s in root.find () : print s for e in s.iter_entries(): print "%s:" % e, s.get ("%s" % e) t2 = time.time() print t2 - t1 time.sleep(0.5) except (AttributeError, IndexError): print "iButton not pluged" time.sleep(0.5) except KeyError: print "did not get all data, iButton unpluged too early"
------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________ Owfs-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/owfs-developers
