Skip to content

Flask webserver for communication between RPi units

Notifications You must be signed in to change notification settings

c-xinghan/dti_webserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A very simple Flask web server + HTML frontend

Facilitates temporary data storage and 2-way communication between two RPI units.

demo.mp4

Background

For a design course's project, we built two functional prototypes of our proposed product to serve as a proof-of-concept.

Each prototype includes a Raspberry Pi running this web server, which enables both prototypes to communicate via calling each other's API endpoints.

The frontend was used for prototype showcase/presentation purposes and provides a visual representation of the data that is being stored on one prototype's web server and retrieved by the other prototype unit.

Documentation

Global variables

Used for temporary storage of data within the web server.

Name Type Description
speed Float Represents a user's speed in km/h.
time Datetime Represents a specific time.

REST APIs

Endpoint Method Description Parameter(s) Returned value(s)
/speed GET Returns speed in String type NIL String speed
/updatespeed POST Updates speed with the value within the request header. Returns a Response object for redirecting to the home page. Request header:
{'speed': Integer}
Response redirect()
/time GET Returns time, formatted to HHMM and in String type NIL String time
/decreasetime POST Rolls back time by 1 hour. Returns a Response object for redirecting to the home page. NIL Response redirect()
/increasetime POST Advances time by 1 hour. Returns a Response object for redirecting to the home page. NIL Response redirect()
/decreasespeed POST Decreases speed by 3. Returns a Response object for redirecting to the home page. NIL Response redirect()
/increasespeed POST Increases speed by 3. Returns a Response object for redirecting to the home page. NIL Response redirect()

About

Flask webserver for communication between RPi units

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published