This is a very simplistic WebSocket based client for communicating with a O-MI Node, using O-DF formatted messages.
Start a O-MI Node
Download the reference server implementation from:
Extract it to an appropriate location.
conf/application.conf. Ensure the localhost is not commented out in the IP whitelist section.
Ensure you have java 8 or later.
In a console/command line type
java -version, response should be something like this:
greg@desktop ~/o-mi-node-0.8.2-warp10 $ java -versionjava version "1.8.0_131"Java SE Runtime EnvironmentJava HotSpot 64-Bit Server VM
Run the server.
greg@desktop ~/o-mi-node-0.8.2-warp10 $ ./bin/o-mi-node
The first startup will take some few minutes to start, be patient.
Run the example
Create a working directory for your project and install this package there.
npm install omi-odf
app.js with the following sample code:
var OmiClient = OmiClient;var inspect = inspect;var host = 'ws://localhost:8080';var omiClient = host;omiClient;omiClient;
Run the program:
This code is available at GitHub:
git clone https://github.com/ControlThings/omi-odf-nodejs.git