• 1-wire behaviour on Bookworm

    From druck@3:770/3 to All on Thursday, September 19, 2024 10:36:16
    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?

    It's not a problem as I changed some time ago from performing one
    simultaneous read every 5 minutes to reading sequentially every minute
    and averaging over 15 minutes.

    ---druck

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to druck on Thursday, September 19, 2024 23:50:33
    On Thu, 19 Sep 2024 10:36:16 +0100, druck wrote:

    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.

    Is this Python code? Python threading cannot currently take full advantage
    of multiple CPUs, owing to having to serialize all interpreter operations through the “Global Interpreter Lock”.

    This is going to be fixed from 3.13 onwards.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From John Aldridge@3:770/3 to All on Friday, September 20, 2024 11:17:20
    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

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to All on Friday, September 20, 2024 21:18:14
    T24gMjAvMDkvMjAyNCAwMDo1MCwgTGF3cmVuY2UgRCdPbGl2ZWlybyB3cm90ZToNCj4gT24g VGh1LCAxOSBTZXAgMjAyNCAxMDozNjoxNiArMDEwMCwgZHJ1Y2sgd3JvdGU6DQo+IA0KPj4g V2l0aCB0aGUgUGkgM0IsIEkgY291bGQgZWl0aGVyIHJlYWQgdGhlIHNlbnNvcnMgc2VxdWVu dGlhbGx5IHRha2luZw0KPj4gYWJvdXQgMC45cyBlYWNoLCBvciB1c2luZyB0aHJlYWRzIHNp bXVsdGFuZW91c2x5IGluIDEuMHMuIFRoZSBQaSA0QiB3aXRoDQo+PiBCb29rd29ybSByZWFk cyB0aGUgc2Vuc29ycyBzZXF1ZW50aWFsbHkgYSBzaGFkZSBmYXN0ZXIgYXQganVzdCBvdmVy DQo+PiAwLjhzLCBidXQgd2hlbiByZWFkaW5nIHNpbXVsdGFuZW91c2x5LCByZXR1cm5zIDIg YWZ0ZXIgMC44cywgYW5vdGhlciAyDQo+PiBhZnRlciAxLjZzIGFuZCB0aGUgbGFzdCB0d28g YXQgMi40cy4NCj4gDQo+IElzIHRoaXMgUHl0aG9uIGNvZGU/IFB5dGhvbiB0aHJlYWRpbmcg Y2Fubm90IGN1cnJlbnRseSB0YWtlIGZ1bGwgYWR2YW50YWdlDQo+IG9mIG11bHRpcGxlIENQ VXMsIG93aW5nIHRvIGhhdmluZyB0byBzZXJpYWxpemUgYWxsIGludGVycHJldGVyIG9wZXJh dGlvbnMNCj4gdGhyb3VnaCB0aGUg4oCcR2xvYmFsIEludGVycHJldGVyIExvY2vigJ0uDQoN Ckl0J3MgYSBDIHByb2dyYW0gdXNpbmcgcG9zaXggdGhyZWFkcy4NCg0KSSBkaWQgaW5pdGlh bGx5IHdyaXRlIGEgUHl0aG9uIHZlcnNpb24gdXNpbmcgdGhlIFRocmVhZFBvb2wgZnJvbSAN Cm11bHRpcHJvY2Vzc2luZy5kdW1teSBJdCBpcyBvbmx5IG1pbGxpc2Vjb25kcyBzbG93ZXIg dGhhbiB0aGUgQyBhcyB0aGUgDQpQeXRob24gdGhyZWFkcyBhcmUgYWJsZSB0byB5aWVsZCB3 aGVuIGdvZXMgb3V0IHRvIHRoZSBzeXN0ZW0gdG8gcmVhZCB0aGUgDQpmaWxlcyBpbiAvc3lz L2J1cy93MS9kZXZpY2VzLw0KDQo+IFRoaXMgaXMgZ29pbmcgdG8gYmUgZml4ZWQgZnJvbSAz LjEzIG9ud2FyZHMuDQoNClRoYXQgd2lsbCBiZSB2ZXJ5IHVzZWZ1bCBmb3IgcHVyZSBQeXRo b24gY29kZS4gVGhleSBhcmUgbWFraW5nIHRoaW5ncyBhIA0KYml0IGNoYWxsZW5naW5nIGJ5 IGRlcHJlY2F0aW5nIHNvbWUgb3RoZXIgdGhpbmdzIGJlZm9yZSBnZXR0aW5nIHRoZXJlLCAN CndoaWNoIEknbGwgbmVlZCB0byBzb3J0IG91dCBiZWZvcmUgbW92aW5nIG9uIGZyb20gMy4x MS4NCg0KLS0tZHJ1Y2sNCg==

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to John Aldridge on Friday, September 20, 2024 21:38:09
    On 20/09/2024 11:17, John Aldridge wrote:
    [Reading ds18b20 sensors in parallel]
    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

    Thanks, that seems to works for the first bus, but I get a permission
    denied when using w1_bus_master2.

    ---druck

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From John Aldridge@3:770/3 to All on Sunday, September 22, 2024 11:53:07
    In article <vckmfh$17vkc$2@dont-email.me>, news@druck.org.uk says...

    On 20/09/2024 11:17, John Aldridge wrote:
    [Reading ds18b20 sensors in parallel]
    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

    Thanks, that seems to works for the first bus, but I get a permission
    denied when using w1_bus_master2.

    Sorry, I've no idea why that might be :(

    Though I do recall the permission checking being a bit odd -- hence the
    "sudo su" rather than a plain "sudo".

    --
    John

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to John Aldridge on Sunday, September 22, 2024 12:45:45
    On 22/09/2024 at 11:53, John Aldridge wrote:
    In article <vckmfh$17vkc$2@dont-email.me>, news@druck.org.uk says...

    On 20/09/2024 11:17, John Aldridge wrote:
    [Reading ds18b20 sensors in parallel]
    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

    Thanks, that seems to works for the first bus, but I get a permission
    denied when using w1_bus_master2.

    Sorry, I've no idea why that might be :(

    Though I do recall the permission checking being a bit odd -- hence the
    "sudo su" rather than a plain "sudo".


    Have you tried
    'echo trigger | sudo tee /sys/bus/w1/devices/w1_bus_master1/therm_bulk_read'


    --
    Chris Elvidge, England
    HIGH EXPLOSIVES AND SCHOOL DON'T MIX

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Lawrence D'Oliveiro@3:770/3 to John Aldridge on Sunday, September 22, 2024 23:34:21
    On Sun, 22 Sep 2024 11:53:07 +0100, John Aldridge wrote:

    Though I do recall the permission checking being a bit odd -- hence the
    "sudo su" rather than a plain "sudo".

    Either you’re root or you’re not. There’s no need to say “I am root” twice.

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Townley@3:770/3 to Lawrence the troll on Monday, September 23, 2024 00:47:15
    On 23/09/2024 00:34, Lawrence the troll wrote:
    On Sun, 22 Sep 2024 11:53:07 +0100, John Aldridge wrote:

    Though I do recall the permission checking being a bit odd -- hence the
    "sudo su" rather than a plain "sudo".

    Either you’re root or you’re not. There’s no need to say “I am root”
    twice.

    Have you ever tried to manage a Linux system?

    There are distinct differences here

    Bloody trolls!

    --
    Chris

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From druck@3:770/3 to Chris Elvidge on Monday, September 23, 2024 12:17:01
    On 22/09/2024 12:45, Chris Elvidge wrote:
    On 22/09/2024 at 11:53, John Aldridge wrote:
    In article <vckmfh$17vkc$2@dont-email.me>, news@druck.org.uk says...

    On 20/09/2024 11:17, John Aldridge wrote:
    [Reading ds18b20 sensors in parallel]
    sudo su <<EOF
    echo trigger > /sys/bus/w1/devices/w1_bus_master1/therm_bulk_read
    EOF


    Have you tried
    'echo trigger | sudo tee /sys/bus/w1/devices/w1_bus_master1/therm_bulk_read'


    Yes, that works for bus 1, but not bus 2 on that Pi 4.

    On a Pi Zero 2W with 2 w1 buses, bus 1 gives the Permission denied error
    and bus 2 succeeds.

    On a Pi 3B+ with 4 w1 buses, 1 and 2 succeed, 3 and 4 fail.

    Very strange.

    ---druck

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)