reorder rc.local to improve efficiency, add leds.png

This commit is contained in:
nagumii 2024-11-20 17:29:23 +02:00
parent 14dc577dfc
commit 2752f2d3cf
2 changed files with 7 additions and 5 deletions

BIN
leds.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

View file

@ -11,6 +11,9 @@ luckfox-config load
#try enable RTC
echo 'ds1307 0x68' | sudo tee /sys/class/i2c-adapter/i2c-3/new_device > /dev/null 2>&1
# activating USER LED
echo 34 > /sys/class/gpio/export && echo out > /sys/class/gpio/gpio34/direction &
#if RTC recognized
if ls /dev/rtc* 1> /dev/null 2>&1; then
rtc="true"
@ -38,19 +41,18 @@ else
echo "Failed to fetch network time, using $(date +"%Y-%m-%d %H:%M:%S %Z") instead."
fi
echo "Disabling LED..."
echo "none" > /sys/class/leds/work/trigger &
echo 34 > /sys/class/gpio/export && echo out > /sys/class/gpio/gpio34/direction
# necessary for internet over usb in otg mode (see https://web.archive.org/web/20241006173648/https://wiki.luckfox.com/Luckfox-Pico/Luckfox-Pico-Network-Sharing-1/)
# sleep 5 && route add default gw 172.32.0.100 && echo "nameserver 8.8.8.8" >> /etc/resolv.conf
#does not appear to lower power consumption, but needs more testing
#(sleep 5 && cpufreq-set -u 408000 && echo "Boot complete, setting CPU frequency to 408mhz.") &
# run USB automount and config tool
/usr/local/bin/usbconfig.sh
echo "Disabling ACT LED..."
echo "none" > /sys/class/leds/work/trigger &
#boot complete, blink USER LED 5 times in background
(
sleep 1