Outputs

Outputs are plugins which subscribe to 'data' events coming from connected instruments, and are able to forward those events to other services. They extend the capabilities of Wizkers a great deal by turning it into a middleware between your sensors and any number of backend services.

A typical use case for outputs, is using the safecast output to connect a Geiger counter to the Safecast.org service to send regular radiation readings to the Safecast API.

General architecture.

Due to the fact Wizkers in server mode supports multiple open devices at once and standalone operation, there are slight differences in the way outputs work in server vs Chrome mode, but a lot of similarities too.

Output definition

Outputs are defined in wizkers/server/www/js/app/outputs/<output_name>/<output_name>.js. This file defines a couple of high level output characteristics which are used by Wizkers to understand how and when it can be used.

Front-end output config

Outputs always provide a configuration view, which is located in wizkers/server/www/js/app/outputs/<output_name>/settings.js. The corresponding template, by convention, lives in wizkers/server/www/js/tpl/outputs/.

The front-end view is a Backbone view: refer to the existing outputs to get an idea of how to manage output-specific settings, which are merged with general output settings automatically.

Output backend drivers

Chrome/Cordova mode

In this mode, you want to implement wizkers/server/www/js/app/outputs/<output_name>/backend_driver.js . The backend driver needs to implement a couple of public methods which are expected by the output manager:

Server mode

In server mode, output backends live in wizkers/server/server/outputs/ and implement the same API as in Chrome/Cordova mode. Since the outputs are executed in a NodeJS environment, they often use different low-level APIs which is the reason why they are separate from the 'app mode' output code.