Skip to content
simen edited this page May 15, 2017 · 16 revisions

What is freebird?

freebird is a Node.js IoT framework for creating a heterogeneous machine network.


Features

  • Manages multi/cross protocols with a single unified interface.
  • Supports BLE, ZigBee, CoAP, and MQTT machine networks. (LoRa is coming soon.)
  • Supports proprietary protocols.
  • Uses Netcore, Device, and Gadget classes to model the real-world machine networks.
  • Application data model based on the concept of Smart Object (IPSO).
  • Based-on Node.js. This brings possibilities for IoT/WoT applications.


Installation

$ npm install freebird --save


Usage

To use the freebird, just new an instance of Freebird class with various netcores for different protocols.

If you like a RPC channel for your apps to communicate with freebird, you can use the freebird-rpc to establish a real-time and bidirectional channel to meet your needs.

var Freebird = require('freebird'),
    bleCore = require('freebird-netcore-ble')('noble'),
    mqttCore = require('freebird-netcore-mqtt')(),
    coapCore = require('freebird-netcore-coap')(),
    zigbeeCore = require('freebird-netcore-zigbee')('dev/ttyACM0');

var fbRpc = require('freebird-rpc'),
    http = require('http'),
    rpcServer = fbRpc.createServer(
        http.createServer().listen(3000)
    );

// Create a freebird server that manages BLE, MQTT, CoAP, and ZigBee machines
var freebird = new Freebird([ bleCore, mqttCore, coapCore, zigbeeCore ]);

// websocket RPC channel for real-time IoT apps
freebird.addTransport(rpcServer);

// start the server
freebird.start(function (err) {
    console.log('Server started');

    // Allow remote machines to join the network within 180 secs
    freebird.permitJoin(180);
});

freebird.on('ready', function () {
    // ...
});

freebird.on('devIncoming', function (dev) {
    // ...
});

freebird.on('gadIncoming', function (gad) {
    // ...
});