mbed-edge-js
v3.1.0
Published
Node.js library for Mbed Edge
Downloads
9
Readme
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 install
Start Mbed Edge via:
$ build/bin/edge-core -o 9101
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');