Skip to content

Commit 416adff

Browse files
authored
Release v1.9-dev
2 parents 274ce80 + 93b6687 commit 416adff

File tree

3 files changed

+67
-25
lines changed

3 files changed

+67
-25
lines changed

README.md

Lines changed: 65 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MySensors NodeManager [![Build Status](https://travis-ci.org/mysensors/NodeManager.svg?branch=development)](https://travis-ci.org/mysensors/NodeManager)
1+
# MySensors NodeManager [![Build Status](https://travis-ci.org/mysensors/NodeManager.svg?branch=master)](https://travis-ci.org/mysensors/NodeManager)
22

33
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.
44
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
2323
## Installation
2424

2525
* 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)
3427

3528
### Upgrade
3629

@@ -41,12 +34,13 @@ Please be aware when upgrading to v1.8 from an older version this procedure is n
4134

4235
## Configuration
4336

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)
4540

4641
### MySensors configuration
4742

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.
5044

5145
### NodeManager configuration
5246

@@ -81,7 +75,7 @@ Once the NodeManager library header file is included, a global instance of the N
8175

8276
NodeManager provides built-in implementation of a number of sensors through ad-hoc classes located within the "sensors" directory of the library.
8377
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)
8579
* Include the sensor header file (e.g. `#include <sensors/SensorBattery.h>`)
8680
* Create an instance of the sensor's class (e.g. `SensorBattery battery(node)`)
8781

@@ -175,9 +169,15 @@ SensorSHT21 sht21;
175169
The sensor will be then registered automatically with NodeManager which will take care of it all along its lifecycle.
176170
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.
177171
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+
178178
### Configure your sensors
179179
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.
181181
182182
Examples:
183183
@@ -202,7 +202,7 @@ Please note, if you configure a sleep cycle, this may have an impact on the repo
202202

203203
## Running your code
204204

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.
206206

207207
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.
208208
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
10301030

10311031
## How it works
10321032

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:
10341040

10351041
`NodeManager::before()`:
10361042
* 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
10391045

10401046
`NodeManager::presentation()`:
10411047
* Present the sketch
1042-
* Present each child of each of the registered sensors
1048+
* Present each child of each of each registered sensors
10431049

10441050
`NodeManager::setup()`:
10451051
* 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
10591065
* Go to sleep (if requested)
10601066

10611067
`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.
10661070

10671071
`NodeManager::receive()`:
10681072
* Receive a message from the radio network
10691073
* Dispatch the message to the recipient sensor
10701074

10711075
`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()`
10731077

10741078
`Sensor::interrupt()`:
10751079
* 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
11271131
When contributing with a new sensor follows the same guidelines presented above and proceed with the following steps:
11281132
* Define your class is in a header file named `SensorNAME_OF_THE_SENSOR.h` under the `sensors` directory
11291133
* 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
11301135
* Add an additional job in the Travis CI configuration file `.travis.yml`
11311136
* Add the sensor's specs in "Add your sensors" and in "Built-in sensors API" of the README.md file
11321137
* Add the name of the class of your sensor in the keywords.txt file
11331138

11341139
## Compatibility
11351140

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:
11371142
* v2.3.0
11381143
* v2.2.0
11391144
* v2.1.1
11401145

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+
11411152
## Release Notes
11421153

11431154
v1.0:
@@ -1257,4 +1268,34 @@ v1.7:
12571268
* Added support for TTP226/TTP229 Touch control sensor
12581269

12591270
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
1299+
* Fixed radio signal level reporting wrong values
1300+
* Fixed SensorLatchingRelay2Pins wrong pin selection
1301+
* Other minor bug fixes

examples/Template/Template.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ void before() {
378378
* Configure your sensors
379379
*/
380380

381+
// EXAMPLES:
381382
// report measures of every attached sensors every 10 seconds
382383
//nodeManager.setReportIntervalSeconds(10);
383384
// report measures of every attached sensors every 10 minutes

nodemanager/Constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Constants: define all the constants used by NodeManager
2424
*/
2525

2626
// define NodeManager version
27-
#define VERSION "1.8-dev"
27+
#define VERSION "1.9-dev"
2828

2929
// define on/off
3030
#define OFF 0

0 commit comments

Comments
 (0)