GithubHelp home page GithubHelp logo

bartekl1 / rpi-thermometer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 122 KB

๐ŸŒก Raspberry Pi Thermometer

License: GNU General Public License v3.0

Python 50.46% CSS 1.31% JavaScript 27.28% HTML 20.96%
ds18b20 iot raspberry-pi raspberry-pi-projects raspberry-pi-temperature raspberry-pi-thermometer raspberrypi temperature temperature-sensor thermometer smart-home smarthome dht11 humidity humidity-sensor humidity-logger humidity-monitoring temperature-logger temperature-monitoring

rpi-thermometer's Introduction

๐ŸŒก Raspberry Pi Thermometer

GitHub release (latest by date) GitHub Repo stars GitHub watchers GitHub forks

๐Ÿ•‘ Changelog ๐ŸŽ Acknowledgements ๐Ÿ‡ต๐Ÿ‡ฑ Polish version of README

โ„น๏ธ About

Available sensors

  • DS18B20 (temperature)
  • DHT11 (humidity)

Available functions

  • Measure current temperature and humidity
  • Save temperature and humidity to database
  • Simple website with current readings

๐Ÿ‘จโ€๐Ÿ’ป Installation

  1. Connect the DS18B20 and DHT11 sensors to the Raspberry Pi.

  2. Clone repository

    git clone https://github.com/bartekl1/rpi-thermometer
    cd rpi-thermometer
  3. Create database and import structure from thermometer.sql file.

  4. Create configuration file named configs.json with the following content.

    {
        "host": "0.0.0.0",
        "mysql_user": "<mysql_user>",
        "mysql_password": "<mysql_password>",
        "mysql_database": "<mysql_database>"
    }

    Replace <mysql_user>, <mysql_password> and <mysql_database> with correct credentials.

  5. Install PIP dependencies.

    pip install -r requirements.txt
  6. Create /etc/systemd/system/thermometer.service file with the following content.

    [Unit]
    Description=Thermometer
    After=network.target
    
    [Service]
    WorkingDirectory=<PATH>
    ExecStart=/usr/bin/python3 <PATH>/app.py
    Restart=always
    User=<USERNAME>
    
    [Install]
    WantedBy=multi-user.target

    Replace <PATH> with path to the cloned repository and <USERNAME> with your system username.

  7. Start and enable created service.

    sudo systemctl start thermometer
    sudo systemctl enable thermometer
  8. Add following line to crontab (edit using crontab -e).

    */10 * * * * cd "<PATH>" && python3 save_to_database.py
    

    Replace <PATH> with path to the cloned repository. You can edit cron expression to change frequency.

rpi-thermometer's People

Contributors

bartekl1 avatar

Watchers

 avatar

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.