Skip to content

Latest commit

 

History

162 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Display

Generates image to be rendered on a 32x16 RGB LED Grid

image

Local development

Ignore this file that is already committed git update-index --assume-unchanged static/weather.ppm

Docker compose

echo "DB_URL="sqlite:////app/database/db"" > .env
docker compose build
docker compose up

Useful commands

# Auto format
docker exec -i app black .

# Run tests
docker exec -i app python -m pytest tests

# Update the banner display
docker exec -i app python update_display.py

# Run migrations
docker exec -it app alembic upgrade head

# Bash into container 
docker exec -it app /bin/bash

# Examine db
sqlite3 db

# After editing and nginx file
sudo service nginx restart

Check the published version genreated during the docker build http://0.0.0.0:5002/persistent/version.txt

Server setup (production)

Docker restart policy

Container must have unless-stopped to survive reboots:

docker update --restart unless-stopped app

Crontab

*/5 * * * * docker exec -i app python update_display.py
0 4 * * * /sbin/reboot

Troubleshooting

If you don't have Pycharm Professional, one way to make unresolved references go away is

python3 -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Read the nginx docs and be careful what you set as your root directory, so you don't unintentionally share private files.

If you see sqlite3.OperationalError: unable to open database file or related, make sure your db file that contains the db agrees with the docker-compose.yaml volume mount

Debugging w/ strace

# you can find the process running your code
ps -aux | grep python
strace -p 1778

# and step through that process
gdb -p 1778
ls /proc/1778
lsof -p 1772

Future enhancements

  • upgrade python version
  • start using uv and pin package versions
  • move to a hosted db
  • use AI to filter messages before posting

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages