Skip to content

hanien/dit827server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server

Flask server for Aptiv project currently serving four endpoints.

  • [GET]/ Serves the website
  • [POST]/api/sensors/<rpi_id> Posts a new sensor reading type to the server
    • <rpi_id> can be one of the following ids: driver , back , middle , or passenger.
    • The Body should be in JSON format. Example body:
             {
               "temperature":{"value":"20"},
               "pressure":{"value":"20"},
               "altitude":{"value":"20"},
               "sound":{"value":"20.3"},
               "light":{"value":"12.6"},
               "humidity":{"value":"65"},
               "gain":{"value":"20"},
               "lux":{"value":"20"},
               "ir":{"value":"20"},
               "full":{"value":"20"}
            }
  • [GET]/api/sensors/<rpi_id> Gets the current sensor reading values for the Raspberry Pi specified in the parameter
  • [PUT]/api/sensors/<rpi_id> Updates the sensor reading values for the Raspberry Pi specified in the parameter

How to start the WebServer

1. Requirements

2. Cloning the Repository

  • With SSH
    git clone git@github.com:hanien/dit827server.git
  • With HTTPS
    git clone https://github.com/hanien/dit827server.git

3. Flask Requirement

Open your Terminal Command Line and type:

  •  cd dit827server
  •  $ pip install Flask

Flask

4. Run the python server:

Open your Terminal Command Line again and type:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •