owfs

A client library for the one wire server protocol

npm install owfs
1 downloads in the last day
10 downloads in the last week
33 downloads in the last month

Build Status david-dm

owfs

A node.js client library to owserver Documentation & protocol specs

Installation

npm install owfs

Examples

First of all you need a connection to a running owserver:

var Client = require("owfs").Client;
var con = new Client(HOST,PORT);

read

Reads a value of the specified path and passes the value to the callback.

con.read("/10.E89C8A020800/temperature", function(result){
    console.log(result);
})

write

Writes a value to the specified path and passes the raw owserver message to the callback.

con.write("/10.E89C8A020800/temperature",1,function(message){
    console.log(message)
})

Directory listings

According to OWFS message types there are several methods for directory listings. They all have the same argument list but behave a bit different.

Lists all the children of the supplied path as an array passed to the callback.

con.dir("/",function(directories){
    console.log(directories);
})

con.dirall("/",function(directories){
    console.log(directories);
})

con.get("/",function(directories){
    console.log(directories);
})

con.dirallslash("/",function(directories){
    console.log(directories);
})

con.getslash("/",function(directories){
    console.log(directories);
})
npm loves you