Sujet : Re: 1-wire behaviour on Bookworm
De : jpsa (at) *nospam* cantab.net (John Aldridge)
Groupes : comp.sys.raspberry-piDate : 20. Sep 2024, 11:17:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <MPG.41575c0e6e1470fe9897c0@news.eternal-september.org>
References : 1
User-Agent : MicroPlanet-Gravity/3.0.11 (GRC)
In article <
vcgrag$gsv0$2@dont-email.me>,
news@druck.org.uk says...
After getting another Pi 5, I've moved a Pi 4B running Bookworm in to
the role taken by a Pi 3B running Bullseye, which is monitoring 6
ds18b20 sensors, configured as 2 1-wire buses with 3 sensors on each.
With the Pi 3B, I could either read the sensors sequentially taking
about 0.9s each, or using threads simultaneously in 1.0s. The Pi 4B with
Bookworm reads the sensors sequentially a shade faster at just over
0.8s, but when reading simultaneously, returns 2 after 0.8s, another 2
after 1.6s and the last two at 2.4s.
Anyone have an explanation for this?
No, but AIUI the "right" way to do this is to send the text "trigger" to
/sys/bus/w1/devices/w1_bus_master1/therm_bulk_read before reading the
values as normal. The trigger causes them all to start a conversion at
once, following which the reads all complete immediately once a single
conversion time has elapsed.
As a quick hack, try executing the following before reading your
sensors...
sudo su <<EOF
echo trigger > /sys/bus/w1/devices/w1_bus_master1/therm_bulk_read
EOF
-- John