From: <zei...@we...> - 2020-03-13 16:06:10
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello Jan,</div> <div> </div> <div>I'm sorry, you are right.</div> <div>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.</div> <div>I had a version with uncached, but there was another program error and I forgot adjusting the file path.</div> <div> </div> <div> <div>PATH = "/mnt/1wire/bus.0/"</div> <div> </div> <div><strong>initiation of conversion:</strong></div> <div><br/> while True: # Hauptprogramm<br/> t1 = time()<br/> fw = open(PATH + "simultaneous" + "/temperature", "w")<br/> fw.write("1")<br/> fw.close()</div> </div> <div> </div> <div> </div> <div><strong>reading values:</strong></div> <div> </div> <div> for i in tempList:<br/> deviceFile = PATH + "uncached/" + temps[i] + "/latesttemp"<br/> f = open(deviceFile, "r")<br/> tempBuffer = float(f.read())<br/> f.close()<br/> if tempBuffer != 85.0:<br/> tempw[i] = tempBuffer<br/> print(temps[i], tempw[i])<br/> break<br/> t2 = time()<br/> print(t2 - t1)</div> <div> </div> <div>However, now I wonder about very short conversion times, shorter than 700 ms a single 12bit conversion shoul take.</div> <div> </div> <div>1st run:</div> <div> </div> <div>28.0A651B2D1901 26.625<br/> 28.0A35192D1901 22.875<br/> 28.0CB479A20003 21.75<br/> 28.8BE0182D1901 28.875<br/> 28.80A7112D1901 29.5<br/> 28.629B082D1901 22.75<br/> 28.953D062D1901 22.875<br/> 28.613079A20003 22.25<br/> 28.CF52142D1901 22.8125</div> <div><br/> 1.3515775203704834 sec</div> <div> </div> <div>following runs</div> <div> </div> <div>>>> %Run TempLesen.py<br/> 28.0A651B2D1901 22.9375<br/> 28.0A35192D1901 22.9375<br/> 28.0CB479A20003 21.75<br/> 28.8BE0182D1901 23.125<br/> 28.80A7112D1901 23.125<br/> 28.629B082D1901 22.75<br/> 28.953D062D1901 22.875<br/> 28.613079A20003 22.25<br/> 28.CF52142D1901 22.875</div> <div><br/> 0.6546370983123779 sec</div> <div> </div> <div>no matter whether Thonny or Bash.</div> <div> </div> <div>Is there a Python3 library for RaspberryPi</div> <div> </div> <div>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: </div> <div> </div> <div><a href="https://www.abelectronics.co.uk/forums/thread/303/owfs-duplicates">https://www.abelectronics.co.uk/forums/thread/303/owfs-duplicates</a></div> <div> </div> <div>Regards</div> <div>H. Wissing</div> <div> </div> <div> </div> <div> </div> <div class="signature">Dr. med. habil. Dipl.- Ing. Heimo Wissing<br/> Privatdozent, Arzt für Anästhesiologie,<br/> Intensivmedizin und Schmerztherapie<br/> Bioingenieur / Biomedizinische Technik<br/> Neckarweg 1, 69118 Heidelberg<br/> Tel.: 06221/801679 FAX: 06221/803738<br/> mobil: 0171/4571292</div> <div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Freitag, 13. März 2020 um 15:48 Uhr<br/> <b>Von:</b> "Jan Kandziora" <jj...@gm...><br/> <b>An:</b> owf...@li...<br/> <b>Betreff:</b> Re: [Owfs-developers] How to Use Simultaneous</div> <div name="quoted-content">Am 13.03.20 um 15:12 schrieb hwissing:<br/> > Hello,<br/> ><br/> > I think one issue from the primary question is not answered..<br/> ><br/> > /" If I read from '/temperature' then I get them read in much faster<br/> > *but I don't get a fresh conversion each time."*/<br/> ><br/> This is a very old question, and the mechanism has changed a bit since 2008.<br/> <br/> <br/> <br/> ><br/> > I have the same issue. First conversion with 8 DS18B20 sensors takes<br/> > about 1 sec, immediately following requests take about 40 ms, but<br/> > values are not updated. It takes a while till updated values are<br/> > acquired, then conversion takes longer.<br/> ><br/> That is because you read /<ID>/temperature instead of<br/> /uncached/<ID>/temperature<br/> <br/> But don't do this either. If you want simultaneos conversions, do instead<br/> <br/> $ owwrite /simultaneous/temperature 1<br/> $ sleep 1s<br/> $ owread /uncached/<sensor0id>/latesttemp<br/> $ owread /uncached/<sensor1id>/latesttemp<br/> $ owread /uncached/<sensor2id>/latesttemp<br/> $ owread /uncached/<sensor3id>/latesttemp<br/> $ owread /uncached/<sensor4id>/latesttemp<br/> $ owread /uncached/<sensor5id>/latesttemp<br/> $ owread /uncached/<sensor6id>/latesttemp<br/> $ owread /uncached/<sensor7id>/latesttemp<br/> <br/> Latesttemp has the resolution of the previous non-simultaneous<br/> conversion, or, after power-up of the sensor, the resolution set in the<br/> sensor's EEPROM. You can adjust the through /<ID>/tempres.<br/> <br/> See the manpage: <a href="https://github.com/owfs/owfs-doc/wiki/DS18B20" target="_blank">https://github.com/owfs/owfs-doc/wiki/DS18B20</a><br/> <br/> Kind regards<br/> <br/> Jan<br/> <br/> <br/> _______________________________________________<br/> Owfs-developers mailing list<br/> Owf...@li...<br/> <a href="https://lists.sourceforge.net/lists/listinfo/owfs-developers" target="_blank">https://lists.sourceforge.net/lists/listinfo/owfs-developers</a></div> </div> </div> </div></div></body></html> |