Skip to content

Latest commit

 

History

History
147 lines (129 loc) · 8.79 KB

File metadata and controls

147 lines (129 loc) · 8.79 KB

Executive Summary

On top of CMU SensorAndrew, the largest nation-wide campus sensor network, our Sensor Data and Service Platform (SDSP) aims to build a software service layer serving sensor data service discovery, reuse, composition, mashup, provisioning, and analysis. Another major objective of our project is to support SDSP-empowered innovative application design and development. Supported by a cloud computing enrironment with high-performance database, SDSP aims to provide a platform to enable and facilitate a variety of research projects in the areas of mobile services, internet of things, cloud computing, big data analytics, software as a service, and social services.

APIs

API interface for CMUSV Sensor Data and Service Platform (SDSP)

CMU Sensor Service Platform

Service URL:

http://einstein.sv.cmu.edu

Usage:

Note: all TimeStamps are in Unix epoch time format to millisecond. Conversion from readable timestamp format to Unix epoch timestamp can be found in http://www.epochconverter.com

  1. RETRIEVE ALL DEVICES

    • Method: GET
    • Semantics:
      • uri: user-defined identifier for a device. Each uri is an identifier unique to the corresponding device
      • device_type: Model of the device. A device is a container (i.e., physical device) object that comprises one or more sensors and is capable of transmitting their readings over a network to a Device Agent.
      • device_agent: a local server or proxy that manages a set of devices registered to it. Device agents can receive data from devices, convert data to another format (eg. JSON), and can transmit it to central server over a LAN or WAN.
      • device_location: the location of the device that is transmitting sensor data
      • ResultFormat: either json or csv
    • URL: http://einstein.sv.cmu.edu/get_devices/<"ResultFormat">
    • Sample csv request: http://einstein.sv.cmu.edu/get_devices/csv
    • Sample csv result:
      uri,device_type,device_agent,device_location
      10170202,Firefly_v3,SensorAndrew2,B23.216
    • Sample json request: http://einstein.sv.cmu.edu/get_devices/json
    • Sample json result: {"device_type":"Firefly_v3","device_location":"B23.216","device_agent":"SensorAndrew2","uri":"10170202"}
  • Get sensor type

  • Add sensor readings

    • Method: POST
    • Semantics: this is a POST method, so the command cannot be directly execute through the browser. It may be executed through Rails, JQuery, Python, BASH, etc.
      • device id (string): device uri/id
      • timestamp (int): time of the reading in Unix epoch timestamp.
      • sensor type (string): Type of the sensor, such as temperature, CO2Levels, etc. It is up to the user to choose the sensor type to post to.
      • sensor value (double): this input corresponds to the value the user would like to post. It is up to the user to post the correct, pertinent value that correctly corresponds to the sensor type.
    • URL: http://einstein.sv.cmu.edu/sensors
    • Data: {"id": <"device id">, "timestamp": <"timestamp">, <"sensor type">: <"sensor value">}
      Note: more than one sensor type:sensor value pairs can be included in the json.
    • Command Line Example:
      1. input sensor reading data in a JSON file
        • sample_reading.json contains {"id":"test", "timestamp": 1373566899100, "temp": 123}
      2. curl -H "Content-Type: application/json" -d @sample_reading.json "http://einstein.sv.cmu.edu/sensors"
    • Result: "saved" if the reading has been successfully added to the database.
  • Get sensor readings at a specific time

  • Get sensor readings in a time range

  • Get the latest readings at specific time from all devices

  • Get the latest readings at current time from all devices