Argon one v3 power button and fan scripts issue

Then something seems wrong with the communication with the MCU inside the case or the worker thread isn’t running.
Can you please check if these lines are in your /flash/config.txt

dtoverlay=gpio-ir,gpio_pin=23
dtparam=i2c=on
enable_uart=1

I have no RPi5 device to test it and need your feedback if it has really changed with RPi5. It looks like it should configured to:

dtoverlay=gpio-ir,gpio_pin=23
dtparam=i2c=on
dtparam=uart0=on

#dtoverlay=gpio-ir,gpio_pin=18

dtparam=i2c=on
enable_uart=1

dtparam=fan_temp0=47000
dtparam=fan_temp0_hyst=6000
dtparam=fan_temp0_speed=165

dtparam=fan_temp1=52000
dtparam=fan_temp1_hyst=6000
dtparam=fan_temp1_speed=190

dtparam=fan_temp2=57000
dtparam=fan_temp2_hyst=6000
dtparam=fan_temp2_speed=215

dtparam=fan_temp3=61000
dtparam=fan_temp3_hyst=6000
dtparam=fan_temp3_speed=255

I put in the dtparam lines from other stuff I was trying via Google

I tried 23 and double press still does nothing

Still using version 007

FYI the fan on the Argon40 V3 expansion board has a standard 4-pin PWM connector. Just plug it into the RPI board and it will work exactly like the stock fan. I don’t know why they don’t spec it out that way, or wire it up with a pass-through connection.

1 Like

tried version 006d but I am getting exceptions.

No module names smbus line argon.py line 30

2024-02-17 17:46:41.290 T:997 error : Exception in thread
2024-02-17 17:46:41.290 T:997 error : Thread-2 (thread_powerbutton)
2024-02-17 17:46:41.290 T:997 error : :

2024-02-17 17:46:41.290 T:997 error :
2024-02-17 17:46:41.290 T:997 error : Traceback (most recent call last):

2024-02-17 17:46:41.290 T:997 error :
2024-02-17 17:46:41.290 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py”, line 101, in pin

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error : pin = self.pins[n]
2024-02-17 17:46:41.291 T:997 error :

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 info : Skipped 9 duplicate messages…
2024-02-17 17:46:41.291 T:997 error : ~
2024-02-17 17:46:41.291 T:997 info : Skipped 8 duplicate messages…
2024-02-17 17:46:41.291 T:997 error : ^
2024-02-17 17:46:41.291 T:997 info : Skipped 2 duplicate messages…
2024-02-17 17:46:41.291 T:997 error :

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error : KeyError
2024-02-17 17:46:41.291 T:997 error : :
2024-02-17 17:46:41.291 T:997 error : 4
2024-02-17 17:46:41.291 T:997 error :

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error :

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error : During handling of the above exception, another exception occurred:

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error :

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error : Traceback (most recent call last):

2024-02-17 17:46:41.291 T:997 error :
2024-02-17 17:46:41.291 T:997 error : File “/usr/lib/python3.11/threading.py”, line 1038, in _bootstrap_inner

2024-02-17 17:46:41.292 T:997 error :
2024-02-17 17:46:41.292 T:997 error : File “/usr/lib/python3.11/threading.py”, line 975, in run

2024-02-17 17:46:41.292 T:997 error :
2024-02-17 17:46:41.292 T:997 error : File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/service.py”, line 15, in thread_powerbutton

2024-02-17 17:46:41.293 T:997 error :
2024-02-17 17:46:41.293 T:997 error :
2024-02-17 17:46:41.293 T:997 error : argon.shutdown_check()
2024-02-17 17:46:41.293 T:997 error :

2024-02-17 17:46:41.293 T:997 error :
2024-02-17 17:46:41.293 T:997 error : File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/argon.py”, line 62, in shutdown_check

2024-02-17 17:46:41.294 T:997 error :
2024-02-17 17:46:41.294 T:997 error :
2024-02-17 17:46:41.294 T:997 error : btn = Button(shutdown_pin, pull_up = False)
2024-02-17 17:46:41.294 T:997 error :

2024-02-17 17:46:41.294 T:997 error :
2024-02-17 17:46:41.294 T:997 error :
2024-02-17 17:46:41.294 T:997 info : Skipped 9 duplicate messages…
2024-02-17 17:46:41.294 T:997 error : ^
2024-02-17 17:46:41.294 T:997 info : Skipped 36 duplicate messages…
2024-02-17 17:46:41.294 T:997 error :

