3.1.0 • Published 6 years ago

mbed-edge-js v3.1.0

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

Mbed Edge.js

Node.js protocol translator library to manage devices through Mbed Edge. Tested against Mbed Edge v0.5.1.

Example usage:

How to run the example application

  1. Install Mbed Edge.
  2. Install Node.js v8 or higher.
  3. Clone this repository.
  4. Install dependencies via:

    $ npm install
  5. Start Mbed Edge via:

    $ build/bin/edge-core -o 9101
  6. Run the example application:

    $ node example/buttons.js

Running in a VM

Mbed Edge only runs on Linux, but it's useful to run the protocol translator from your host OS. To do this, use socat to forward events from the Edge socket to a TCP socket. On your VM run:

$ socat TCP-LISTEN:22223,reuseaddr,fork UNIX-CLIENT:/tmp/edge.sock

Then, call Mbed Edge.js via:

const Edge = require('mbed-edge-js');

let edge = new Edge('ws://YOUR_VM_IP:22223', 'your_protocol_translator');