ChristianSauer / gas_meter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

Setup:

  1. Create ssd image with Raspberry Pi Imager
  2. put ssd file into boot partition
  3. put wpa_supplicant.conf from this project into boot partition

Connect

  1. Boot up PI
  2. Connect as pi@ip and raspberry as password
  3. setup camera:
    1. sudo raspi-config
    2. Interface options
    3. camera -> on
    4. reboot sudo reboot
    5. test: raspistill -v -o test.jpg && python3 -m http.server 8080
    6. access url and see image, e.g. http://192.168.178.60:8080/test.jpg
  4. Create app folder:
sudo mkdir /opt/app
sudo chown pi /opt/app
  1. Copy code from this folder to the remote folder, e.g. via VS code ssh

  2. make python3 default: see https://raspberry-valley.azurewebsites.net/Python-Default-Version/

sudo update-alternatives --list python
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
python --version
  1. install necessary libs:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
cd /opt/app
export POETRY_VIRTUALENVS_CREATE="false"
source $HOME/.poetry/env
poetry install --no-dev --no-root
  1. setup tesseract: we need 4.1.x not 4.0.0 See https://notesalexp.org/tesseract-ocr/ additionally
sudo apt-get install tesseract-ocr-eng
or if this does not work:
cd /usr/share/tesseract-ocr/5/tessdata
sudo wget https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata
  1. setup ravendb

For RavenDb:

  1. explain dbs to build (debug and readings), expirs!

  2. setup service

sudo cp gasmeter.service /etc/systemd/system/gasmeter.service
sudo systemctl start gasmeter.service
sudo systemctl enable gasmeter.service

About


Languages

Language:Python 100.0%