X728 V2.5 - AUTO ON does not work after GPIO26 ... | Geekworm's Forum

X728 V2.5 - AUTO ON does not work after GPIO26 / x728off shutdown


  • Hello Geekworm Support,

    I have an X728 V2.5 with a Raspberry Pi 4. I found a repeatable problem with AUTO ON after a software shutdown.

    My configuration

    • Raspberry Pi 4

    • Raspberry Pi OS Trixie

    • X728 V2.5

    • AON jumper installed

    • CHG_EN jumper installed

    • Two Samsung INR18650-35E batteries

    The UPS works very well during a power failure. I tested it on battery for almost 6 hours. The safe low-battery shutdown also works correctly.

    Test 1 - Blue button

    I use the blue button on the X728 for a safe shutdown.

    • Blue button

    • Raspberry Pi shuts down

    • X728 shuts down

    • Remove external 5V

    • Apply external 5V again

    • Raspberry Pi starts automatically

    Result: AUTO ON works correctly.

    Test 2 - GPIO26 / x728off

    I use the documented command:

    x728off

    On my system this command is an alias for:

    sudo /usr/local/bin/xSoft.sh 0 26

    • x728off

    • Raspberry Pi shuts down

    • X728 shuts down

    • Remove external 5V

    • Apply external 5V again

    • Battery LEDs turn on / charging starts

    • Raspberry Pi does NOT start

    I must press the blue button to start the Raspberry Pi. I repeated this test several times with the same result.

    Test 3 - GPIO26 INPUT workaround

    I also tested the solution described in the Geekworm community forum:

    • GPIO26 HIGH

    • wait

    • GPIO26 LOW

    • wait

    • GPIO26 INPUT

    • Linux shutdown

    I tested this with the RPi.GPIO-compatible library on Raspberry Pi OS Trixie. The Raspberry Pi shuts down correctly, but AUTO ON still does not work. I repeated this test.

    Important difference

    Blue button safe shutdown -> AUTO ON works

    GPIO26 / x728off shutdown -> AUTO ON does not work

    So the AON jumper and the AUTO ON hardware function are working. It appears that the X728 is left in a different power state after the GPIO26 software shutdown.

    Questions

    1. Is this a known problem with X728 V2.5?

    2. Is there a newer xSoft.sh for X728 V2.5?

    3. Is there a different GPIO26 sequence that keeps AUTO ON working?

    4. Is there a firmware update for the X728 power controller?

    5. What is the correct method for a long power failure: battery becomes low -> Raspberry Pi safely shuts down -> external 5V returns later -> Raspberry Pi must automatically start?

    I can provide my scripts, logs and additional test results if needed.

    Thank you.

    Best regards,
    Arnold



  • This behavior is a known design limitation with how the X728 MCU tracks system state.

    The onboard MCU's AON (Auto Power-On) logic evaluates state transitions. When the blue button is pressed, the MCU registers an explicit user-initiated hardware power off, enabling AON to boot the board as soon as main power applies.

    When you issue x728off (pulling GPIO26 HIGH/LOW), the MCU cuts the main 5V rail to the Pi and enters a latched software-shutdown power-off state. In this state, the MCU expects the system to stay off until triggered manually (via the button/switch interface), causing it to ignore incoming line voltage changes.

    1. Is this a known problem with X728 V2.5?

    Yes. The X728 MCU's state machine treats GPIO-driven shutdowns differently than onboard button events. Once the MCU processes a shutdown signal over GPIO26, it remains in a latched software-off state. Applying power while in this state charges the batteries, but the MCU will not trigger the boot rail automatically.

    2. Is there a newer xSoft.sh for X728 V2.5?

    No. The official Geekworm repository still uses the standard xSoft.sh / x728off scripts. Geekworm handles all power control logic within the onboard MCU microcode, meaning script updates cannot change how the MCU interprets the GPIO26 pulse.

    3. Is there a different GPIO26 sequence that keeps AUTO ON working?

    No. Setting GPIO26 to INPUT or modifying pulse timing only alters the signal sent before OS shutdown. Once GPIO26 triggers the shutdown routine, the X728 hardware enters its latched software-off state regardless of pin state cleanup.

    4. Is there a firmware update for the X728 power controller?

    No. The MCU on the X728 board is pre-programmed and does not support user firmware flashing or field updates.

    5. Correct Method for Long Power Failures (Auto-Recovery)

    For unattended systems, do not execute x728off or sudo /usr/local/bin/xSoft.sh 0 26 on low battery.

    The correct configuration relies on the ASD (Auto Shutdown) hardware/software routine alongside the AON jumper:

    1. Keep the AON jumper installed.

    2. Keep the ASD jumper installed (ensure battery voltage is above 3.0V when bridging).

    3. Use OS-only shutdown (sudo shutdown -h now) when low battery is detected via Python monitoring (e.g., monitoring I2C Fuel Gauge / PLD pin).

      • When Linux halts gracefully (sudo shutdown -h now), it stops the CPU while the X728 power rail remains active, supplying standby power to the Pi.

      • Once the battery drains down to ~3.0V, the hardware ASD feature cuts main battery power to prevent over-discharge.

      • Because power was terminated via low-voltage threshold (rather than a software GPIO26 latch), the X728 enters a clear power-loss state.

      • When external 5V returns, the AON jumper triggers an immediate, automatic start.


  • Hi Bullseye,

    First of all, thank you for the clear and useful information. It explains our test results very well.

    I would like to test the solution you suggested next weekend.

    For your information, my X728 is powered through the DC jack using an industrial Mean Well 5 V 10 Amps power supply.

    I have one more question about the low-battery shutdown:

    With my setup, I plan to perform a safe Linux shutdown when the battery voltage goes below 3.15 V. This means there can be a period between the Raspberry Pi shutting down and the X728 itself reaching its hardware battery cutoff.

    Do you have any information about this?

    At what battery voltage does the X728 actually switch off the battery output / enter the real power-off state?

    I would also like to know, if available, approximately how long this normally takes after the Raspberry Pi has shut down.

    I plan to measure this during my test next weekend, but any information about the X728 hardware cutoff voltage would be very helpful.

    Thank you again for your help.

    Best regards,
    Arnold


  • Hi Bullseye, and everyone interested in finding a solution for the AUTO_ON function. :)

    Today I tested the following:

    I added:

    dtoverlay=gpio-poweroff,gpiopin=26,timeout_ms=6000

    to my X728 V2.5 configuration.

    shutdown -h now performs a clean Linux shutdown, and the X728 switches off completely after approximately 5–6 seconds.

    However, when I restore the external 5 V supply through the DC jack, AUTO_ON still does not start the Raspberry Pi. I still have to press the blue button manually.

    So unfortunately, the gpio-poweroff overlay does not solve the AUTO_ON problem on my X728 V2.5.

    Question regarding ASD

    In your earlier reply you mentioned using ASD (Auto Shutdown) together with the AON jumper, allowing the battery voltage to fall to approximately 3.0 V, after Linux has already been safely shut down.

    I found an interesting test from a German Raspberry Pi forum. A user with an X728 V2.5 reported that the X728 had still not switched off at approximately 2.8 V, and stopped the test at that point to avoid further discharge of the 18650 batteries.

    This makes me a little concerned about relying on an automatic hardware shutdown at approximately 3.0 V.

    Do you know:

    1. Is ASD available and enabled on the X728 V2.5?
    2. Is there a separate ASD jumper or setting on the V2.5?
    3. At what battery voltage should the X728 V2.5 actually switch itself completely off?
    4. Is this cutoff handled by hardware, firmware, or by the Raspberry Pi software?

    I would prefer not to test below 3.0 V until we know the intended cutoff behaviour of the X728 V2.5.

    Thank you again for your help and information.

    Kind regards,
    Arnold


  • SOLVED – X728 V2.5 AUTO ON after software shutdown – Raspberry Pi OS Trixie

    Good news — the AUTO ON problem on my X728 V2.5 is solved.

    First of all, many thanks to Harry Huang and Geekworm Support for taking this issue seriously and investigating it in detail. 

    Root cause

    Geekworm investigated the GPIO26 shutdown signal with an oscilloscope and identified the actual problem.

    On the X728 V2.5, the GPIO26 HIGH pulse must not exceed two seconds. If GPIO26 remains HIGH for longer than two seconds, the X728 shuts down, but AUTO ON will not work correctly when external power is restored.

    The previous Trixie version of xSoft.sh used:

    gpioset -c $GPIOCHIP -p 2s $BUTTON=1

    Although this appeared to specify a two-second pulse, -p 2s specifies a minimum hold time and does not make gpioset exit after two seconds as intended.

    Geekworm confirmed this with oscilloscope measurements and corrected the command to:

    gpioset -c "$GPIOCHIP" -t 2s,0 "$BUTTON=1"

    This now produces the required sequence:

    GPIO26 HIGH → 2.000 seconds → GPIO26 LOW → exit

    Geekworm fix

    The functional fix was introduced in:

    552d640 – Fix software shutdown pulse and clean up power scripts

    The Trixie branch was subsequently updated to:

    4beb55b – Document libgpiod migration and AUTO ON pulse timing

    This later commit adds detailed comments explaining the problem and contains the same functional fix.

    Geekworm has now also updated the official X728-script Wiki with a dedicated section:

    “X728 V2.5: AUTO ON fix for Raspberry Pi OS Trixie”

    Existing Trixie users should note an important detail: updating the Git repository alone is not enough.

    After updating the Trixie branch, the corrected xSoft.sh must also be installed to /usr/local/bin:

    git checkout Trixie

    git pull --ff-only origin Trixie

    sudo install -m 755 xSoft.sh /usr/local/bin/xSoft.sh

    Please refer to the current Geekworm X728-script Wiki for the latest official instructions.

    My verification

    After installing the corrected Trixie xSoft.sh, I performed the complete AUTO ON test three consecutive times:

    1. Run x728off
    2. Wait until the Raspberry Pi and X728 are completely OFF
    3. Disconnect the external DC supply
    4. Wait approximately 15 seconds
    5. Reconnect the external DC supply
    6. Do not press the blue button

    Result: 3/3 successful tests.

    The Raspberry Pi automatically started every time after external power was restored.

    For reference, the exact xSoft.sh version I tested had SHA256:

    7bfc1bfeecf20b241d597f8d45592bcf695d8b5e0c5b421047af3e5f5e225926

    Previous experiments

    During this investigation I tested several other approaches, including manually resetting GPIO26 and the Raspberry Pi gpio-poweroff kernel overlay. These did not solve AUTO ON on my setup.

    With the root cause now identified, I would not recommend reproducing those earlier experiments. For Raspberry Pi OS Trixie, use the current official Geekworm Trixie scripts and instructions.

    I would especially like to thank Harry Huang from Geekworm Support. After our earlier tests continued to fail, Harry investigated the actual GPIO26 signal with an oscilloscope. That measurement identified the timing problem, after which Geekworm corrected the script and updated the documentation.

    This is excellent technical support and turned a difficult-to-understand problem into a reproducible and documented solution.

    Hopefully this update saves other X728 V2.5 / Raspberry Pi OS Trixie users some troubleshooting time.

    Problem solved — AUTO ON confirmed working 3/3.

    Best regards,
    Arnold


Please login to reply to this topic!