You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NodeManager is intended to take care on your behalf of all those common tasks that a MySensors node has to accomplish, speeding up the development cycle of your projects.
4
4
Consider it as a sort of frontend for your MySensors projects. When you need to add a sensor (which requires just uncommeting a single line),
@@ -23,14 +23,7 @@ NodeManager will take care of importing the required library, presenting the sen
23
23
## Installation
24
24
25
25
* Download the package or clone the git repository from https://github.com/mysensors/NodeManager
26
-
* Install NodeManager as an additional Arduino library (https://www.arduino.cc/en/Guide/Libraries)
27
-
* Open and customize one of the examples provided with the IDE or open the Template sketch which includes all the built-in sensors commented out
28
-
* Add your sensors, configure them and upload the sketch to your arduino board
29
-
30
-
### Installing the dependencies
31
-
32
-
Some of the sensors and buik-in capabilities rely on third party libraries. Those libraries are not included within NodeManager and have to be installed from the Arduino IDE Library Manager (Sketch -> Include Library -> Manager Libraries) or manually.
33
-
You need to install the library ONLY if you are planning to enable to use the sensor.
26
+
* Install NodeManager as an Arduino library (https://www.arduino.cc/en/Guide/Libraries)
34
27
35
28
### Upgrade
36
29
@@ -41,12 +34,13 @@ Please be aware when upgrading to v1.8 from an older version this procedure is n
41
34
42
35
## Configuration
43
36
44
-
Configuring a sketch with is using NodeManager requires a few steps. All the configuration directives are located within the main sketch.
37
+
* Open the Template sketch from the Arduino IDE under File -> Examples -> MySensors Nodemanager -> Template
38
+
* Alternatively, open one of the provided example
39
+
* Customize NodeManager's and your sensors settings (see below)
45
40
46
41
### MySensors configuration
47
42
48
-
Since NodeManager has to communicate with the MySensors network on your behalf, it has to know how to do it. On top of the main sketch you will find the typical MySensors directives you are used to which can be customized to configure the board to act as a MySensors node or a MySensors gateway.
49
-
Please note you don't necessarily need a NodeManager gateway to interact with a NodeManager node. A NodeManager node is fully compatible with any existing gateway you are currently operating with.
43
+
Since NodeManager has to communicate with the MySensors network on your behalf, it has to know how to do it. On top of the template sketch you will find the typical MySensors directives you are used to which can be customized to configure the board to act as a MySensors node or a MySensors gateway.
50
44
51
45
### NodeManager configuration
52
46
@@ -81,7 +75,7 @@ Once the NodeManager library header file is included, a global instance of the N
81
75
82
76
NodeManager provides built-in implementation of a number of sensors through ad-hoc classes located within the "sensors" directory of the library.
83
77
To use a built-in sensor:
84
-
* Install the required depedencies, if any (manually or through the Arduino IDE Library Manager)
78
+
* Install the required dependencies, if any manually or through the Arduino IDE Library Manager (see below)
85
79
* Include the sensor header file (e.g. `#include <sensors/SensorBattery.h>`)
86
80
* Create an instance of the sensor's class (e.g. `SensorBattery battery(node)`)
87
81
@@ -175,9 +169,15 @@ SensorSHT21 sht21;
175
169
The sensor will be then registered automatically with NodeManager which will take care of it all along its lifecycle.
176
170
NodeManager will present each sensor for you to the controller, query each sensor and report the measure back to the gateway/controller. For actuators (e.g. relays) those can be triggered by sending a `REQ`/`SET` message with the expected type to their assigned child id.
177
171
172
+
### Installing the dependencies
173
+
174
+
Some of the sensors and buit-in capabilities rely on third party libraries. Those libraries are not included within NodeManager and have to be installed from the Arduino IDE Library Manager (Sketch -> Include Library -> Manager Libraries) or manually.
175
+
You need to install the library ONLY if you are planning to enable to use the sensor.
176
+
177
+
178
178
### Configure your sensors
179
179
180
-
NodeManager and all the sensors can be configured from within `before()` in the main sketch. Find `Configure your sensors below` to customize the behavior of any sensor by calling one of the functions available.
180
+
NodeManager and all the sensors can be configured from within `before()` in the main sketch. Find `Configure your sensors below` to customize the behavior of any sensor by invoking one of the functions available.
181
181
182
182
Examples:
183
183
@@ -202,7 +202,7 @@ Please note, if you configure a sleep cycle, this may have an impact on the repo
202
202
203
203
## Running your code
204
204
205
-
Once finished configuring your node, upload your sketch to your arduino board as you are used to.
205
+
Once finished configuring your node, upload your sketch to your Arduino board as you are used to.
206
206
207
207
Check your gateway's logs to ensure the node is working as expected. You should see the node presenting itself, presenting all the registered sensors and reporting new measures at the configured reporting interval.
208
208
When `NODEMANAGER_DEBUG` is enabled, detailed information will be available through the serial port. The better understand the logs generaged by NodeManager, paste them into MySensors Log Parser (https://mysensors.org/build/parser).
@@ -1030,7 +1030,13 @@ Please note that anything set remotely will NOT persist a reboot apart from the
1030
1030
1031
1031
## How it works
1032
1032
1033
-
A NodeManager object has to be created the beginning of your sketch and the interaction with your code happens through callback functions, placed at the end of `before()`, `presentation()`, `loop()`, `receive()` and `receiveTimes()`. The following is the flow through which the different functions are called:
1033
+
* Your sketch should begin with the standard MySensors directives
1034
+
* NodeManager's settings can be customized through `NODEMANAGER_*` defines, just after. If not set, the default value will be used
1035
+
* To make use of the NodeManager library you have to include it with `#include <MySensors_NodeManager.h>`. This automatically includes the required MySensors libraries and creates an object called `nodeManager`
1036
+
* To add a sensor, just include the corresponding header file and creates an instance of the class
1037
+
* Interaction with your code happens through callback functions, placed at the end of `before()`, `presentation()`, `loop()`, `receive()` and `receiveTimes()`.
1038
+
1039
+
The following is detailed what happens when the different callback functions are called:
1034
1040
1035
1041
`NodeManager::before()`:
1036
1042
* Setup the interrupt pins to wake up the board based on the configured interrupts
@@ -1039,7 +1045,7 @@ A NodeManager object has to be created the beginning of your sketch and the inte
1039
1045
1040
1046
`NodeManager::presentation()`:
1041
1047
* Present the sketch
1042
-
* Present each child of each of the registered sensors
1048
+
* Present each child of each of each registered sensors
1043
1049
1044
1050
`NodeManager::setup()`:
1045
1051
* Sync the time with the controller (if requested)
@@ -1059,17 +1065,15 @@ A NodeManager object has to be created the beginning of your sketch and the inte
1059
1065
* Go to sleep (if requested)
1060
1066
1061
1067
`Sensor::loop()`:
1062
-
* If it is time for a new measure and if the sensor is powered by a pin, this is set to on
1063
-
* For each registered sensor, the sensor-specific `onLoop()` is called. If multiple samples are requested, this is run multiple times. `onLoop()` is not intended to send out any message but just sets a new value to the requested child
1064
-
* If the sensor is powered by a pin, this is turned off
1065
-
* If it is time to report, a message is sent to the gateway with the value. Depending on the configuration, this is not sent if it is the same as the previous value or sent anyway after a given number of cycles. These functionalies are not sensor-specific and common to all the sensors inheriting from the `Sensor` class.
1068
+
* If it is time to take a new measure he sensor-specific `onLoop()` is called. If multiple samples are requested, this is run multiple times. `onLoop()` is not intended to send out any message but just sets a new value to the requested child
1069
+
* If it is time to report, a message is sent to the gateway with the value. Depending on the configuration, this is not sent if it is the same as the previous value or sent anyway after a given number of cycles. These functionalities are not sensor-specific and common to all the sensors inheriting from the `Sensor` class.
1066
1070
1067
1071
`NodeManager::receive()`:
1068
1072
* Receive a message from the radio network
1069
1073
* Dispatch the message to the recipient sensor
1070
1074
1071
1075
`Sensor::receive()`:
1072
-
* Invoke `Sensor::loop()` which will execute the sensor main taks and eventually call `Sensor::onReceive()`
1076
+
* Invoke `Sensor::loop()` which will execute the sensor main task and eventually call `Sensor::onReceive()`
1073
1077
1074
1078
`Sensor::interrupt()`:
1075
1079
* Check if the value from the interrupt is matching the one expected
@@ -1127,17 +1131,24 @@ If there are changes introduced to the development branch that conflicts with an
1127
1131
When contributing with a new sensor follows the same guidelines presented above and proceed with the following steps:
1128
1132
* Define your class is in a header file named `SensorNAME_OF_THE_SENSOR.h` under the `sensors` directory
1129
1133
* Implement your sensor inline with the class. See `SensorExample.h` or other sensors for more commented examples and details
1134
+
* Add your sensor in `examples/Templates/Template.ino`, just after the last sensor
1130
1135
* Add an additional job in the Travis CI configuration file `.travis.yml`
1131
1136
* Add the sensor's specs in "Add your sensors" and in "Built-in sensors API" of the README.md file
1132
1137
* Add the name of the class of your sensor in the keywords.txt file
1133
1138
1134
1139
## Compatibility
1135
1140
1136
-
This version of NodeManager has been tested and is compatibile with the following MySensors library:
1141
+
This version of NodeManager has been tested and is compatible with the following MySensors library:
1137
1142
* v2.3.0
1138
1143
* v2.2.0
1139
1144
* v2.1.1
1140
1145
1146
+
You don't necessarily need a NodeManager gateway to interact with a NodeManager node. A NodeManager node is fully compatible with any existing gateway you are currently operating with.
1147
+
1148
+
There are generally speaking no compatibility issues in having in your network nodes running different versions of NodeManager.
1149
+
1150
+
Starting from v1.8 NodeManager is released as an Arduino library hence your code has to be migrated manually from previous versions.
1151
+
1141
1152
## Release Notes
1142
1153
1143
1154
v1.0:
@@ -1257,4 +1268,34 @@ v1.7:
1257
1268
* Added support for TTP226/TTP229 Touch control sensor
1258
1269
1259
1270
v1.8:
1260
-
1271
+
* Split NodeManager's core classes in individual files and each sensor code in its own dedicated header file
1272
+
* New Arduino-compatible library structure to allow easier integration and more consistent updates across version
1273
+
* Included a complete set of examples which can be loaded directly from the Arduino IDE
1274
+
* Simplified the template sketch with a global nodeManager object and sensors that can be imported directly from there
1275
+
* Debug output is now fully compatible with the one used by the MySensors library and integrated into MySensors LogParser
1276
+
* Better control on how often, if and when to sync the time with the controller for time-aware nodes
1277
+
* Added a Measure Timer so to allow splitting between taking measures and reporting
1278
+
* Added support for every sensor to keep track of the last value assigned to a child in EEPROM and restoring it upon a reboot
1279
+
* Introduced new capabilities for reporting every minute/hour/day or only at a given minute/hour/day
1280
+
* Added ability to read from the serial port at the end of each loop cycle, useful for debugging interactive sensors
1281
+
* Added support for pH sensor
1282
+
* Added support for PCA9685 as RGB/RGBW/W dimmer
1283
+
* Added support for DSM501A dust sensor
1284
+
* Added support for PN532 NFC RFID module
1285
+
* Added support for CCS811 CO2/VOC sensor
1286
+
* Added support for MPR121 Capacitive Touch Sensor
1287
+
* Added support for serial GSM/SMS device
1288
+
* Added support for FPM10A fingerprint sensor
1289
+
* Added support for SDS011 Air quality sensor
1290
+
* Added support for ESP32 devices
1291
+
* Added support for nRF52 radio
1292
+
* Improved SensorDigitalInput and NeoPixelSensor
1293
+
* Si7021 sensor is now using the library from the MySensors example
1294
+
* Reviewed the MQ Sensor implementation
1295
+
* Optimized memory utilization
1296
+
* Added Travis Continuous Integration tests
1297
+
* Fixed wrong battery report when using battery pin and SensorRain/SensorSoilMoisture
1298
+
* Fixed DigitalOutput safeguard not working as expected
0 commit comments