Giter VIP home page Giter VIP logo

frozen_temp's Introduction

Votuzilec sensor chart

Plot screenshots

Measurement chart:

Measurement chart

Statistics chart:

Statistics chart

Raspberry Pi installation (python, sqlite - lite version)

Install software (apache, php, git)

  sudo apt update
  sudo apt upgrade

  sudo apt install apache2
  sudo chown -R pi:www-data /var/www/html/
  sudo chmod -R 770 /var/www/html/
  sudo apt install php

  sudo apt install git

Get project files from git repository

  git clone https://github.com/ondrejh/frozen_temp.git
  cd frozen_temp
  ./get_plotly.sh

Copy page files

  cp ploly.min.js /var/www/html/
  cp index.php /var/www/html/

Start cron to get data every 15 minutes and last day statistics every day at 00:20

  crontab -e
    .. navigate to the end of file and type
    */15 * * * * python3 /home/pi/get_data.py
    20 0 * * * python3 /home/pi/get_data.py -s
    .. save

Restart apache

  sudo service apache2 restart

MySQL and PHP version instalation

Secure MySQL installation

  sudo mysql_secure_installation
  sudo apt install mariadb-server php-mysql

Create MySQL user and privileges

  sudo mysql --user=root --password
  > create user admin@localhost identified my '1243';
  > grant all privileges on *.* to admin@localhost;
  > FLUSH PRIVILEGES;
  > exit;

Create database

  mysql --user=admin --password
  > CREATE DATABASE votuzilec;
  > exit;

Copy files

  cp plotly.min.js /var/www/html/
  cp index.php get_data.php /var/www/html

Start cron to get data every 15 minutes

  crontab -e
    .. navigate to the end of file and type
    */15 * * * * php /var/www/html/get_data.php
    20 0 * * * php /var/www/html/statistics.php
    .. save

Restart apache

  sudo service apache2 restart

ToDo:

  • sqlite version using php
  • hw display

Sources:

LAMP installation: https://randomnerdtutorials.com/raspberry-pi-apache-mysql-php-lamp-server/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.