Code Monkey home page Code Monkey logo

weatherstationclient's Introduction

This is the client side set up for IoT Weather Station

Step 1: Set up Raspberry Pi

  • Flash Raspberry Pi OS on an SD Card
  • Check if RPI is working and functional

Step 2: Configure Raspberry PI GPIO Pins

Run the following commands on raspberry pi

 $ sudo vim /boot/config.txt
  • Add dtoverlay=w1-gpio on the last line of the file
 sudo reboot
  • login again on to your RPI

Step 3: Set up hardware

  • Look at the images provides to attach temperature sensor to RPI
  • All Components for the project:
  • Setup (connected components)
  • Close up of sensor connection: front view
  • Close up of sensor connection: rear view

Step 4: Get the data from the device files

Run the following commands

cd /sys/bus/w1/devices && ls
cd 28-XXXXXXXXXXX (where xxx is the file number you will see with ls)
cat temperature (this will print the temperature on terminal)

Step 5 Docker Image with all dependencies including jenkins

  • To build the docker image from the dockerfile run the following:

    docker build -t <name-of-image> . 
    

    '.' refers to path to the docker file here assumed that docker file is in current directory

  • To run the docker image making sure the volume having jenkins state (p/w's , plugins etc.) persisted run the (new) docker container as

    docker run --network="host" -v jenkins:/var/jenkins_home -it --name=<name-of-container> <name-of-image> bash
    
  • To run the docker container such that the jenkins data and settings are persisted across different docker containers, first cretae a volume and then mount.

  • To create the volume first run jenkins volume create jenkins where the last token, jenkins in the command above is the name of the volume where all the jenkins data is stored and persisted

  • After creating the volume run the docker container by using:

    docker run --network="host" -it --mount source=jenkins,target=/var/jenkins_home -v /sys/bus/w1/devices/28-00000b65fafc:/sys/bus/w1/devices/28-00000b65fafc --name=as_rpi1 rpi2:latest bash
    

    Note: the flag -v informs jenkins to attach the path\to\sensor\data\on\rpi:as\path\to\sensor\data\in\docker\container

Step 6 Running jenkins within the container

  • Start jenkins by: java -jar /opt/jenkins.war

  • Attach another bash on the container and start webhook relay as docker exec -it name_of_already_running_container bash relay login -k $RELAY_KEY -s $RELAY_SECRET relay forward --bucket github-jenkins http://ip_of_rpi:8080/github-webhook/

Update. Display code coverage repor within jenkins web agent

  • Need to install HTML Publisher plugin in jenkins
  • Due to security settings in jenkins the css styled pages are not displayed by jenkins as mentioned in this page https://www.jenkins.io/doc/book/system-administration/security/configuring-content-security-policy/#ConfiguringContentSecurityPolicy-HTMLPublisherPlugin
  • To overcome this issue (by bypassing the security settings as mentioned in the page above) start jenkins using: java -Dhudson.model.DirectoryBrowserSupport.CSP= -jar \opt\jenkins.war

How to run the Weather Staiton

  • Detailed instructions on how to run the weather station can be found in here

weatherstationclient's People

Contributors

anokhi1994 avatar ggulgulia avatar

Watchers

James Cloos avatar  avatar

weatherstationclient's Issues

Turn on Camera if temperature too high

Camera should start automatically only when temperature is too high

Additionally a follow up task would be to have camera movement to check what might be burning in the house ;)

enable keyboard interrupt

  • publish temperature every 500 ms
  • terminate with SIGTERM (ctrl+c/q)
  • read from keyboard asynchornously
  • explore usage of pthread or std::thread

clang formatting

  • Enable clang formatting locally by providing .clang-format config file

  • provide a jenkins pre- test to check clang fromatting

Light up red LED if temperature too high

Control the pin of RGB LED sensor to light up Red when temperature too high

  • as an additional extension light up Blue LED when too cold and Green LED when optimal

Update Readme

update readme.md and add instructions to run the weather station

Add Humidity sensor

Add DHT11 Humidity sensor to weather station suite

this task is deprecated since the purchased DHT11 Sensor doesn't work

Add barometric pressure sensor BMP280

Add BMP280 sensor to the board

Create a basic interface that can be 'blended' with current code base

Publish the pressure synchronously or asynchronously with temperature on a terminal/console

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.