mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Update SensorTag to include Luxo and cleanup layout
This commit is contained in:
parent
a8cb187321
commit
91dc58d2b0
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
Copyright 2013 IBM Corp.
|
Copyright 2014.2015 IBM Corp.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@ -14,92 +14,62 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
<!-- First, the content of the edit dialog is defined. -->
|
|
||||||
|
|
||||||
<script type="text/x-red" data-template-name="sensorTag">
|
<script type="text/x-red" data-template-name="sensorTag">
|
||||||
<!-- data-template-name identifies the node type this is for -->
|
<div class="form-row">
|
||||||
|
<label for="node-input-uuid"><i class="fa fa-ellipsis-h"></i> UUID</label>
|
||||||
<!-- Each of the following divs creates a field in the edit dialog. -->
|
<input type="text" id="node-input-uuid" placeholder="optional device bluetooth id">
|
||||||
<!-- Generally, there should be an input for each property of the node. -->
|
</div>
|
||||||
<!-- The for and id attributes identify the corresponding property -->
|
<div class="form-row">
|
||||||
<!-- (with the 'node-input-' prefix). -->
|
<label for="node-input-name"><i class="fa fa-external-link"></i> Outputs</label>
|
||||||
<!-- The available icon classes are defined in Twitter Bootstrap -->
|
<input type="checkbox" id="node-input-humidity" style="display: inline-block; width: auto; vertical-align: top;"> Temperature and Humidity<br/>
|
||||||
|
<label> </label>
|
||||||
<!-- By convention, most nodes have a 'name' property. The following div -->
|
<input type="checkbox" id="node-input-temperature" style="display: inline-block; width: auto; vertical-align: top;"> IR Temperature<br/>
|
||||||
<!-- provides the necessary field. -->
|
<label> </label>
|
||||||
|
<input type="checkbox" id="node-input-pressure" style="display: inline-block; width: auto; vertical-align: top;"> Pressure<br/>
|
||||||
|
<label> </label>
|
||||||
|
<input type="checkbox" id="node-input-magnetometer" style="display: inline-block; width: auto; vertical-align: top;"> Magnetometer<br/>
|
||||||
|
<label> </label>
|
||||||
|
<input type="checkbox" id="node-input-accelerometer" style="display: inline-block; width: auto; vertical-align: top;"> Accelerometer<br/>
|
||||||
|
<label> </label>
|
||||||
|
<input type="checkbox" id="node-input-gyroscope" style="display: inline-block; width: auto; vertical-align: top;"> Gyroscope<br/>
|
||||||
|
<label> </label>
|
||||||
|
<input type="checkbox" id="node-input-luxometer" style="display: inline-block; width: auto; vertical-align: top;"> Luminosity (CC2650 only)<br/>
|
||||||
|
<label> </label>
|
||||||
|
<input type="checkbox" id="node-input-keys" style="display: inline-block; width: auto; vertical-align: top;"> Button press<br/>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<label for="node-input-topic"><i class="fa fa-tasks"></i> Topic</label>
|
||||||
|
<input type="text" id="node-input-topic" placeholder="optional topic prefix - defaults to device id">
|
||||||
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||||
<input type="text" id="node-input-name" placeholder="Name">
|
<input type="text" id="node-input-name" placeholder="Name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-topic"><i class="fa fa-tag"></i> Topic</label>
|
|
||||||
<input type="text" id="node-input-topic" >
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-uuid"><i class="fa fa-tag"></i> UUID</label>
|
|
||||||
<input type="text" id="node-input-uuid" >
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Temperature</label>
|
|
||||||
<input type="checkbox" id="node-input-temperature" placeholder="">
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Humidity</label>
|
|
||||||
<input type="checkbox" id="node-input-humidity" >
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Pressure</label>
|
|
||||||
<input type="checkbox" id="node-input-pressure" >
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Magnetometer</label>
|
|
||||||
<input type="checkbox" id="node-input-magnetometer" >
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Accelerometer</label>
|
|
||||||
<input type="checkbox" id="node-input-accelerometer" >
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Gyroscope</label>
|
|
||||||
<input type="checkbox" id="node-input-gyroscope" >
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> Keys</label>
|
|
||||||
<input type="checkbox" id="node-input-keys" >
|
|
||||||
</div>
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<!-- Next, some simple help text is provided for the node. -->
|
|
||||||
<script type="text/x-red" data-help-name="sensorTag">
|
<script type="text/x-red" data-help-name="sensorTag">
|
||||||
<!-- data-help-name identifies the node type this help is for -->
|
|
||||||
<!-- This content appears in the Info sidebar when a node is selected -->
|
|
||||||
<!-- The first <p> is used as the pop-up tool tip when hovering over a -->
|
|
||||||
<!-- node in the palette. -->
|
|
||||||
<p>Input node for the Ti SensorTag</p>
|
<p>Input node for the Ti SensorTag</p>
|
||||||
<p>For this node to work correctly Node-Red needs to be run as <i>root</i>
|
<p>For this node to work correctly Node-Red needs to be run as <i>root</i>
|
||||||
, this due to how Bluetooth 4.0 support is currently implemented in
|
, this due to how Bluetooth 4.0 support is currently implemented in
|
||||||
Linux</p>
|
Linux</p>
|
||||||
<p>The UUID field is the mac address of the sensor tag, this is optional
|
<p>The UUID field is the mac address of the sensor tag, this is optional
|
||||||
can be used to bind to a specific SensorTag if you have more than one
|
can be used to bind to a specific SensorTag if you have more than one
|
||||||
active in range at the same time. (note you can only have one SensorTag
|
active in range at the same time. (note you can only have one SensorTag
|
||||||
per node-red instance at the moment)</p>
|
per node-red instance at the moment)</p>
|
||||||
<p>The topic setting is a prefix that will be pre-pended to name of the
|
<p>The topic setting is a prefix that will be pre-pended to name of the
|
||||||
sensor that creates the reading. e.g. <i>sensorTag/temperature</i></p>
|
sensor that creates the reading. e.g. <i>sensorTag/temperature</i>. If
|
||||||
<p><strong>NOTE:</strong> Only 1 sensorTag can be read from at a time,
|
blank it will be set to the UUID of the sensor tag.</p>
|
||||||
|
<p><strong>NOTE:</strong> Only 1 sensorTag can be read from at a time,
|
||||||
if you add more than one to the canvas then only the first to connect
|
if you add more than one to the canvas then only the first to connect
|
||||||
will work.</p>
|
will work.</p>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Finally, the node type is registered along with all of its properties -->
|
|
||||||
<!-- The example below shows a small subset of the properties that can be set-->
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('sensorTag',{
|
RED.nodes.registerType('sensorTag',{
|
||||||
category: 'advanced-function', // the palette category
|
category: 'advanced-function',
|
||||||
color:"GoldenRod",
|
color:"GoldenRod",
|
||||||
defaults: { // defines the editable properties of the node
|
defaults: {
|
||||||
name: {value:"sensorTag"}, // along with default values.
|
name: {value:"sensorTag"},
|
||||||
topic: {value:"sensorTag"},
|
topic: {value:"sensorTag"},
|
||||||
uuid: {value:undefined},
|
uuid: {value:undefined},
|
||||||
temperature: {value:true},
|
temperature: {value:true},
|
||||||
@ -108,21 +78,22 @@
|
|||||||
magnetometer: {value:true},
|
magnetometer: {value:true},
|
||||||
accelerometer: {value:true},
|
accelerometer: {value:true},
|
||||||
gyroscope: {value:true},
|
gyroscope: {value:true},
|
||||||
keys: {value:true}
|
keys: {value:true},
|
||||||
|
luxometer: {value:false}
|
||||||
},
|
},
|
||||||
inputs:0, // set the number of inputs - only 0 or 1
|
inputs:0,
|
||||||
outputs:1, // set the number of outputs - 0 to n
|
outputs:1,
|
||||||
icon: "bluetooth.png", // set the icon (held in public/icons)
|
icon: "bluetooth.png",
|
||||||
label: function() { // sets the default label contents
|
label: function() {
|
||||||
return this.name||this.topic||"sensorTag";
|
return this.name||this.topic||"sensorTag";
|
||||||
},
|
},
|
||||||
labelStyle: function() { // sets the class to apply to the label
|
labelStyle: function() {
|
||||||
return this.name?"node_label_italic":"";
|
return this.name?"node_label_italic":"";
|
||||||
},
|
},
|
||||||
oneditsave: function() {
|
oneditsave: function() {
|
||||||
var mac = $("#node-input-uuid").val();
|
var mac = $("#node-input-uuid").val();
|
||||||
mac = mac.toLowerCase();
|
mac = mac.toLowerCase();
|
||||||
//nasty hack as I can't get global replace to work
|
// nasty hack as I can't get global replace to work
|
||||||
mac = mac.replace(/:/gi,'');
|
mac = mac.replace(/:/gi,'');
|
||||||
mac = mac.replace(/:/gi,'');
|
mac = mac.replace(/:/gi,'');
|
||||||
mac = mac.replace(/:/gi,'');
|
mac = mac.replace(/:/gi,'');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2013 IBM Corp.
|
* Copyright 2014,2015 IBM Corp.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -14,129 +14,144 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
// Require main module
|
module.exports = function(RED) {
|
||||||
var RED = require(process.env.NODE_RED_HOME+"/red/red");
|
"use strict";
|
||||||
var SensorTag = require('sensortag');
|
var SensorTag = require('sensortag');
|
||||||
|
|
||||||
// The main node definition - most things happen in here
|
function sensorTagNode(n) {
|
||||||
function sensorTagNode(n) {
|
RED.nodes.createNode(this,n);
|
||||||
RED.nodes.createNode(this,n);
|
this.name = n.name;
|
||||||
this.name = n.name;
|
this.topic = n.topic;
|
||||||
this.topic = n.topic;
|
this.uuid = n.uuid;
|
||||||
this.uuid = n.uuid;
|
this.temperature = n.temperature;
|
||||||
this.temperature = n.temperature;
|
this.pressure = n.pressure;
|
||||||
this.pressure = n.pressure;
|
this.humidity = n.humidity;
|
||||||
this.humidity = n.humidity;
|
this.accelerometer = n.accelerometer;
|
||||||
this.accelerometer = n.accelerometer;
|
this.magnetometer = n.magnetometer;
|
||||||
this.magnetometer = n.magnetometer;
|
this.gyroscope = n.gyroscope;
|
||||||
this.gyroscope = n.gyroscope;
|
this.luxometer = n.luxometer;
|
||||||
this.keys = n.keys;
|
this.keys = n.keys;
|
||||||
|
if (this.uuid === "") { this.uuid = undefined; }
|
||||||
|
var node = this;
|
||||||
|
|
||||||
if (this.uuid === "") {
|
if ( typeof node.stag === "undefined") {
|
||||||
this.uuid = undefined;
|
SensorTag.discover(function(sensorTag) {
|
||||||
}
|
node.stag = sensorTag;
|
||||||
//console.log(this.uuid);
|
//console.log(sensorTag);
|
||||||
|
node.log("connected " + sensorTag._peripheral.uuid);
|
||||||
|
node.topic = node.topic || sensorTag._peripheral.uuid;
|
||||||
|
sensorTag.connect(function() {
|
||||||
|
//console.log("connected");
|
||||||
|
sensorTag.discoverServicesAndCharacteristics(function() {
|
||||||
|
sensorTag.enableIrTemperature(function() {});
|
||||||
|
sensorTag.on('irTemperatureChange',
|
||||||
|
function(objectTemperature, ambientTemperature) {
|
||||||
|
var msg = {'topic': node.topic + '/temperature'};
|
||||||
|
msg.payload = {'object': +objectTemperature.toFixed(1),
|
||||||
|
'ambient': +ambientTemperature.toFixed(1)
|
||||||
|
};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
sensorTag.enableBarometricPressure(function() {});
|
||||||
|
sensorTag.on('barometricPressureChange', function(pressure) {
|
||||||
|
var msg = {'topic': node.topic + '/pressure'};
|
||||||
|
msg.payload = {'pressure': parseInt(pressure)};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
sensorTag.enableHumidity(function() {});
|
||||||
|
sensorTag.on('humidityChange', function(temp, humidity) {
|
||||||
|
var msg = {'topic': node.topic + '/humidity'};
|
||||||
|
msg.payload = {'temperature': +temp.toFixed(1),
|
||||||
|
'humidity': +humidity.toFixed(1)
|
||||||
|
};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
sensorTag.enableAccelerometer(function() {});
|
||||||
|
sensorTag.on('accelerometerChange', function(x,y,z) {
|
||||||
|
var msg = {'topic': node.topic + '/accelerometer'};
|
||||||
|
msg.payload = {'x': +x.toFixed(2), 'y': +y.toFixed(2), 'z': +z.toFixed(2)};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
sensorTag.enableMagnetometer(function() {});
|
||||||
|
sensorTag.on('magnetometerChange', function(x,y,z) {
|
||||||
|
var msg = {'topic': node.topic + '/magnetometer'};
|
||||||
|
msg.payload = {'x': +x.toFixed(2), 'y': +y.toFixed(2), 'z': +z.toFixed(2)};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
sensorTag.enableGyroscope(function() {});
|
||||||
|
sensorTag.on('gyroscopeChange', function(x,y,z) {
|
||||||
|
var msg = {'topic': node.topic + '/gyroscope'};
|
||||||
|
msg.payload = {'x': +x.toFixed(2), 'y': +y.toFixed(2), 'z': +z.toFixed(2)};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
sensorTag.on('simpleKeyChange', function(left, right) {
|
||||||
|
var msg = {'topic': node.topic + '/keys'};
|
||||||
|
msg.payload = {'left': left, 'right': right};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
sensorTag.enableLuxometer(function() {});
|
||||||
|
sensorTag.on('luxometerChange', function(lux) {
|
||||||
|
var msg = {'topic': node.topic + '/luxometer'};
|
||||||
|
msg.payload = {'lux': parseInt(lux)};
|
||||||
|
node.send(msg);
|
||||||
|
});
|
||||||
|
enable(node);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},node.uuid);
|
||||||
|
} else {
|
||||||
|
console.log("reconfig",node.uuid);
|
||||||
|
enable(node);
|
||||||
|
}
|
||||||
|
|
||||||
var node=this;
|
this.on("close", function() {
|
||||||
|
if (node.stag) {
|
||||||
if ( typeof node.stag == "undefined") {
|
node.stag.disconnect(function() { node.log("disconnected ",node.uuid); });
|
||||||
//console.log("starting");
|
}
|
||||||
SensorTag.discover(function(sensorTag) {
|
|
||||||
node.stag = sensorTag;
|
|
||||||
sensorTag.connect(function() {
|
|
||||||
//console.log("connected");
|
|
||||||
sensorTag.discoverServicesAndCharacteristics(function() {
|
|
||||||
sensorTag.enableIrTemperature(function() {});
|
|
||||||
sensorTag.on('irTemperatureChange',
|
|
||||||
function(objectTemperature, ambientTemperature) {
|
|
||||||
var msg = {'topic': node.topic + '/temperature'};
|
|
||||||
msg.payload = {'object': objectTemperature.toFixed(1),
|
|
||||||
'ambient':ambientTemperature.toFixed(1)
|
|
||||||
};
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
sensorTag.enableBarometricPressure(function() {});
|
|
||||||
sensorTag.on('barometricPressureChange', function(pressure) {
|
|
||||||
var msg = {'topic': node.topic + '/pressure'};
|
|
||||||
msg.payload = {'pres': pressure.toFixed(1)};
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
sensorTag.enableHumidity(function() {});
|
|
||||||
sensorTag.on('humidityChange', function(temp, humidity) {
|
|
||||||
var msg = {'topic': node.topic + '/humidity'};
|
|
||||||
msg.payload = {'temp': temp.toFixed(1),
|
|
||||||
'humidity': humidity.toFixed(1)
|
|
||||||
};
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
sensorTag.enableAccelerometer(function() {});
|
|
||||||
sensorTag.on('accelerometerChange', function(x,y,z) {
|
|
||||||
var msg = {'topic': node.topic + '/accelerometer'};
|
|
||||||
msg.payload = {'x': x, 'y': y, 'z': z};
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
sensorTag.enableMagnetometer(function() {});
|
|
||||||
sensorTag.on('magnetometerChange', function(x,y,z) {
|
|
||||||
var msg = {'topic': node.topic + '/magnetometer'};
|
|
||||||
msg.payload = {'x': x, 'y': y, 'z': z};
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
sensorTag.enableGyroscope(function() {});
|
|
||||||
sensorTag.on('gyroscopeChange', function(x,y,z) {
|
|
||||||
var msg = {'topic': node.topic + '/gyroscope'};
|
|
||||||
msg.payload = {'x': x, 'y': y, 'z': z};
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
sensorTag.on('simpleKeyChange', function(left, right) {
|
|
||||||
var msg = {'topic': node.topic + '/keys'};
|
|
||||||
msg.payload = {'left': left, 'right': right};
|
|
||||||
node.send(msg);
|
|
||||||
});
|
|
||||||
enable(node);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},node.uuid);
|
|
||||||
} else {
|
|
||||||
//console.log("reconfig");
|
|
||||||
enable(node);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function enable(node) {
|
function enable(node) {
|
||||||
if (node.temperature) {
|
if (node.temperature) {
|
||||||
node.stag.notifyIrTemperature(function() {});
|
node.stag.notifyIrTemperature(function() {});
|
||||||
} else {
|
} else {
|
||||||
node.stag.unnotifyIrTemperature(function() {});
|
node.stag.unnotifyIrTemperature(function() {});
|
||||||
}
|
}
|
||||||
if (node.pressure) {
|
if (node.pressure) {
|
||||||
node.stag.notifyBarometricPressure(function() {});
|
node.stag.notifyBarometricPressure(function() {});
|
||||||
} else {
|
} else {
|
||||||
node.stag.unnotifyBarometricPressure(function() {});
|
node.stag.unnotifyBarometricPressure(function() {});
|
||||||
}
|
}
|
||||||
if (node.humidity) {
|
if (node.humidity) {
|
||||||
node.stag.notifyHumidity(function() {});
|
node.stag.notifyHumidity(function() {});
|
||||||
} else {
|
} else {
|
||||||
node.stag.unnotifyHumidity(function() {});
|
node.stag.unnotifyHumidity(function() {});
|
||||||
}
|
}
|
||||||
if (node.accelerometer) {
|
if (node.accelerometer) {
|
||||||
node.stag.notifyAccelerometer(function() {});
|
node.stag.notifyAccelerometer(function() {});
|
||||||
} else {
|
} else {
|
||||||
node.stag.unnotifyAccelerometer(function() {});
|
node.stag.unnotifyAccelerometer(function() {});
|
||||||
}
|
}
|
||||||
if (node.magnetometer) {
|
if (node.magnetometer) {
|
||||||
node.stag.notifyMagnetometer(function() {});
|
node.stag.notifyMagnetometer(function() {});
|
||||||
} else {
|
} else {
|
||||||
node.stag.unnotifyMagnetometer(function() {});
|
node.stag.unnotifyMagnetometer(function() {});
|
||||||
}
|
}
|
||||||
if (node.gyroscope) {
|
if (node.gyroscope) {
|
||||||
node.stag.notifyGyroscope(function() {});
|
node.stag.notifyGyroscope(function() {});
|
||||||
} else {
|
} else {
|
||||||
node.stag.unnotifyGyroscope(function() {});
|
node.stag.unnotifyGyroscope(function() {});
|
||||||
}
|
}
|
||||||
if (node.keys) {
|
if (node.luxometer) {
|
||||||
node.stag.notifySimpleKey(function() {});
|
node.stag.notifyLuxometer(function() {});
|
||||||
} else {
|
} else {
|
||||||
node.stag.unnotifySimpleKey(function() {});
|
node.stag.unnotifyLuxometer(function() {});
|
||||||
|
}
|
||||||
|
if (node.keys) {
|
||||||
|
node.stag.notifySimpleKey(function() {});
|
||||||
|
} else {
|
||||||
|
node.stag.unnotifySimpleKey(function() {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
RED.nodes.registerType("sensorTag",sensorTagNode);
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("sensorTag",sensorTagNode);
|
|
||||||
|
@ -4,25 +4,28 @@ node-red-node-sensortag
|
|||||||
This node adds support to Node-RED to read from the Texas Instruments SensorTag.
|
This node adds support to Node-RED to read from the Texas Instruments SensorTag.
|
||||||
|
|
||||||
The SensorTag is a Bluetooth LE device hosting the following sensors:
|
The SensorTag is a Bluetooth LE device hosting the following sensors:
|
||||||
* Ambient & ir Temperature
|
|
||||||
* Barometric Pressure
|
|
||||||
* Humidity
|
|
||||||
* 3 axis Accelerometer
|
|
||||||
* 3 axis Magnetometer
|
|
||||||
* 3 axis Gyroscope
|
|
||||||
* 2 push Buttons
|
|
||||||
|
|
||||||
The config node allows the user to enable/disable any of the sensors listed above. The readings from
|
* Humidity and Temperature
|
||||||
|
* Ambient & IR Temperatures
|
||||||
|
* Barometric Pressure
|
||||||
|
* 3 axis Accelerometer
|
||||||
|
* 3 axis Gyroscope
|
||||||
|
* 3 axis Magnetometer
|
||||||
|
* 2 push Buttons
|
||||||
|
* 1 Luxometer (CC2650 version only)
|
||||||
|
|
||||||
|
The config node allows the user to enable/disable any of the sensors listed above. The readings from
|
||||||
these sensors will be sent as a JSON object payload with the sensor name appended to the topic provided:
|
these sensors will be sent as a JSON object payload with the sensor name appended to the topic provided:
|
||||||
|
|
||||||
* Temperature - { topic: [topic_prefix]/temperature, payload: { ambient: 21.2, object: 33.0 } }
|
|
||||||
* Barometric Pressure - { topic: [topic_prefix]/pressure, payload: { pres: 1000.1 } }
|
|
||||||
* Humidity - { topic: [topic_prefix]/humidity , payload: { temp: 21.2, humidity: 88} }
|
* Humidity - { topic: [topic_prefix]/humidity , payload: { temp: 21.2, humidity: 88} }
|
||||||
* Accelerometer - { topic: [topic_prefix]/ , payload: { x:0.0, y:9.8, z:0.0 } }
|
* Temperature - { topic: [topic_prefix]/temperature, payload: { ambient: 21.2, object: 33.0 } }
|
||||||
* Magnetometer - { topic: [topic_prefix]/ , payload: { x:0.0, y:0.0, z:0.0 } }
|
* Barometric Pressure - { topic: [topic_prefix]/pressure, payload: { pres: 1000 } }
|
||||||
* Gyroscope - { topic: [topic_prefix]/ , payload: { x:0.0, y:0.0, z:0.0 } }
|
* Accelerometer - { topic: [topic_prefix]/accelerometer , payload: { x:0.0, y:9.8, z:0.0 } }
|
||||||
* Buttons - { topic: [topic_prefix]/ , payload: { left: "down", right: "up"} }
|
* Magnetometer - { topic: [topic_prefix]/magnetometer , payload: { x:0.0, y:0.0, z:0.0 } }
|
||||||
|
* Gyroscope - { topic: [topic_prefix]/gyroscope , payload: { x:0.0, y:0.0, z:0.0 } }
|
||||||
|
* Luxometer - { topic: [topic_prefix]/luxometer , payload: { lux: 212 } }
|
||||||
|
* Buttons - { topic: [topic_prefix]/keys , payload: { left: true, right: false} }
|
||||||
|
|
||||||
The sensorTag library used by this node only supports using 1 SensorTag at once.
|
The sensorTag library used by this node only supports using 1 SensorTag at a time.
|
||||||
|
|
||||||
**NOTE:** Node-RED needs to be run as root inorder or access the Linux Bluetooth 4.0 system calls
|
**NOTE:** On Linux Node-RED needs to be run as root in order or access the Linux Bluetooth 4.0 system calls
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-sensortag",
|
"name": "node-red-node-sensortag",
|
||||||
"description": "A Node-RED node to read data from a TI SensorTag",
|
"description": "A Node-RED node to read data from a TI SensorTag",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"keywords" : ["node-red","sensortag"],
|
"keywords" : ["node-red","sensortag"],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"sensortag" : "~1.0.1"
|
"sensortag": "~1.0.1"
|
||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository" : {
|
"repository" : {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user