Coder Social home page Coder Social logo

pi-temp's Introduction

pi-temp - DHT11/22 Sensor driver + Data collector and visualizer

This project uses tweaked gapan's dht sensor protocol implementation to obtain data from sensor. To collect and visualize data project uses node.js, simple http server, apex charts and sqlite with sequelize ORM.

As a result you will get nice chart-visualized sensor data: Screenshot_20220927_225437

How to make this work

First of all you need to install wiringpi library, to do so, run following command:

sudo apt-get install wiringpi

Then you need to clone this repo somewhere:

git clone https://github.com/Hatry1337/pi-temp

Go to project directory and create .env file

Put inside of file this template and edit if needed

PORT=8090
HOST="0.0.0.0"
DATABASE="/home/pi/pi-temp/data.sqlite"
DRIVER="/home/pi/dht11"

PORT - port, where webserver will listen for requests

HOST - interface ip address, where webserver will listen for requests (0.0.0.0 for all interfaces)

DATABASE- path, where your sqlite database will be located

DRIVER - path to sensor driver executable (You need to compile it or get binary from releases section)

โš  Pre-Compiled binaries uses by default GPIO4 pin of raspberry pi. If you wanna use other pin, you will need to compile driver by yourself.

Then use npm to install typescript compiler and project dependencies:

sudo npm i -g typescript && npm i

When dependencies are installed you can build typescript:

tsc

Now you are ready to run the server:

node ./dist/main.js

How to compile driver:

Go to ./driver directory and edit driver source if needed

Then use gcc to compile source file:

gcc -o dht11 dht11.c -lwiringPi -lwiringPiDev

Take binary file dht11 somewhere and put it's path to the .env file

pi-temp's People

Contributors

hatry1337 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.