temperature-stream

Temperature values as a stream

npm install temperature-stream
12 downloads in the last month

Build Status Dependency Status

temperature-stream

Temperature from a Raspberry Pi GPIO as a stream

Usage

var fs = require("fs")
var tsr = require("temperature-stream")

var target = fs.createWriteStream(tempdir + "/temp.txt")
fs.createReadStream("/sys/bus/w1/devices/10-000802824e58/w1-slave")
    .pipe(tsr())
    .pipe(target)

Adding a semicolon to the end of the resulting data:

var fs = require("fs")
var tsr = require("temperature-stream")

var target = fs.createWriteStream(tempdir + "/temp.txt")
fs.createReadStream("/sys/bus/w1/devices/10-000802824e58/w1-slave")
    .pipe(tsr(";"))
    .pipe(target) // 22750;

Input / Output

Input:

6c 01 4b 46 7f ff 04 10 5d : crc=5d YES
6c 01 4b 46 7f ff 04 10 5d t=22750

Output:

22750
npm loves you