Skip to content
Billy Neuson edited this page Jul 17, 2016 · 4 revisions

The API can be accessed with REST requests to http://egr.gvsu.edu/~esm/data/

List of Assets

The asset URL encoded parameter defines which operation to perform. The following assets are valid:

  • GET
    • current-data : Returns the latest data in an object containing:
      • panelOutput : Current panel output in W/m2
      • shingleOutput : Current shingle output in W/m2
      • timestamp : The latest timestamp reported by the module
    • historical-data : Returns historical data, as an object containing:
      • times : The list of times in the dataset
      • panelOutputs : The list of panel outputs in W/m2 in the dataset
      • shingleOutputs : The list of shingle outputs in W/m2 in the dataset
      • headings : The list of headings in the dataset
      • panelAngles : The list of panel angles in the data set
      • locations : The list of locations in the dataset
    • locations : Returns the list of all locations the module has been in an object, containing:
      • locations : List of all locations, [latitude, longitude]
      • lastSeen : List of last seen times for each location
      • totalOutput : Integrated output at each location over the course of deployment
  • POST
    • current-data : Used to add the latest data to the system. In order to access this, the client and the server must both have installed the same key. For this deployment this comes in the form of the output of ssh-keygen. This ensures authentication in the face of a standard http connection without SSL/TLS, due to limitations of the implementation server. The following object is posted in the request body:
      • json : Object containing the datapoint:
        • panelOutput : The panel output in W/m2 of the datapoint
        • shingleOutput : The shingle output in W/m2 of the datapoint
        • timestamp : The timestamp of the datapoint
        • lat : The latitude of the datapoint
        • lon : The longitude of the datapoint
        • heading : The heading of the datapoint
        • panelAngle : The panel angle of the datapoint
        • random : A random string produced by the client to be used as a password salt
      • hash : hash computed over the json object, as well as the key
Clone this wiki locally