I'm building a Raspberry Pi Zero W based off-grid WiFi camera setup.
This camera will take a picture every 5 minutes with a RPi camera and send it over WiFi.
Power is controlled by an external ATtiny85 and the Raspberry Pi only needs to signal when it's done with it's work.
I've worked quite a lot at optimizing the OS (ArchLinux ARM in this case) to get the optimal performance.
Speed is key here: Every second where the Pi is running costs energy from the battery or capacitor bank.
I'm currently at 13 seconds, from USB Powerup to USB Powerdown, which is already really good, but maybe it can be optimized even further. At the current speed, every photo uses ~11Ws of energy.
My current setup looks like this:
Code: Select all
quiet root=/dev/mmcblk0p2 ro rootwait console=tty1 console=ttyAMA0,115200 selinux=0 plymouth.enable=0 dwc_otg.lpm_enable=0 elevator=noop audit=0 init=/init.sh raid=noautodetect fastboot
My init-script replaces the systemd-init, directly disables HDMI, mounts some partitions and runs wpa_supplicant to the WiFi up and running. raspistill and curl are run in parallel to this process and don't take much more time (about 5 seconds).
Code: Select all
gpu_mem=128 start_file=start_x.elf fixup_file=fixup_x.dat disable_camera_led=1 dtoverlay=pi3-disable-bt dtparam=audio=off dtparam=act_led_trigger=none dtparam=act_led_activelow=on disable_splash=1 boot_delay=0 #force_turbo=1 #dtoverlay=sdtweak,overclock_50=100
Currently, about 3-4 seconds are spent before the kernel is run. I'm not sure how much of this is down to the kernel itself, and how long the Raspberry Pi GPU init/bootloader stuff takes.
I'm still running the stock ArchLinux ARM kernel here, I should probably compile my own (much more lightweight) kernel. Any recommendations on which features take especially long?
The zImage is currently compressed as gzip, which should be pretty fast, right?
Any ideas on (either) getting the time down, or reducing the current draw of the RPi are welcome.
USB, bluetooth, HDMI aren't needed. Only WiFi and the CSI camera.