Deoptim Posted June 3, 2023 Posted June 3, 2023 Attention, whatever you do next is at your own risk! Fixed dts overlay file for Armbian 23.02.2 (attached). 1. Now the system can fall asleep and wake up by a timer (without an external RTC, provided that it is powered) or by pressing a button - while wifi connects itself (if there is an automatic connection) and the system continues to work as if nothing had happened without unnecessary loading. 2. As a bonus, I added an indication of reading from a flash card as a red LED (this can be turned off). 3. I also activated the host on the micro-usb connector - now you can connect something else via the otg adapter as a third USB connector. To apply this on your system dts overlay you need (from sudo) : 1. Download the file, say, to your home directory, then execute the command from this directory: sudo dtc -@ -I dts -O dtb -o /boot/dtb/overlay/sun8i-h3-gpio-keys-led-suspend-usb-fixes.dtbo gpio-keys-led-suspend-usb-fixes.dts 2. If there are no errors, move on, if there are errors, then DO NOT continue! 3. Make a copy of the file "/boot/armbianEnv.txt": sudo cp /boot/armbianEnv.txt /boot/armbianEnv.txt.orig 4. Open the "/boot/armbianEnv.txt" file in an editor of your choice: sudo nano /boot/armbianEnv.txt (I used the nano editor) 5. Add the line "gpio-keys-led-suspend-usb-fixes" to the "overlays=" item: overlays=gpio-keys-led-suspend-usb-fixes (do not touch the rest - if you make a mistake, you will have nothing to boot later, that's why you made a backup!) if the parameter "overlays=" already has another parameter, add a space, for example: overlays=analog-codec i2c0 gpio-keys-led-suspend-usb-fixes 6. Reboot the single-boarder, if the red LED flashes during the download process, it means it is working. Additionally: To make the system fall asleep and wake up on the button, you need to execute the command: sudo systemctl suspend (Next, when you press the button (if you do not turn off the power) - it will wake up as intended) To make the system fall asleep and wake up on a timer, you need to execute the following commands (or enter into a script): sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" sudo sh -c "echo `date '+%s' -d '+ 3 minutes'` > /sys/class/rtc/rtc0/wakealarm" sudo systemctl suspend (where "3 minutes" change to your hibernation time, more details here) Current consumption in idle mode - not loaded by the CPU : Скрытый текст Current consumption in sleep mode with timer: Скрытый текст If you just turn off the consumption in about of 80-90mA P.S. Following the example, in the same way, you can wake up, for example, from a specific button by adding the wakeup-source parameter to GPIO, more details on how to add your own button here. https://www.mediafire.com/file/k8ioiezr7vuu93w/gpio-keys-led-suspend-usb-fixes.zip/file 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.