Skip to content

Nitin2806/WeatherStation

Repository files navigation

#Weather Station

Tech Stack

IOT Aurduino

MQTT Server Mosquitto

MQTT Client paho-mqtt/py

Database (noSQL) MongoDB

Mongo-Client pymongo/py

Backend (RESTapi) FastAPI/py

Frontend (webapp) reactjs/js

Machine Learning

Connection

IOT (mqtt-client) <-MQTT-> (MOSQUITTO mqtt-server) <-MQTT-> (paho-mqtt mqtt-client)--(mongodb database)--(backend/api) <-HTTP-> client (using client-script)

Setup

MOSQUITTO (MQTT-server/broker)

    # install mosquitto
    apt install mosquitto
    # start mosquitto broker/server
    mosquitto -c CONF_FILE  -d

    # in case of `Error: Address already in use`
    ps -ef | grep mosquitto     # get process id PID
    sudo kill PID               # kill process
    mosquitto -c CONF_FILE  -d  # start broker/server

    # In case running locally on wifi-network
    hostname -I             # get private IP to be used as broker IP

MONGODB

For Linux Install Guide

For Windows Install Guide

ENVIRONMENT

    cd backend/
    python3 -m venv venv                # create virtual env `venv`
    source venv/bin/activate            # activate venv
    pip install -r requirements.txt     # install dependencies

Starting HTTP server

    uvicorn backend.server.main:app

    # development server (hot-reload)
    uvicorn backend.server.main:app --reload

Writing Test

This repository uses pytest and requires test to follow Python test discovery Conventions

MERN

Mongoose library

Connection between Mongodb and Mongoose

About

Weather Sation Designed with Arduino and Sensors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published