Modified all example sketches to report the sketch info to the gateway/controller.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// This is an example on how to send in battery measurement for a sensor
|
// This is an example that demonstrates how to report the battery level for a sensor
|
||||||
// For instruction how to measure battery power on A0 see the follwoing forum
|
// Instructions for measuring battery capacity on A0 are available in the follwoing forum
|
||||||
// thread: http://forum.micasaverde.com/index.php/topic,20078.0.html
|
// thread: http://forum.micasaverde.com/index.php/topic,20078.0.html
|
||||||
|
|
||||||
|
|
||||||
@@ -21,6 +21,9 @@ void setup()
|
|||||||
// use the 1.1 V internal reference
|
// use the 1.1 V internal reference
|
||||||
analogReference(INTERNAL);
|
analogReference(INTERNAL);
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Battery Meter", "1.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ void setup()
|
|||||||
sensors.begin();
|
sensors.begin();
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Temperature Sensor", "1.0");
|
||||||
|
|
||||||
|
|
||||||
// Fetch the number of attached sensors
|
// Fetch the number of attached sensors
|
||||||
numSensors = sensors.getDeviceCount();
|
numSensors = sensors.getDeviceCount();
|
||||||
// Register all sensors to gw (they will be created as child devices)
|
// Register all sensors to gw (they will be created as child devices)
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Distance Sensor", "1.0");
|
||||||
|
|
||||||
// Register all sensors to gw (they will be created as child devices)
|
// Register all sensors to gw (they will be created as child devices)
|
||||||
gw.sendSensorPresentation(0, S_DISTANCE);
|
gw.sendSensorPresentation(0, S_DISTANCE);
|
||||||
metric = gw.isMetricSystem();
|
metric = gw.isMetricSystem();
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Energy Meter", "1.0");
|
||||||
|
|
||||||
|
|
||||||
// Register this device as power sensor
|
// Register this device as power sensor
|
||||||
gw.sendSensorPresentation(CHILD_ID, S_POWER);
|
gw.sendSensorPresentation(CHILD_ID, S_POWER);
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ void setup()
|
|||||||
irrecv.enableIRIn(); // Start the ir receiver
|
irrecv.enableIRIn(); // Start the ir receiver
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("IR Sensor", "1.0");
|
||||||
|
|
||||||
// Register a sensors to gw. Use binary light for test purposes.
|
// Register a sensors to gw. Use binary light for test purposes.
|
||||||
gw.sendSensorPresentation(CHILD_1, S_LIGHT);
|
gw.sendSensorPresentation(CHILD_1, S_LIGHT);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Light Lux Sensor", "1.0");
|
||||||
|
|
||||||
// Register all sensors to gateway (they will be created as child devices)
|
// Register all sensors to gateway (they will be created as child devices)
|
||||||
gw.sendSensorPresentation(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
|
gw.sendSensorPresentation(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Light Sensor", "1.0");
|
||||||
|
|
||||||
// Register all sensors to gateway (they will be created as child devices)
|
// Register all sensors to gateway (they will be created as child devices)
|
||||||
gw.sendSensorPresentation(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
|
gw.sendSensorPresentation(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ Sleep sleep;
|
|||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Motion Sensor", "1.0");
|
||||||
|
|
||||||
pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input
|
pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input
|
||||||
// Register all sensors to gw (they will be created as child devices)
|
// Register all sensors to gw (they will be created as child devices)
|
||||||
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
|
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ boolean metric;
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Pressure Sensor", "1.0");
|
||||||
|
|
||||||
if (!bmp.begin()) {
|
if (!bmp.begin()) {
|
||||||
Serial.println("Could not find a valid BMP085 sensor, check wiring!");
|
Serial.println("Could not find a valid BMP085 sensor, check wiring!");
|
||||||
while (1) { }
|
while (1) { }
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Relay", "1.0");
|
||||||
|
|
||||||
// Register all sensors to gw (they will be created as child devices)
|
// Register all sensors to gw (they will be created as child devices)
|
||||||
for (int i=0; i<NUMBER_OF_RELAYS;i++) {
|
for (int i=0; i<NUMBER_OF_RELAYS;i++) {
|
||||||
gw.sendSensorPresentation(RELAY_1+i, S_LIGHT);
|
gw.sendSensorPresentation(RELAY_1+i, S_LIGHT);
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Relay & Button", "1.0");
|
||||||
|
|
||||||
// Set buttonPin as Input
|
// Set buttonPin as Input
|
||||||
pinMode(BUTTON_PIN, INPUT);
|
pinMode(BUTTON_PIN, INPUT);
|
||||||
buttVal = digitalRead(BUTTON_PIN); //read initial state
|
buttVal = digitalRead(BUTTON_PIN); //read initial state
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void setup()
|
|||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
//Send the sensor node sketch version information to the gateway
|
//Send the sensor node sketch version information to the gateway
|
||||||
gw.sendSketchInfo("RelayingNode", "1.2");
|
gw.sendSketchInfo("Relaying Node", "1.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Servo", "1.0");
|
||||||
|
|
||||||
// Register all sensors to gw (they will be created as child devices)
|
// Register all sensors to gw (they will be created as child devices)
|
||||||
gw.sendSensorPresentation(CHILD_ID, S_COVER);
|
gw.sendSensorPresentation(CHILD_ID, S_COVER);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Soil Moisture Sensor", "1.0");
|
||||||
|
|
||||||
pinMode(DIGITAL_INPUT_SOIL_SENSOR, INPUT); // sets the soil sensor digital pin as input
|
pinMode(DIGITAL_INPUT_SOIL_SENSOR, INPUT); // sets the soil sensor digital pin as input
|
||||||
// Register all sensors to gw (they will be created as child devices)
|
// Register all sensors to gw (they will be created as child devices)
|
||||||
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
|
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Clock", "1.0");
|
||||||
|
|
||||||
// Register any sensortype. This example we just create a motion sensor.
|
// Register any sensortype. This example we just create a motion sensor.
|
||||||
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
|
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ void setup()
|
|||||||
{
|
{
|
||||||
gw.begin();
|
gw.begin();
|
||||||
|
|
||||||
|
// Send the sketch version information to the gateway and Controller
|
||||||
|
gw.sendSketchInfo("Water Meter", "1.0");
|
||||||
|
|
||||||
// Register this device as Waterflow sensor
|
// Register this device as Waterflow sensor
|
||||||
gw.sendSensorPresentation(CHILD_ID, S_WATER);
|
gw.sendSensorPresentation(CHILD_ID, S_WATER);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user