Giter Site home page Giter Site logo

farm-monitor's Introduction

Farm Monitor Server -- DONE

Environment

Development

  • Mac OS X 10.10.3
  • Python 3.4.2
  • Django 1.6.0
  • Mysql: Ver 14.14 Distrib 5.6.22

Deployment

  • Linux Ubuntu 14.04.1 LTS
  • Python 3.4.0
  • Django 1.6.0
  • Ver 14.14 Distrib 5.5.41
  • Host Name: film.h1994st.com
  • Port Number: 8899

Packages

  • pymysql
  • simplejson
  • numpy
  • scipy

Database Model

Field Type Remark Description
id int(11) primary key, auto_increment point identification
longtitude decimal(9,4) longtitued of the point
latitude decimal(9,4) latitude of the point
moisture decimal(4,1) soil moisture of the point
air_temp decimal(4,1) air temperature of the point
leaf_temp decimal(4,1) leaf temperature of the point
humidity decimal(4,1) humidity of the point
transpiration decimal(5,2) calculated by air_temp, leaf_temp and humidity
photo varchar(100) url of the photo
time datetime time of acquisition

API Reference

Global Rules

  • DateTime Format: yyyy-MM-dd hh:mm:ss
  • Http Response Format: JSON

APIs

  • TestHttpConnection

    • Method: POST
    • HTTP request: /farm/testnetwork
    • Parameters:
      • message: text string
      • photo: file picture
    • Description: test network connection
    • Return:
      • Success
        • Success: TestHttpConnection
      • Failed
        • Fail: TestHttpConnection
  • NewSample

    • Method: POST
    • HTTP request: /farm/newsample
    • Parameters:
      • longtitude: text number ±xxx.xxxx
      • latitude: text numer ±xx.xxxx
      • moisture: text number ±xxx.x
      • transpiration: text number ±xxx.xx
      • air_temp: text number ±xxx.x
      • leaf_temp: text number ±xxx.x
      • humidity: text number ±xxx.x
      • datetime: text datetime
      • photo: file picture
    • Description: update new sample
    • Return:
      • Success
        • Success: NewSample
      • Failed
        • Fail: NewSample
  • GetDataPoints

    • Method: GET
    • HTTP request: /farm/getdata
    • Parameters:
    • Description: get recent samples(in 2 days or nearest 20 points)
    • Return:
      • Success
        • Success: NewSample
      • Failed
        • Fail: NewSample
  • GetPointDetail

    • Method: GET
    • HTTP request: /farm/getdetail
    • Parameters:
      • id: text number integer >0
    • Description: get point detail by id
    • Return
      • Success
        • data:
          • longtitude: text number ±xxx.xxxx
          • latitude: text numer ±xx.xxxx
          • moisture: text number ±xxx.x
          • transpiration: text number ±xxx.xx
          • air_temp: text number ±xxx.x
          • leaf_temp: text number ±xxx.x
          • humidity: text number ±xxx.x
          • datetime: text datetime
          • photo: file picture
        • max-x: text numer ±xx.xxxx max latitude
        • min-x: text numer ±xx.xxxx min latitdue
        • max-y: text number ±xxx.xxxx max longtitude
        • min-y: text number ±xxx.xxxx min longtitude
        • max_m: text number ±xxx.x max soil moisture
        • max_t: text number ±xxx.x max transpiration
        • min_m: text number ±xxx.x min soil moisture
        • min_t: text number ±xxx.x min transpiration
        • all-moist: two dimentional array represents interpolated value of soil moisture
        • all-trans: two dimentional array represents interpolated value of transpiration
      • Failed
        • Fail: GetPointDetail
  • GetHistoryData

    • Method: GET
    • HTTP request: /farm/gethistory
    • Parameters:
      • time_from: text datetime
      • time_to: text datetime
    • Description: get points in a time range(if no points in this range, return nearest 20 points)
    • Return
      • Success
        • data:
          • longtitude: text number ±xxx.xxxx
          • latitude: text numer ±xx.xxxx
          • moisture: text number ±xxx.x
          • transpiration: text number ±xxx.xx
          • air_temp: text number ±xxx.x
          • leaf_temp: text number ±xxx.x
          • humidity: text number ±xxx.x
          • datetime: text datetime
          • photo: file picture
      • Failed
        • Fail: GetHistoryData
  • GetImportantData

    • Method: GET
    • HTTP request: /farm/getimpodata
    • Parameters:
    • Description: get recent issues points
    • Return
      • Success
        • longtitude: text number ±xxx.xxxx
        • latitude: text numer ±xx.xxxx
        • moisture: text number ±xxx.x
        • transpiration: text number ±xxx.xx
        • air_temp: text number ±xxx.x
        • leaf_temp: text number ±xxx.x
        • humidity: text number ±xxx.x
        • datetime: text datetime
        • photo: file picture
      • Failed
        • Fail: GetImportantData
  • GetHeatMap

    • Method: GET
    • Http request: /farm/getheatmap
    • Parameters:
      • type: text 'moisture' or 'transpiration'
    • Description: generate heat map data
    • Return
      • Suncess
        • max-x: text numer ±xx.xxxx max latitude
        • min-x: text numer ±xx.xxxx min latitdue
        • max-y: text number ±xxx.xxxx max longtitude
        • min-y: text number ±xxx.xxxx min longtitude
        • max_z: text number ±xxx.x max soil moisture or transpiration
        • max_z: text number ±xxx.x max soil moisture or transpiration
        • all-image: two dimentional array represents interpolated value of soil moisture or transpiration
      • Failed
        • Fail: GetHeatMap

farm-monitor's People

Contributors

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