[RPi4B] Argon One Case Shutdown

  • I don't see any related errors at the log. Maybe you should create another one, because logging was just activate during that session.

    Ok, I did that, I restarted it several times, here it is:

    External Content pastebin.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • Thanks for the log.

    • Login by SSH, and use the poweroff command. Does that work correctly?
    • I've seen a Bluetooth error at the log. Not sure whether it's relevant, but disable Bluetooth, and try again.
  • myshit ,

    You will need some additional scripts that are part of the Argon Pi addon. Since the add-on was no longer maintained after the initial commit on GitHub, I ported it myself to make it work with LibreElec 10+ two years ago. I haven't touched this since then, but it still works with LibreElec 11 and you can also configure the fan speed.

    I'd have to look up the git repo and installation package. If my newly created user allows this at all, I could make it available here.

    That sounds really good. If I could also control the fan speed it would be a nice bonus since this doesn't work too (but since the CPU load is not usually very high, the passive "cooler" (case) handles ut). So, you're saying, that it could resolve the full shutdown problem? If you would be so kind and post the repo and some instructions with it i would really appreciate it.

  • Thanks for the log.

    • Login by SSH, and use the poweroff command. Does that work correctly?
    • I've seen a Bluetooth error at the log. Not sure whether it's relevant, but disable Bluetooth, and try again.

    Yes, the poweroff command is working ok via SSH. I don't think that bluetooth is has something in coincidence with it

  • Yes, the poweroff command is working ok via SSH. I don't think that bluetooth is has something in coincidence with it

    So shutting down from GUI hangs, but shutting down from SSH works as expected.

    Both tested without the Argon One case. Are those statements correct?

    If yes, then I'll ping the devs to have a look.

  • Please be aware:

    I'm not a developer of KODI Add-ons. This is only a result of someone who had the wish to get the Add-on work again with LibreELEC 10 and later.



    what it does:

    • supports LibreELEC 11 + 12 Nightly
    • supports Argon One V1/2 (RPi4)
    • supports Argon One V3 (RPi5)
    • enables IR Receiver (V2/V3, or if self added to V1 pcb)
    • enables Argon REMOTE support (rc_maps + keymap)
    • fan control
    • graceful shutdown (power button commands: Reboot , Shutdown ...)

    :!:For full support of the power button commands with a RPi5, please use LE12.



    It includes a workaround for the lgpio bug (Many thanks to HiassofT). Also thanks to Nekromantik how gaves me feedback regarding LE12 nightly and testing with the new V3 case.

    Please use the latest version of the add-on if you are using LE11 or L12 to ensure that the known bugs have been fixed.
    It might also work with LE10 (RPi4) but is untested. If someone is really using LE10 and it doesn't work, they can try version v.0.0.4. I have made the download available just for this case.

    2024/08/18 Version 1.1.2 (recommended):

    Important: The add-on download has been moved to GitHub: Download

    I have refactored something to fix some exceptions which appeared during shutdown process in the kodi.log. This speeds up the Shutdown and the Reboot time.

    Additional I have implemented a workaround for the unexpected behavior of the shutdown procedure if the power button of the remote control is used for that.

    Issue:
    :!:After the power button at remote control is pressed, KODI (OS independent) has only ~10 seconds to shutdown safety ! It can't be interrupted and is perhaps only with another case firmware correctable.

    Solution:
    To compensate that, I have optimized v0.0.10 as far I currently could to decrease the shutdown time to below 8 seconds. Depending whats currently installed and running in KODI it need sometimes longer, then the shutdown will not be graceful and data corruption is possible in the worst case.

    This behavior is only if you use the remote control power button to switch off. If the case button is in use or the power menu of KODI to shutdown, the power cut is initiated just at the end (+10 seconds).

    Another workaround for the following scenario:
    Remote control power button pressed → 10 seconds timer starts -> shutdown is initiated → red LED turns off, but it seems that it doesn't respond to the power button on the remote to get it on again.

    Please try in this situation (unsuccessful shutdown):

    • The red LED must be off
    • Press the power button on the remote control
    • Wait 10 seconds (MCU cuts off power internally)
    • Press the power button on the remote control again to boot


    Breaking change:
    :!:Additional I have switched from lircd to rc_maps/keymaps (thanks to adam.h. for providing the files). If you use a self made remote control profile for your remote control, please make a backup of your remote control configuration and/or place a lock file before installation to prevent overwriting:
    touch /storage/.config/argon40_rc.lock



    Source:

    The original sources are from there: GitHub Argon40Tech

    and here: Installation package version 0.0.1


    I have forked (26.10.2023) the Argon40 Add-on repository and pushed my changes to this repository: GitHub ArgonForty Device Configuration add-on



    Installation:
    The installation process will try to add 3 lines to the config.txt to enable the needed modules for I2C and UART. This part is not bullet proofed, because it looks only for the first line. It skips the needed modification if the line "dtparam=i2c=on" is already there. Therefore it could be better to make a backup of /flash/config.txt before to see the different.

    A few things to do (The first 3 steps in square brackets are only optional, if the dependencies can not be resolved automatically):

    • [ install RPi Tools (LibreELEC Repo -> Program Add-ons) ]
    • [ install System Tools (LibreELEC Repo -> Program Add-ons) ]
    • [ Reboot (necessary before installing the Argon Add-on so that the system tools work properly) ]
    • upload one of the attached zip files to /tmp, /storage or another place where you have access via KODI
    • Allow installation of Add-ons from external sources:
    • Enable "Settings->System->Addons->Unknown sources".
    • in the main menu within Add-ons select "Install from ZIP file", confirm the security question and switch to the folder where you uploaded the zip
    • select the ZIP file and press OK
    • after installation: Ignore the "Device Configuration Error" teaser message and reboot, so that the modules for UART and I2C are activated

    Within Add-ons list, the ArgonForty Device Configuration Add-on should be available now. There you can configure the fan settings and the shutdown should work now. Please be patient, it will take a few seconds for the LED to turn off.

    Important: The add-on download has been moved to GitHub: Download

  • So shutting down from GUI hangs, but shutting down from SSH works as expected.

    Both tested without the Argon One case. Are those statements correct?

    If yes, then I'll ping the devs to have a look.

    It shutdowns ok with SSH or from GUI. The only thing is the red LED that still keeps turned on preveting me from turn the Rpi again back on after shutdown - I have to manually press the button for few seconds.

  • It shutdowns ok with SSH or from GUI. The only thing is the red LED that still keeps turned on preveting me from turn the Rpi again back on after shutdown - I have to manually press the button for few seconds.

    I see. Then the shutdown actually doesn't work as expected, because the red LED stays on.

    The cause of such issues is often a file system with errors. Broken file systems can't be unmounted at shutdown. If you only use the microSD for files, then install LE from scratch, or use a repair tool for checking / repairing.

  • Hi Da Flex ,

    I hope I can remind me right, because these information are 2 years old... ;)

    There are at least 2-3 revisions of the Argon One case. The newer ones even have an infrared receiver on board. The power-on button is not directly connected to the Pi. In between is a circuit board with a microcontroller. This is responsible for switching off the power supply to the Raspberry after shutting down. The microcontroller recognizes the signal at the power-on button and can also trigger a RESET (different PIN on the Raspberry) by pressing the power-on button twice in quick succession. If you press this button longer than 3x seconds, the Raspberry will be shut down and the power will be switched off after a delay. It may be that this behavior depends on the firmware version of the microcontroller and could be different with the first batch of the casing.

    If you shut down the Raspberry via OS, the microcontroller in the Argon One lacks the information that its allowed to cut the power supply. Therefore, after an orderly shutdown, the red LED at the front, behind the semi-transparent plastic cover, remains on. However, the microcontroller also knows a return channel via PIN on the UART interface. This PIN changes its logic level after shut down of the Pi and the microcontroller starts the process to cut the power of the Raspberry Pi. This has to be configured specifically on every OS and with every startup. It's part of the ArgonForty Device Configuration add-on, for example. Alternatively, there are some other scripts/daemons that do something similar.

  • It shutdowns ok with SSH or from GUI. The only thing is the red LED that still keeps turned on preveting me from turn the Rpi again back on after shutdown - I have to manually press the button for few seconds.

    I have a feeling, you want something what's never existed.

    I have 3 RPi's and using with LE for years. And the red LED after shutdown always remains on, and to start again always needs to do a power cycle. That is how the RPi works with LE. It's not like a "normal" PC, with stand-by part in power source and with IO chip always powered, ready to react if the power button is pressed (and with a hidden power consumption in stand-by...).

    The RPi have only a single GPIO input able to force to boot again if is activated with a button.

    If you have concerns about the "LED red light", I think that LED can be disabled in config.txt.

    If you have concerns about power consumption, after RPi "shutdown", the most part it's the power source itself (like any phone charger, have some consumption even if no phone connected), so switching of the main power can be the solution.

  • That does the trick :) the red LED turns off after shutdown command from GUI (I didn't test it with SSH), I can turn Rpi back on after that and the fan control also works. All of that is working under LE 11.0.3 version. I want to thank you very much for the solution as well as I want to thank everyone else for their answers, what a great community, I've never seen that before ^^

  • myshit,

    You're welcome. Nice to read that it's working for you now.

    Da Flex
    I have reviewed the python scripts again. To be technical correct I should revise my posting (#28)

    • the microcontroller supports Reboot (double-tab at power-on button) and not RESET
    • the microcontroller signals 2 different requests (Reboot, Shutdown) at PIN7 of the Pi4 board
    • during shutting down a script sends 2 messages at SMBus (i2C) back to the microcontroller
      - first message : stop fan
      - second message: initiate power off, cut when the serial pin goes 'down'
      More information about this are available here: https://github.com/Argon40Tech/Argon40case

    These things are only working if a service is running in the background to make cycling checks at PIN7 for new message from the microcontroller. The shutdown script is a hook during the LibreELEC OS shutdown: https://wiki.libreelec.tv/configuration/startup-shutdown

  • I'm late but give my 5 cents anyways. ^^

    I'm actually doing "both" what's discussed here by the press on a MCE remote with the kind help of an IR-Receiver/Blaster.

    So in the end I always have AC power cut (no standby power) but also have LE shut down properly before cutting the power. To turn my home theater ON or OFF is just one button on the remote and the IR-Receiver/Blaster orchestrates the rest (Turning the AC Plug On, send signals to Screen, Amp, LE Box to turn on or vice versa with proper delay for LE to shut down completely. I don't use/need any scripts in LE for this to work.

  • Add-On was update to version 0.0.7.

    Thanks for maintaining this addon its great.

    Using a V3 case with an LE12 nightly and addon v0.0.7, the fan pulses every 20-30 seconds. Is this expected behavior? LE is reporting temps of about 42c and fan thresholds are the default.

  • Using a V3 case with an LE12 nightly and addon v0.0.7, the fan pulses every 20-30 seconds. Is this expected behavior?

    If the on/off frequency of the fan is pretty constant, then I would say it's expected behavior. My power LED (always-on expected) had random on/off cycles without that fix.

  • PANiCnz ,

    your are the second which reports this behavior with Argon One V3 in combination with 0.0.7. So there seems really to be an issue within the current code.
    Currently I can't reproduce with my V2 case... it could takes longer to find the root cause.

    As long the CPU temperatur is below the first threshold, the fan should be off. Pulsing is possible if the current temperature is around the threshold. 42c is far away from the 55c default value. I fear I have possibly insert this bug as I switched over to the Argon Register Helper methods, which has a mechanism included to differentiate the firmware versions.

    From the testing with Argon V3 case exists a version 0.0.6d, but this version should only be used with LE12 + Argon One V3 cases, because the commands were changed for the new firmware. I don't know if there are also V2 cases with this type of firmware in the wild.

    Edit: This bug was fixed beginning with v.0.0.8. Please update to a current version of the add-on.

    Edited 2 times, last by HarryH (February 23, 2024 at 7:05 AM).