Code Monkey home page Code Monkey logo

server's Introduction


MIT licensed API DOC GoDoc Build Status Go Report Card Coverage Status Join the chat at https://gitter.im/gost/Lobby Join Slack

GOST (Go-SensorThings) is an IoT Platform written in Golang (Go). It implements the Sensing profile (part 1) of the OGC SensorThings API standard including the MQTT extension.


Implementation of the Tasking profile (part 2) and Rules Engine profile (part 3) of the OGC SensorThings API is planned as a future work activity.

The GOST website and blog can be found at www.gostserver.xyz

Binaries

Current release V0.5: 2017-07-17

Binaries are build for Windows, Ubuntu and OSX.

Roadmap

Date Version Features
2018-05-01 0.6 new dashboard (based on polymer/webcomponents) + bugfixes for locations

Benchmarks

For benchmarks see http://www.github.com/gost/benchmarks.

Run GOST with Docker-compose

For more information about running GOST with Docker-compose, see GOST Docker support.

For more information about running GOST in Raspberry Pi with Docker-compose, see How to run GOST on Raspberry Pi.

Run GOST Server in Docker

For making connection to external database use environmental variables GOST_DB_HOST, GOST_DB_PORT, GOST_DB_DATABASE, GOST_DB_USER, GOST_DB_PASSWORD

$ docker run -d -p 8080:8080 -t -e GOST_DB_HOST=192.168.40.10 -e GOST_DB_DATABASE=gost --name gost geodan/gost

For using your config own file, create a mount:

$ docker run -v myconfiglocation:/gostserver/config geodan/gost -config /gostserver/config/myconfig.yaml

Build GOST server Docker image

$ docker build -t geodan/gost .

Build GOST server for Raspberry Pi

note: building the Raspberry Pi image must be done on a Raspberry Pi :-(, otherwise errors will occur.

$ sudo docker build -f Dockerfile-rpi -t geodan/rpi-gost .

$ sudo docker push geodan/rpi-gost

OGC Compliance testing status

GOST is being tested against the OGC SensorThings API Test Suite 1.0 https://github.com/opengeospatial/ets-sta10

Conformance Class Reference Implementation status Test Status
Sensing Core A.1 beta 6/6
Filtering Extension A.2 beta 8/8
Create-Update-Delete A.3 beta 9/9
Batch Request A.4 - Tests not implemented
Sensing MultiDatastream Extension A.5 - Tests not implemented
Sensing Data Array Extension A.6 beta Tests not implemented
MQTT Extension for Create and Update A.7 beta Tests not implemented
MQTT Extension for Receiving Updates A.8 beta Tests not implemented

Status GOST on OGC site: http://www.opengeospatial.org/resource/products/details/?pid=1419

Manual Installation and configuration

GOST installation

GOST configuration

Security

GOST security

Samples

Apiary API Docs

HTTP API: For sample requests (setting up sensors/datastreams/things and adding observations) see the tests in the playground. For a complete collection of working requests install Postman and import the Postman file

MQTT: For getting started with Gost and MQTT for publishing/receiving data see GOST and MQTT - Getting started

Goals

  • Complete implementation of the OGC SensorThings spec
  • Test coverage!
  • Frontend
  • Benchmarks
  • Authentication
  • Different storage providers such as MongoDB (Now using PostgreSQL)

server's People

Contributors

bertt avatar dschowta avatar farshidtz avatar flammified avatar gitter-badger avatar henkmollema avatar stvno avatar tebben avatar thezelus avatar tieebs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

server's Issues

ValueCode from DB

CodeValue's are now hardcoded, load into memory from database on start

Implement name property

Implement the mandatory name attribute for the following entities:

thing.name
location.name
datastream.name
sensor.name
observedproperty.name
observation.name
featureofinterest.name

Refactor: Combine postgis delete methods (and exist)

Combine delete methods into 1 function with parameter name of entity.

database.postgis.datastream.DeleteThing
database.postgis.featureofinterest.DeleteFeatureOfInterest
database.postgis.historicallocation.DeleteHistoricalLocation
database.postgis.location.DeleteLocation
database.postgis.observation.DeleteObservation
database.postgis.observedproperty.DeleteObservedProperty
database.postgis.sensor.DeleteSensor
database.postgis.thing.DeleteThing

same for the *Exist methods

Add support for HistoricalLocation with multiple locations

Should have support for multiple locations in post/put/patch request to HistoricalLocation?

sample:
HTTP POST localhost:8080/v1.0/HistoricalLocations

{
"time": "2015-03-01T00:40:00.000Z",
"Thing":{"@iot.id": 1 },
"Locations": [{"@iot.id": 2},{"@iot.id": 3}]
}

Result: 2 records in HistoricalLocations
Als GET to HistoricalLocation needs to fixed.

ID to type Any

Change the id from type string to interface{} in all entity structs

Post observation without FOI/Location should give 400 not 500

$ curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '{

"phenomenonTime": "2016-05-09T11:04:15.790Z",
"resultTime" : "2016-05-09T11:04:15.790Z",
"result" : 38,
"Datastream":{"@iot.id":1}
}' "http://localhost:8080/v1.0/Observations"
{
"error": {
"status": "Internal Server Error",
"code": 500,
"message": [
"pq: insert or update on table "observation" violates foreign key constraint "fk_featureofinterest""
]
}
}

