Skip to content

Monitor and display time/temp with RasPi and log to cloud (python3, 2020 refresh)

License

Notifications You must be signed in to change notification settings

idcrook/timetemp3

Repository files navigation

timetemp3

Monitor and display time/temp with RasPi and log to cloud

qrcode for https://idcrook.github.io/timetemp/chart/presstemp-hourly/

Photo of two LED displays with time and temperature

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

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 .

Run

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

Run as systemd service

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"

Test

# run tests from setup
python3 setup.py test

# manually run tests (pynose is nose fixed to run in >=python3.10)
pip install pynose
nosetests

TODO

See TODO.org

About

Monitor and display time/temp with RasPi and log to cloud (python3, 2020 refresh)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published