Giter Site home page Giter Site logo

praum-monitor's Introduction

praum-monitor

Project

App Description
praum-monitor Reads sensors and provides an api.
web-app Electron web app using Chart.js to present the sensor data.

Readings

GPIOs

Connecting RaspberryPi and MCP3008

GPIO distribution

RaspberryPi Pin MCP3008 Pin Device
Pin 12 / GPIO 18 Sound Sensor V2 (D0)
Pin 4 / 5V Sound Sensor V2 VCC
Pin 34 Sound Sensor V2 GND
Pin 11 / GPIO 17 traffic light l Green
Pin 13 / GPIO 27 traffic light l Yellow
Pin 15 / GPIO 22 traffic light l Red
traffic light l GND
Pin 36 / GPIO 16 traffic light c Green
Pin 38 / GPIO 20 traffic light c Yellow
Pin 40 / GPIO 21 traffic light c Red
traffic light c GND
Pin 37 / GPIO 26 traffic light r Green
Pin 35 / GPIO 19 traffic light r Yellow
Pin 33 / GPIO 13 traffic light r Red
traffic light r GND
Pin 29 / GPIO 5 Piezo SIG
Pin 31 / GPIO 6 Buzzer SIG
Pin 7 / GPIO 4 Movement Sen Out
Pin 39 Movement Sen GND
Pin 4 Movement Sen VCC (5V)
Pin 32 / GPIO 12 Climate Sensor Out
Pin 30 Climate Sensor GND
Pin 2 Climate Sensor VCC (5V)
Pin MH-Z19 V+ (5V)
Pin 6 MH-Z19 V- (GND)
Pin 22 / GPIO 25 MH-Z19 PWM (Digital Out)
Pin 16 / GPIO 23 Button

Development

dev-server

Start a local http server for development with.

python3 dev-server.py

Installation

Installation script (script ๐Ÿ“ƒ)

Be careful using this scripts. Always check content before running a script with sudo.

sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/lukasdanckwerth/praum-monitor/main/bin/install.sh)"

Update and install packages

sudo apt-get update --assume-yes && \
sudo apt-get upgrade --assume-yes && \
sudo apt-get install --assume-yes vim git && \
sudo apt-get install --assume-yes python-dev

Expand file system "Advanced Options" -> "Expand Filesystem" and activate SPI with "Interface Options" -> "SPI".

sudo raspi-config

# or expand filesystem with
sudo raspi-config --expand-rootfs

# and enable spi interface
sudo raspi-config nonint do_spi 0

Install samba

sudo apt-get install --assume-yes samba samba-common-bin
sudo smbpasswd -a pi
# user: pi
# password: pi
sudo vim /etc/samba/smb.conf
sudo mkdir /srv/praum-monitor
sudo chown pi:pi /srv/praum-monitor
sudo chmod 777 /srv/praum-monitor

See smb.conf.

Install py-spidev lib

pushd /srv/
wget https://github.com/doceme/py-spidev/archive/master.zip -O py-spidev.zip
unzip py-spidev.zip
cd py-spidev-master
sudo python3 setup.py install
popd

Disable display sleep

# to avoid a `unable to open display` error use the following
export DISPLAY=:0

# set screen saver timeout to zero:
xset s 0

# set dpms (EnergyStar) to disabled:
xset -dpms

# verify your settings with
xset q

Autostart Firefox

Edit:

sudo vim /etc/xdg/lxsession/LXDE-pi/autostart

Hide taskbar / menubar

Edit /etc/xdg/lxsession/LXDE-pi/autostart

sudo vim /etc/xdg/lxsession/LXDE-pi/autostart

Comment the following line.

@lxpanel --profile LXDE
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@unclutter -idle 0.1 -root
@bash /srv/praum-monitor/bin/start-web-app.sh
#@firefox-esr --kiosk --private-window file:///home/pi/Desktop/index.html

Make the mouse disappear

To make the mouse disappear first install unclutter:

sudo apt-get install unclutter

Then add the following line to your /etc/xdg/lxsession/LXDE-pi/autostart file.

@unclutter -idle 0.1 -root

praum-monitor's People

Contributors

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