On this page
The software source is now also hosted in the CHEERS registered download library. Download and unpack that ZIP to obtain the wind-bearer-software folder, then follow the environment and package-installation steps below. The original GitLab clone route is retained as an alternative. Remote-server settings in the CHEERS copy are examples and must be configured locally.
To install the software for the weather station, head to the GitLab repo and download the source code for the WindBearer software. Do so by either clone the whole repository
git clone reponame
or use GitLab’s GUI, using which you can also avoid downloading all irrelevant documentation files inside the repository: Hover into the projects/wind-bearer-software folder in the GitLab’s GUI and install the folder as a zip by clicking on Code and then on zip within Download this Directory. Then unzip the file in the desired location
unzip wind-bearer-software
Alternatively, you can download the software as zip-file from this static download link <https://tropmed29-hyg.urz.uni-heidelberg.de/f/275032421e194017be75/?dl=1>.
Enabling the I2C Interface
The software requires that the Raspi’s I2C interface to be enabled before it can be run. To enable it, open the configuration
sudo raspi-config
This will open an interface, which can be controlled using the arrow keys and the Enter key. Toggle the selection to 3 Interface Options and hit Enter. You will be asked Would you like the ARM I2C interface to be enabled? to which you should agree. Afterwards, select Finish in the main menu and reboot your Raspi.
Setting up a Python Virtual Environment
The weather station’s software requires some dependencies to be installed. We recommend using a virtual environment to isolate the required packages from the system’s Python and to avoid any compatibility issues. To simplify managing different versions and virtual environments, we use pyenv. We copy the necessary steps from their installation guide (see the readme on the link above) here for clarity. Note that these may have become deprecated and you might have to follow the readme above. Start by installing pyenv
curl -fsSL https://pyenv.run | bash
and adding pyenv to your shell environment
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
Do the same thing for login shells, e.g. the shell you use when you remote access the Raspi through SSH. First, check if any of the files ~/.profile, ~/.bash_profile, or ~./bash_login exist. If this is the case, replace FILEPATH in the code snippet below by the corresponding file name (e.g., ~/.profile if ~/.profile exists) and execute the snippet
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> FILEPATH
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> FILEPATH
echo 'eval "$(pyenv init - bash)"' >> FILEPATH
Finally, apply these changes by restarting the shell.
exec "$SHELL"
Now that pyenv is installed and set up, we create a Python 3.9.2 environment, so that we can avoid any version conflicts. First, some Python build dependencies need to be installed by
sudo apt update; sudo apt install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
Then we can install Python 3.9.2 with pyenv
pyenv install 3.9.2
and create a virtual environment for the project
pyenv virtualenv 3.9.2 windbearer
We chose windbearer as the name for our virtual environment, but feel free to use any other name.
Lastly, verify that everything works as it is supposed to by activating the windbearer environment
pyenv activate windbearer
and checking if python is run from within this environment by executing
python --version
and verifying that it outputs Python 3.9.2.
Installing Required Packages
Now that you have set up the virtual environment, you can go ahead with installing the required Python packages. Make sure that your windbearer environment is activated throughout the next few steps.
First head to the location of the requirements.txt file (assuming the windbearer software folder is located in /home/pi)
cd /home/pi/wind-bearer-software
and install all specified packages using pip
pip install -r requirements.txt
Afterwards, install the local wind-bearer-software library for convenience using pip:
pip install -e /home/pi/wind-bearer-software
We used the editable mode for installing the library, as the parameters to the software have not been set yet. Also, during the operation of the weather station, you might want to change some of these parameters. Verify that the software as well as all requirements were successfully installed by executing
python -m wind_bearer_software.mr_V6
If the parameters have not been set yet, you will most likely encounter a FileNotFoundError. Though, the script mr_V6 should have been successfully started without any ImportError or ModuleNotFoundError.