Add support for Observation properties resultQuality, validTime and parameters

from the spec:

resultQuality: "Describes the quality of the result."
DQ_Element -Zero-to-many

validTime: "The time period during which the result may be used."
TM_Period (ISO 8601 Time Interval string)
Zero-to-one

parameters "Key-value pairs showing the environmental conditions during measurement. NamedValues in a JSON Array"
Zero-to-one

Counters: add where statements

add where statement on counters, for example:

/datastream(1)/observations
actual: counts all observations
expected: counts observations where datastream=1

Add secure gost service (https)

At the moment a secure service is missing. Most browsers don't accept data retrieval from non-secure servers when the original domain is secure (from https to http).

Encoding not supported message

Add the supported encodingTypes for an entity to the returned error message when posting an entity (sensor, location or featuresofinterest) fails because of a wrong supplied encodingType.

Conformance Crud Test: Post to Datastream should work

Request:
localhost:8080/v1.0/Datastreams
{
"unitOfMeasurement": {
"name": "Celsius",
"symbol": "degC",
"definition": "http://qudt.org/vocab/unit#DegreeCelsius"
},
"description": "test datastream.",
"observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
"Thing": { "@iot.id": 1 },
"ObservedProperty":{ "@iot.id":1},
"Sensor": { "@iot.id": 1 }
}

Response:
{
"error": {
"status": "Bad Request",
"code": 400,
"message": [
"Thing does not exist"
]
}
}

But http://localhost:8080/v1.0/Things(1) does exist

Stateless server

Make server stateless again (server should be in same state before/after request):
. fix counters
. fix FeatureOfInterest request

Metadata to Any

Change field metadata in entity sensor to interface and change in database from character varying(255) to jsonb

Add option to get result values in array

For very large datasets it would be nice to have a smaller overhead in the key-value pairs.
Therefore I propose to add a format that sents the data as 1D arrays. I have added an example to give the idea but any other solution that gets rid of redundant 'keys' is also fine.

Current situation:

{
   "count": 200,
   "@iot.nextLink": "gost.geodan.nl/v1.0/Datastreams(8)/Observations/?$top=200&$skip=200",
   "value": [
      {
         "phenomenonTime": "2016-07-06T18:21:39.000Z",
         "result": 25.6
      },
      {
         "phenomenonTime": "2016-07-06T18:12:14.000Z",
         "result": 25.6
      },...

example desired situation:

{
   "count": 200,
   "@iot.nextLink": "gost.geodan.nl/v1.0/Datastreams(8)/Observations/?$top=200&$skip=200$format=condense",
  "values":{
      "phenomenonTime": ["2016-07-06T18:21:39.000Z","2016-07-06T18:12:14.000Z",...],
      "result":[25.6,25.6,...]
  }

Implement Datastream.ObservedArea

Implement Datastream.ObservedArea, from the spec: "The spatial bounding box of the spatial extent of all FeaturesOfInterest that belong to the Observations ", return GeoJSON Polygon

Mosquitto crashes

Occasionally we see Mosquitto broker crashes on the server:

kern.log:May 26 09:36:25 gost kernel: [313113.955286] mosquitto[708]: segfault at e3a1 ip 00007fdafab66a0c sp 00007fff16bd2b50 error 4 in libwebsockets.so.7[7fdafab5e000+1f000]

Conformance CUD tests: Post with deep inserts should work

url: http://gost.geodan.nl/v1.0/Things
body:
{
"description": "Office Building",
"properties": {
"reference": "Third Floor"
},
"Locations": [
{
"description": "West Roof",
"location": { "type": "Point", "coordinates": [-117.05, 51.05] },
"encodingType": "http://example.org/location_types#GeoJSON"
}
],
"Datastreams": [
{
"unitOfMeasurement": {
"name": "Lumen",
"symbol": "lm",
"definition": "http://www.qudt.org/qudt/owl/1.0.0/unit/Instances.html#Lumen"
},
"description": "Light exposure.",
"observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
"ObservedProperty": {
"name": "Luminous Flux",
"definition": "http://www.qudt.org/qudt/owl/1.0.0/quantity/Instances.html#LuminousFlux",
"description": "Luminous Flux or Luminous Power is the measure of the perceived power of light."
},
"Sensor": {
"description": "Acme Fluxomatic 1000",
"encodingType": "http://schema.org/description",
"metadata": "Light flux sensor"
}
}
]
}

Add FOI to new observation when none found (id or deepinsert)

When no FOI posted or linked when posting an observation take the location of the linked thing, keep lookups in the database to a minimum by loading already added fois from thing in memory on startup so observation inserts are not slowed down . When a things location is updated make sure the next time the foi from thing is requested a new foi will be inserted in the database for the observation to use.

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.