You are most welcome Heimo.
I am not Stefano, I am Martin - sorry for the misunderstanding.

Stefano is the author of pyownet.

In my software I use python 2.7 and I have very consistent timing of
reading 25 sensors in a loop every 30 seconds.
Every second I read the status of two 8 bit I/O modules.

I do use pyownet and I am very happy with it.

The documentation of pyownet is pretty clean ;-)

https://pyownet.readthedocs.io/en/latest
<https://pyownet.readthedocs.io/en/latest/>


On 13.03.20 19:17, zeitvertreib.wiss...@web.de wrote:
> Thanks for the hint, Stephano!
>  
> I had a version with sleep(1) and varying values after fw.close. I
> got  execution times between 1.65 and 2.2 s for a run. Longest
> times at the first run.
>  
> But you address the Python problem. Python2 is outdated, no longer
> offically supported, but there are no libraries offically mentioned
> for Python3. On installation I tried sudo apt-get install  python3-ow.
> It worked without errors. But I did not find a documentation of the
> functions the library provides. For me, documentation is a mess. May
> be a generation problem.
> At the moment I'm happy with simple read an write operations in
> to files provided at /mnt/1wire and subdirectories.
>  
> Regards Heimo
>  
> *Gesendet:* Freitag, 13. März 2020 um 18:26 Uhr
> *Von:* "Martin Patzak" <martin.pat...@gmx.de>
> *An:* "OWFS (One-wire file system) discussion and help"
> <owfs-developers@lists.sourceforge.net>, zeitvertreib.wiss...@web.de
> *Betreff:* Re: [Owfs-developers] How to Use Simultaneous
> Hello Heimo,
>
> after writing to "simultaneous" you have to wait one second.
>
> For Python I would recommend you the library *pyownet *by Stefano Miccoli:
>
>  
>
>     The official OWFS bindings are
>      
>     - OW.py, based on SWIG wrapping the C API of libow
>     - ownet.py, pure python owserver client
>      
>     you will find both in debian packages 
>      
>     - python-ow, https://packages.debian.org/buster/python-ow
>     - python-ownet, https://packages.debian.org/buster/python-ownet
>      
>     My advice is to avoid the use of these packages with python3
>     (although python3 versions exist in debian) since they are not
>     actively developed.
>      
>     I’m the author of pyownet, a different package, which does not
>     belong to the official OWFS code base. It is documented at
>     <https://pyownet.readthedocs.io/en/latest/> and is available only
>     on pypi.org <http://pypi.org> since, to my knowledge, it is not
>     packaged by any major linux distribution. 
>      
>     pyownet is actively mantained, and is perfectly compatible with
>     both python3 (up from 3.3) and legacy python2 (2.7 only). 
>      
>     So if you “import pyownet” in your code you have to “pip install
>     pyownet”. The discussion in this thread is whether it is a good
>     practice to “sudo pip install pyownet” along the python packages
>     distributed by debian. In my opinion you should avoid this, and
>     instead use a virtual environment, as I tried to explain in my
>     messages.
>      
>     Bye
>      
>     Stefano
>
>  
> On 13.03.20 17:05, zeitvertreib.wiss...@web.de wrote:
>
>     Hello Jan,
>      
>     I'm sorry, you are right.
>     I do not use bash commands, I do read and write operations from a
>     Python3 program. I do it step by step, as I'm not used to Python.
>     I had a version with uncached, but there was another program error
>     and I forgot adjusting the file path.
>      
>     PATH = "/mnt/1wire/bus.0/"
>      
>     *initiation of conversion:*
>
>     while True:         # Hauptprogramm
>         t1 = time()
>         fw = open(PATH + "simultaneous" + "/temperature", "w")
>         fw.write("1")
>         fw.close()
>      
>      
>     *reading values:*
>      
>         for i in tempList:
>             deviceFile = PATH + "uncached/" + temps[i] + "/latesttemp"
>             f = open(deviceFile, "r")
>             tempBuffer = float(f.read())
>             f.close()
>             if tempBuffer != 85.0:
>                 tempw[i] = tempBuffer
>             print(temps[i], tempw[i])
>         break
>     t2 = time()
>     print(t2 - t1)
>      
>     However, now I wonder about very short conversion times, shorter
>     than 700 ms a single 12bit conversion shoul take.
>      
>     1st run:
>      
>     28.0A651B2D1901 26.625
>     28.0A35192D1901 22.875
>     28.0CB479A20003 21.75
>     28.8BE0182D1901 28.875
>     28.80A7112D1901 29.5
>     28.629B082D1901 22.75
>     28.953D062D1901 22.875
>     28.613079A20003 22.25
>     28.CF52142D1901 22.8125
>
>     1.3515775203704834   sec
>      
>     following runs
>      
>     >>> %Run TempLesen.py
>     28.0A651B2D1901 22.9375
>     28.0A35192D1901 22.9375
>     28.0CB479A20003 21.75
>     28.8BE0182D1901 23.125
>     28.80A7112D1901 23.125
>     28.629B082D1901 22.75
>     28.953D062D1901 22.875
>     28.613079A20003 22.25
>     28.CF52142D1901 22.875
>
>     0.6546370983123779   sec
>      
>     no matter whether Thonny or Bash.
>      
>     Is there a Python3 library for RaspberryPi
>      
>     Actually there is a problem when installing OWFS on Raspian Buster
>     on PIs. File system an sensors appear in duplicates. I give you a
>     link to the forum of the manufacturer of the used DS2482-100 adapter: 
>      
>     https://www.abelectronics.co.uk/forums/thread/303/owfs-duplicates
>      
>     Regards
>     H. Wissing
>      
>      
>      
>     Dr. med. habil. Dipl.- Ing. Heimo Wissing
>     Privatdozent, Arzt für Anästhesiologie,
>     Intensivmedizin und Schmerztherapie
>     Bioingenieur / Biomedizinische Technik
>     Neckarweg 1, 69118 Heidelberg
>     Tel.: 06221/801679 FAX: 06221/803738
>     mobil: 0171/4571292
>      
>      
>     *Gesendet:* Freitag, 13. März 2020 um 15:48 Uhr
>     *Von:* "Jan Kandziora" <j...@gmx.de>
>     *An:* owfs-developers@lists.sourceforge.net
>     *Betreff:* Re: [Owfs-developers] How to Use Simultaneous
>     Am 13.03.20 um 15:12 schrieb hwissing:
>     > Hello,
>     >
>     > I think one issue from the primary question is not answered..
>     >
>     > /" If I read from '/temperature' then I get them read in much faster
>     > *but I don't get a fresh conversion each time."*/
>     >
>     This is a very old question, and the mechanism has changed a bit
>     since 2008.
>
>
>
>     >
>     > I have the same issue. First conversion with 8 DS18B20 sensors takes
>     > about 1 sec, immediately following requests take about 40 ms, but
>     > values are not updated. It takes a while till updated values are
>     > acquired, then conversion takes longer.
>     >
>     That is because you read /<ID>/temperature instead of
>     /uncached/<ID>/temperature
>
>     But don't do this either. If you want simultaneos conversions, do
>     instead
>
>     $ owwrite /simultaneous/temperature 1
>     $ sleep 1s
>     $ owread /uncached/<sensor0id>/latesttemp
>     $ owread /uncached/<sensor1id>/latesttemp
>     $ owread /uncached/<sensor2id>/latesttemp
>     $ owread /uncached/<sensor3id>/latesttemp
>     $ owread /uncached/<sensor4id>/latesttemp
>     $ owread /uncached/<sensor5id>/latesttemp
>     $ owread /uncached/<sensor6id>/latesttemp
>     $ owread /uncached/<sensor7id>/latesttemp
>
>     Latesttemp has the resolution of the previous non-simultaneous
>     conversion, or, after power-up of the sensor, the resolution set
>     in the
>     sensor's EEPROM. You can adjust the through /<ID>/tempres.
>
>     See the manpage: https://github.com/owfs/owfs-doc/wiki/DS18B20
>
>     Kind regards
>
>     Jan
>
>
>     _______________________________________________
>     Owfs-developers mailing list
>     Owfs-developers@lists.sourceforge.net
>     https://lists.sourceforge.net/lists/listinfo/owfs-developers
>      
>      
>
>      
>      
>
>     _______________________________________________
>     Owfs-developers mailing list
>     Owfs-developers@lists.sourceforge.net
>     https://lists.sourceforge.net/lists/listinfo/owfs-developers
>

_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to