2024-02-17 17:46:41.294 T:997 error :
2024-02-17 17:46:41.294 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py”, line 108, in call

2024-02-17 17:46:41.296 T:997 error :
2024-02-17 17:46:41.296 T:997 error :
2024-02-17 17:46:41.296 T:997 error : self = super(GPIOMeta, cls).call(*args, **kwargs)
2024-02-17 17:46:41.296 T:997 error :

2024-02-17 17:46:41.296 T:997 error :
2024-02-17 17:46:41.296 T:997 error :
2024-02-17 17:46:41.296 T:997 info : Skipped 10 duplicate messages…
2024-02-17 17:46:41.296 T:997 error : ^
2024-02-17 17:46:41.296 T:997 info : Skipped 45 duplicate messages…
2024-02-17 17:46:41.296 T:997 error :

2024-02-17 17:46:41.296 T:997 error :
2024-02-17 17:46:41.296 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/input_devices.py”, line 414, in init

2024-02-17 17:46:41.297 T:997 error :
2024-02-17 17:46:41.297 T:997 error :
2024-02-17 17:46:41.297 T:997 error : super(Button, self).init(
2024-02-17 17:46:41.297 T:997 error :

2024-02-17 17:46:41.297 T:997 error :
2024-02-17 17:46:41.297 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/mixins.py”, line 433, in init

2024-02-17 17:46:41.298 T:997 error :
2024-02-17 17:46:41.298 T:997 error :
2024-02-17 17:46:41.298 T:997 error : super(HoldMixin, self).init(*args, **kwargs)
2024-02-17 17:46:41.298 T:997 error :

2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/input_devices.py”, line 165, in init

2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error : super(DigitalInputDevice, self).init(
2024-02-17 17:46:41.299 T:997 error :

2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/mixins.py”, line 218, in init

2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error : super(EventsMixin, self).init(*args, **kwargs)
2024-02-17 17:46:41.299 T:997 error :

2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/input_devices.py”, line 83, in init

2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.299 T:997 error : super(InputDevice, self).init(pin, pin_factory=pin_factory)
2024-02-17 17:46:41.299 T:997 error :

2024-02-17 17:46:41.299 T:997 error :
2024-02-17 17:46:41.300 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py”, line 549, in init

2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error : pin = self.pin_factory.pin(pin)
2024-02-17 17:46:41.301 T:997 error :

2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 info : Skipped 9 duplicate messages…
2024-02-17 17:46:41.301 T:997 error : ^
2024-02-17 17:46:41.301 T:997 info : Skipped 24 duplicate messages…
2024-02-17 17:46:41.301 T:997 error :

2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py”, line 103, in pin

2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error : pin = self.pin_class(self, n)
2024-02-17 17:46:41.301 T:997 error :

2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 info : Skipped 9 duplicate messages…
2024-02-17 17:46:41.301 T:997 error : ^
2024-02-17 17:46:41.301 T:997 info : Skipped 22 duplicate messages…
2024-02-17 17:46:41.301 T:997 error :

2024-02-17 17:46:41.301 T:997 error :
2024-02-17 17:46:41.301 T:997 error : File “/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/rpigpio.py”, line 111, in init

2024-02-17 17:46:41.302 T:997 error :
2024-02-17 17:46:41.302 T:997 error :
2024-02-17 17:46:41.302 T:997 error : GPIO.setup(self.number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
2024-02-17 17:46:41.302 T:997 error :

2024-02-17 17:46:41.302 T:997 error :
2024-02-17 17:46:41.302 T:997 error : RuntimeError
2024-02-17 17:46:41.302 T:997 error : :
2024-02-17 17:46:41.302 T:997 error : Cannot determine SOC peripheral base address
2024-02-17 17:46:41.302 T:997 error :

@smesser
sorry, you are right - I have this overseen. 0.0.6d can’t work with LE 11.x because this version was build against LE12 nightly and the library path within the system-tools Add-on has change from “…/virtual.system-tools/lib” to “…/virtual.system-tools/lib.private”. If you revert that in the argon.py and poweroff.py files of version 0.0.6d, it should work with LE11.

In the meantime I had released version 0.0.8 with a fix against the fan fluctuation.

If you want to use the IR receiver of the Argon One case, you should change “gpio_pin=18” to “gpio_pin=23” and remove the hashtag at this line.

The other parameters you manually set will only work with the origin PWM connector at RPi 5 pcb. If wmorgan is right, probably you should switch the fan connection to that way.

Can you show me that in the picture? I do not have much experience.

@smesser,

I have released version 0.0.9a to fix the power button recognition with RPi5.

The bad news is, there will be no improvement regarding the power button if you stick with LE11. LE11 uses RPi.GPIO, which does not support the Pi5. The newer backend lgpio supports the RPi5, but is only included in the RPi-Tools add-on for LE12.

I tried changing the fan plug from the Argon case board to the Pi5 and the unit wouldn’t turn on at all.

@HarryH Not sure how stable LE12 is, I just barely started using LE11 for the Pi5

I tried the latest nightly of 12 and it didn’t go well

2024-02-17 19:29:08.012 T:1001 error : CCurlFile::CReadState::FillBuffer - (0xcacdcde8) Failed: URL using bad/illegal format or missing URL(3)
2024-02-17 19:29:08.012 T:1001 error : CCurlFile::Open - <http://192.168.1.116:3911/ http://[fe80::fe3f:dbff:febc:9c10]:3911/> Failed with code 0:

2024-02-17 19:44:48.317 T:954 info : CActiveAESink::OpenSink - initialize sink
2024-02-17 19:44:48.317 T:954 info : CAESinkALSA::Initialize - Attempting to open device “sysdefault:CARD=vc4hdmi1”
2024-02-17 19:44:48.319 T:954 info : CAESinkALSA::Initialize - Opened device “sysdefault:CARD=vc4hdmi1”
2024-02-17 19:44:48.320 T:954 info : CAESinkALSA::InitializeHW - Unable to open the required number of channels
2024-02-17 19:44:48.320 T:954 info : CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2024-02-17 19:44:48.320 T:954 info : CAESinkALSA::InitializeHW - Using data format AE_FMT_S24NE3
2024-02-17 19:44:49.020 T:964 error : DoWork - Direct texture file loading failed for resource://resource.images.studios.coloured/
2024-02-17 19:44:50.667 T:939 info : Loading skin file: Settings.xml, load type: KEEP_IN_MEMORY
2024-02-17 19:44:54.268 T:939 info : Loading skin file: AddonBrowser.xml, load type: KEEP_IN_MEMORY
2024-02-17 19:44:57.878 T:939 info : Loading skin file: FileBrowser.xml, load type: KEEP_IN_MEMORY
2024-02-17 19:45:08.340 T:985 info : CPythonInvoker(7, /storage/.kodi/addons/script.service.argonforty-device/main.py): waiting on thread 3893998208
2024-02-17 19:45:11.351 T:964 error : CPythonInvoker(7, /storage/.kodi/addons/script.service.argonforty-device/main.py): script didn’t stop in 5 seconds - let’s kill it
2024-02-17 19:45:11.510 T:964 info : CAddonMgr::FindAddon: script.service.argonforty-device v0.0.6d installed
2024-02-17 19:45:11.670 T:1327 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<–
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class ‘ModuleNotFoundError’>
Error Contents: No module named ‘smbus’
Traceback (most recent call last):
File “/storage/.kodi/addons/script.service.argonforty-device/main.py”, line 4, in
from resources.lib import service
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/service.py”, line 11, in
from resources.lib import argon
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/argon.py”, line 30, in
import smbus
ModuleNotFoundError: No module named ‘smbus’
–>End of Python script error report<–

2024-02-17 19:45:18.178 T:985 error : Exception ignored in:
2024-02-17 19:45:18.178 T:985 error : <module ‘threading’ from ‘/usr/lib/python3.11/threading.pyc’>
2024-02-17 19:45:18.178 T:985 error :

2024-02-17 19:45:18.178 T:985 error : Traceback (most recent call last):

2024-02-17 19:45:18.178 T:985 error : File “/usr/lib/python3.11/threading.py”, line 1534, in _shutdown

2024-02-17 19:45:18.179 T:985 error : SystemExit
2024-02-17 19:45:18.179 T:985 error : :
2024-02-17 19:45:18.179 T:985 error :
2024-02-17 19:45:18.179 T:985 error :

2024-02-17 19:45:24.500 T:939 info : Loading skin file: DialogAddonInfo.xml, load type: KEEP_IN_MEMORY
2024-02-17 19:45:27.150 T:939 info : Loading skin file: DialogAddonSettings.xml, load type: KEEP_IN_MEMORY
2024-02-17 19:46:10.044 T:964 info : CServiceAddonManager: failed to stop script.service.argonforty-device (may have ended)
2024-02-17 19:46:12.796 T:1417 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<–
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class ‘ModuleNotFoundError’>
Error Contents: No module named ‘smbus’
Traceback (most recent call last):
File “/storage/.kodi/addons/script.service.argonforty-device/main.py”, line 4, in
from resources.lib import service
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/service.py”, line 11, in
from resources.lib import argon
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/argon.py”, line 30, in
import smbus
ModuleNotFoundError: No module named ‘smbus’
–>End of Python script error report<–

2024-02-17 19:46:48.080 T:1002 info : CServiceAddonManager: failed to stop script.service.argonforty-device (may have ended)
2024-02-17 19:46:52.900 T:1442 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<–
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class ‘ModuleNotFoundError’>
Error Contents: No module named ‘smbus’
Traceback (most recent call last):
File “/storage/.kodi/addons/script.service.argonforty-device/main.py”, line 4, in
from resources.lib import service
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/service.py”, line 11, in
from resources.lib import argon
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/argon.py”, line 30, in
import smbus
ModuleNotFoundError: No module named ‘smbus’
–>End of Python script error report<–

2024-02-17 19:47:01.484 T:964 info : CServiceAddonManager: failed to stop script.service.argonforty-device (may have ended)
2024-02-17 19:47:07.419 T:1449 error : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<–
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class ‘ModuleNotFoundError’>
Error Contents: No module named ‘smbus’
Traceback (most recent call last):
File “/storage/.kodi/addons/script.service.argonforty-device/main.py”, line 4, in
from resources.lib import service
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/service.py”, line 11, in
from resources.lib import argon
File “/storage/.kodi/addons/script.service.argonforty-device/resources/lib/argon.py”, line 30, in
import smbus
ModuleNotFoundError: No module named ‘smbus’
–>End of Python script error report<–

2024-02-17 19:49:05.705 T:964 error : DoWork - Direct texture file loading failed for resource://resource.images.studios.coloured/

I did install raspberry Pi tools and system tools

Sorry, this sentence is ambiguous to me. Did you install Pi-Tools and system tools after this message in the log or before you started with the installation?
If you start with a clean unmodified version of LE12 I would expect that the Add-on dependencies were resolved automatically. Naturally this requires that the LE12 repos are reachable via the network at this time.

This type of error can also occur if you do not have the recommended version 0.0.9a installed. Can you please check if you have selected an older version of this? It looks like v0.0.6d with incorrect paths for LE12. Self modified?

Additionally can you please look at the system tools directory if there are the libraries and the directory not empty?
“ls -la /storage/.kodi/addons/virtual.system-tools/lib.private”

Please don’t forget to reboot after the installation to ensure that accidently hanging threads are closed and the environment variables has been initialized.

Hi,

Because currently you have no way to control the behaviour of the RPI 5 FAN aside from its default settings. No CPU temp based fan power settings and fan always on options in the raspberry pi OS. that is why we took control of the FAN via RP2040 and RPI5.

these scripts are for the Raspberry Pi OS. we are still working on the libreelec and ubuntu versions.

That is nonsense, the standard rpi OS on pi5 has settings that let you set the threshold for the 3 fan power settings, and you can perfectly well read the CPU temperature. It just works.
I am working with somebody who has replacement routine for the ONE V3. So far it is looking good.

You must have done something wrong, because I’m literally running libreelec right now, watching a 4k video with the fan connected that way. Did you connect it backwards?

@HarryH

I installed nightly build of LE12
I installed raspberry pi tools and system tools
I then installed your version 9A

Not sure which repo they were installed from

@smesser ,

please download the 0.0.9a or 0.0.10 again, install it and check the version in the KODI Addon information to going sure.

I can’t see from remote what was going wrong, but the posted log doesn’t match to version 0.0.9a. This version has no import call for smbus at line 30. Perhaps you posted the wrong log snipped. Your post is from 2024-02-20, but the log timestamps says 2024-02-17 (This was before the release of 0.0.9a. Or do you have a time travel machine? :wink:).