This repository is used to log the temperature of my Raspberry Pi 5. It utilizes rye to manage the virtual environment and nohup
to ensure that the command continues running even after the terminal is closed.
Clone the git repository and create the virtual environment. This step is only needed the first time.
git clone https://github.com/sche34/raspberrypi_temperature.git
cd raspberrypi_temperature
rye sync
Activate the virtual environment and start the scripts. This will store the temperature readings in data/readings.txt
. The output of the script (not interesting) is saved in nohup.out
.
source .venv/bin/activate
nohup run &
To stop the scripts, you will need to find the process ID. This is also returned by nohup run &. If you already have the process ID, skip the step below. Otherwise, write down the process ID that is returned by the command below and looks something like this: /home/sche34/temp_readings/.venv/bin/python3 /home/sche34/temp_readings/.venv/bin/run.
ps aux | grep python
Finally, stop the process:
kill <process ID>