Monitor and display time/temp with RasPi and log to cloud
Based on https://github.com/idcrook/timetemp - See original project for additional hardware details, setup, and more, including a webpage that displays live charts of data.
Install pre-reqs and dependencies
# python and build system dependencies
sudo apt install -y git build-essential python3-setuptools python3-dev \
python3-pip python3-venv python3-wheel
now for the fun part
mkdir ~/projects
cd ~/projects
git clone https://github.com/idcrook/timetemp3.git
cd ~/projects/timetemp3
#
python3 -m venv .venv
source .venv/bin/activate
# workaround for pyowm dependencies (move to build dependencies??)
pip install geojson requests
# perform the python setup, which also includes dependencies
pip install .
# for development, use instead
pip install -e .
The i2c addresses in the scripts and config files may need to be updated for your hardware.
cd ~/projects/timetemp3
cp conf/weather_logging_config.example.json conf/weather_logging_config.json
# edit conf/weather_logging_config.json
touch conf/phant-config.json
# replace conf/phant-config.json with a phant data source config file
Using venv, can run the timetemp_*
wrapper scripts the Python setup.py
installed
cd ~/projects/timetemp3
source .venv/bin/activate
timetemp_7segment_clock
# <Ctrl-C> to exit
timetemp_weather_logging conf/weather_logging_config.json conf/phant-config.json
# <Ctrl-C> to exit
On my Raspberry Pi OS system, groups
includes "gpio i2c
" so these services do not need to run as root user.
Install user unit file. Assumes git clone at /home/pi/projects/timetemp3/
and has been installed
# needed for `host` command that does network connectivity check
sudo apt install bind9-host
cd /home/pi/projects/timetemp3/
conf/install_services.sh
journalctl --user --identifier="my_7segment_clock"
journalctl --user --identifier="my_weather_logging"
# run tests from setup
python3 setup.py test
# manually run tests (pynose is nose fixed to run in >=python3.10)
pip install pynose
nosetests
See TODO.org