For the functionality of the weather station and to ensure a more sufficient power supply to the Raspi, we adapted a few sections of the the /boot/firmware/config.txt file to configure some hardware settings. First, open the file
sudo nano /boot/firmware/config.txt
and check if I2C is enabled, which should be the case per default. I.e., the beginning of the file should look like this
# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
If this is not the case, make sure that I2C is enabled by replacing dtparam=i2c_arm=off by dtparam=i2c_arm=on or, if this setting is missing or commented out, by adding or uncommenting the line dtparam=i2c_arm=on. Most of our sensora communicate using the I2C and per default, a Raspi only has one dedicated I2C pin. For convenience, we usually enable more than one I2C pin, even though all sensors can technically communicate with the Raspi over a single I2C pin by using a connector. To enable more I2C pins, add
dtparam=i2c5=on
dtoverlay=i2c5
dtparam=i2c6=on
dtoverlay=i2c6
below the above section of the config.txt file to enable two more I2C pins.
Now, head to the end of the file, which should look per default like
# Run as fast as firmware / board allows
arm_boost=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[cm5]
dtoverlay=dwc2,dr_mode=host
[all]
The arm_boost is not needed for our software, thus consuming power unnecessarily. So replace the line by
arm_boost=0
Next, we reduce the frequency of the processors and the GPU in normal operation and in low power mode by adding
arm_freq=600
core_freq=300
gpu_freq=300
core_freq_min=150
gpu_freq_min=150
and reduce the upper voltage limit to 1.1V by adding
over_voltage=-2
You can find out more about the meaning of these parameters in the Raspi docs . To further reduce the power consumption, we disable Wifi and Bluetooth by adding
dtoverlay=disable-wifi
dtoverlay=disable-bt
to the end of the file. Of course, if you are using Wifi to set up your Raspi or to operate it, leave the corresponding line commented (by adding a # in the beginning) as long as you need Wifi. Other than that, the weather station requires the hardware real time clock to be enabled, which can be done by adding
dtoverlay=i2c-rtc, ds3231
and our 4G hat requires UART, so enable it by adding
enable_uart=1
Reboot the Raspi to make your changes take effect.
