Making a script like argononed.py for Debian bullseye, why is their time.sleep only 0.01 seconds?

Yes, I also found his repo: tried it but it did not get my fan running as I got it with my adjusted I2C master indicator.

He seems to have forked it from a script for an Ubuntu-version and tailored it more to Debian. However it still uses RPi.GPIO which (probably) still is sysfs based and if my suspicion about the kernel’s gpiod driver locking the gpio-pin for others processes is correct the sysfs mechanism could be non-functional.

And because of the the way Debian Bullseye configured my system - with Argon One’s I2C residing at I2C master 3 - the bus=smbus.SMBus(1) still needs to be adjusted.

  • Considering the I2C-bus initialisation code: Personally I would have coded that a little bit different to separate the proper selection of which busmaster from the initialisation of that (selected) master. But that might be just a bit of Pythonic nitpicking:
i2c_master = 1 if rev in [2,3] else 0
i2c_master = 3  # Manual override from original source
bus = smbus.SMBus(i2c_master) 

Looking at his adjustments to the script did help me to find the right debian package names but then I still bumped into the quircks of the evolution from sysfs to gpiod.

FYI: Spiros Papadimitriou released code that builds a proper debian package I tried it unsuccesfully even longer ago, could be useful to look into that again (after further developed insights). He uses a lot of extra imports and I his coding style looked a too bit ‘busy’ with respect to what I am used to read.