3.1.0 • Published 7 years ago
mbed-edge-js v3.1.0
Mbed Edge.js
Node.js protocol translator library to manage devices through Mbed Edge. Tested against Mbed Edge v0.5.1.
Example usage:
- Example application
- Mbed Cloud Bluetooth Devicelink.
- LoRa bridge (internal to Arm).
How to run the example application
- Install Mbed Edge.
- Install Node.js v8 or higher.
- Clone this repository.
Install dependencies via:
$ npm installStart Mbed Edge via:
$ build/bin/edge-core -o 9101Run 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.sockThen, call Mbed Edge.js via:
const Edge = require('mbed-edge-js');
let edge = new Edge('ws://YOUR_VM_IP:22223', 'your_protocol_translator');