Operating system configuration - visuve/SykeroLabs3 GitHub Wiki
Basics
- In order to make the PWM and 1-Wire to work
/boot/firmware/config.txt
needs to be stabbed.
Access
- To allow SykeroLabs to control PWM, create/edit
/etc/udev/rules.d/99-com.rules
and add:
SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\
chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\
chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\
'"
Power optimization
- I found the Raspberry Pi 5 to consume too much power
- With these optimizations I managed to reduce the consumption by about half a watt
- Underclocking the Raspberry seems to yield best results
- See config.txt below
- Note that reducing the clocks below
arm_freq_min
(i.e. 1500) or gpu_freq_min
(i.e. 500) seems to have no effect, which is also noted in the official documentation
- Disable the onboard leds
- See config.txt below
- Note that this works somewhat poorly with the current kernel and will turn the power led just red...
- You can disable services which are not used by this project:
- Bluetooth
sudo systemctl disable bluetooth.service
- Also note the
dtoverlay=disable-bt
below
- ModemManager
sudo systemctl disable ModemManager.service
- Manually set the power supply size
- Run
sudo rpi-eeprom-config --edit
and add PSU_MAX_CURRENT=3000
- This does not necessarily affect the power consumption if your PSU was small enough in the first place
Full /boot/firmware/config.txt
# I do not care about monitors or audio;
# this is a headless setup
auto_initramfs=1
camera_auto_detect=0
display_auto_detect=0
disable_fw_kms_setup=1
disable_overscan=1
disable_splash=1
dtparam=audio=off
enable_tvout=0
arm_64bit=1
# Underclock
arm_boost=0
arm_freq=1500
gpu_freq=500
# Configure PWM & 1-Wire
dtoverlay=pwm,pin=12,func=4
# dtoverlay=w1-gpio,gpiopin=4
dtoverlay=i2c-sensor,bme680,addr=0x77
dtoverlay=disable-bt
# Configure ADC for TDS/EC sensors
dtoverlay=ads1115,addr=0x48
dtparam=cha_enable
dtparam=cha_datarate=0
dtparam=chb_enable
dtparam=chb_datarate=0
# Disable leds
dtparam=pwr_led_trigger=none
dtparam=act_led_trigger=none
dtparam=pwr_led_activelow=off
dtparam=act_led_activelow=off
# Limit USB current
usb_max_current_enable=0