Coder Social home page Coder Social logo

xovis-driver's Introduction

smap-driver-xovis

A driver for Xovis camera counters.

Dependencies

  • python3.5 for Python with AsyncIO.
  • python3-aiohttp for HTTP operations.

Features

  • Buffering: none (each camera buffers)
  • Discovery: manual (each camera is configured to push to the driver)

Configuration

The storage engine specifc configuration options are given at the commandline after run and the name of the storage engine.

The remaining options are given in the /etc/config.json configuration file. These are also available to the storage engines. It contains the following keys:

  • interface The interface to listen on.
  • port The port to listen on.
  • sourcename The sMAP sourcename (Note: This is specific to the smap storage engine)
  • uuid The instance base uuid (Note: This is specific to the smap storage engine)
  • uptime_delay The time in seconds between uptime posts.
  • log/blacklist A list of event identifiers not to log.

Cameras

Go the the Config tab of the webpage exposed by the camera. Under the Settings section open the Data Push tab, enter the following configuration and click Add:

  • Data Type Line count data
  • Interval 1 minute
  • Granularity 1 minute
  • Protocol HTTP(S)
  • Data push format JSON
  • URL The URL of the service being exposed by the driver

The go to the top of the page and click Save.

Starting

The full description of command line options::

./xovis-driver help

Example:

./xovis-driver run smap http://server.dk:8079/add/cac7d1e0-17d8-4c87-b0e3-aa6b27e7f7f6 &> ../log/driver.log

Debugging

The logs printed to STDOUT should contain everything needed for debugging.

Writing a Storage Engine

Any .py file under /src/storage_engines/ is immediately availabile under the name of the file. Start out by copying /src/storage_engines/demo.py to /src/storage_engines/myengine.py.

Then try configuring a camera and then start the engine by running:

./xovis-driver run myengine one two

This will print out the all data delivered to the storage engine, annotated for navigation. It is up to the storage engine writer to decide what to do with this information. The storage engine should refrain from performing any logic at load-time.

The main argument to the insert function is a data structure of the form: element-name ↦ direction ↦ {'readings' ↦ (timestamp × value) list, 'meta' ↦ name ↦ value}.

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.