Code Monkey home page Code Monkey logo

weather_service's Introduction

Weather service

Project description

This project was part of the distributed systems lab during the summer semester 2019 at Hochschule Darmstadt, University of Applied Sciences. The task was to implement a distributed weather service consisting of

  • sensors (temperature, humidity, rain, wind) : sensors send randomly generated weather data via UDP/ MQTT to their respective weather stations
  • weather stations: receive weather data from at least three sensors. Weather stations include a HTTP- server which displays the received sensor data via a REST API. Furthermore, the weather stations transmit the aggregated sensor data via Thrift to a connected weather service.
  • weather services: weather services gather data from multiple weather stations. They implement a master slave architecture and consist of at least three replicated servers which synchronize the received data continuously.

Project overview

Build the project

gradle installDist

Demo run

Launch the demo mode to run the application on your host system.

docker-compose up

Note: if you run the code on macOS, remove the last line from the docker-compose.yml (network_mode: host)

./test_weatherservice.sh

The test_weatherservice.sh script launches a weather service instance with three servers.

./test_weatherpacket.sh

The test_weatherpacket.sh script launches three weather stations and for each station it launches four sensors, that send their data to the corresponding station. Each weather station transmits its data to the weather service server it is assigned to.

Check the transmitted sensor values on ports 5554, 5564, 5574 according to the REST API documentation.

docker-compose down

Run

docker-compose up

Note: if you run the code on macOS, remove the last line from the docker-compose.yml (network_mode: host)

Update the start.sh file:

  • replace ip0=0.0.0.0 with your local IP address
  • replace ip1=0.0.0.0 with a remote IP address you want to communicate with

The start.sh script will launch a weather service instance, three weather stations and their respective sensors.

./start.sh

./stop.sh

docker-compose down

Weather stations REST API

GET

sensors/sensortype/whichdata

sensortypes:

  • temperature
  • rain
  • wind
  • humidity

whichdata:

  • current
  • history

weather_service's People

Contributors

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