Skip to content

A simple flask based server to connect Drip Irrigation app and mongodb storage of sensor data

License

Notifications You must be signed in to change notification settings

f0rkb0mbZ/drip_irrigation_server

Repository files navigation

API Documentation for Soif Drip Irrigation and Garden Monitoring App

Codacy Badge Build Status License: GPL v3

BaseURL

https://soif.herokuapp.com/

Endpoints

Sl. Endpoint Usage Method Response Type
1 / Show this Documentation GET text/html
2 /getdata/now Get all latest sensor data updates GET application/json
3 /getdata/<string:date> Get all sensor data for a given day. Date format to be passed : dd-mm-yyyy GET application/json
4 /getdata/<string:date>/<string:sensor> Get a specific sensor data for a given day GET application/json
5 /insertdata Insert all sensor data into database POST application/json
6 /setpump Set moisture threshold for automatic water pump POST application/json
7 /getpump Read the threshold value from the server GET application/json
8 /deletedata/<string:date> Delete all sensor data for a given day DELETE application/json

JSON Templates

/getdata/now :

{
  "humidity": 0.77, 
  "light": 425, 
  "moisture": {
    "plant0": 0.47, 
    "plant1": 0.72
  }, 
  "temparature": 33.2
}

/getdata/<dd-mm-yyyy> :

{
  "moisture": {
    "plant0": [],
    "plant1": []
  },
  "temparature": [],
  "humidity": [],
  "light": []
}

/getdata/<dd-mm-yyyy>/light :

{
  "records": [
    {
      "light": [
        0,
        6.67,
        5.83,
        5.83,
        6.67,
        273.33,
        600.83,
        523.33,
        6.67,
        5.83,
        6.67
      ]
    }
  ]
}

/insertdata:

{
  "moisture": {
    "plant0": 0.0,
    "plant1": 0.0
  },
  "temparature": 0.0,
  "humidity": 0.0,
  "light": 0.0
}

/setpump:

{"pump0": 0.0, "pump1": 0.0}

/getpump :

{
  "settings": {
    "pump0": 0.0, 
    "pump1": 0.0
  }
}

About

A simple flask based server to connect Drip Irrigation app and mongodb storage of sensor data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published