Skip to content

Commit d4d7d88

Browse files
committed
Updated documentation
1 parent e70b14d commit d4d7d88

File tree

3 files changed

+42
-29
lines changed

3 files changed

+42
-29
lines changed

NodeManager.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ NodeManager includes the following main components:
88
- Remote configuration: allows configuring remotely the node without the need to have physical access to it
99
- Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line
1010
Documentation available on: https://github.com/mysensors/NodeManager
11-
*/
11+
*/
1212

1313

1414
// load user settings
@@ -33,9 +33,10 @@ void before() {
3333
/*
3434
* Register below your sensors
3535
*/
36+
37+
3638

37-
38-
39+
3940
/*
4041
* Register above your sensors
4142
*/

README.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ Since NodeManager has to communicate with the MySensors gateway on your behalf,
7070
// RFM69 radio settings
7171
//#define MY_RADIO_RFM69
7272
//#define MY_RFM69_FREQUENCY RF69_868MHZ
73+
//#define MY_RFM69_FREQUENCY RFM69_868MHZ
7374
//#define MY_IS_RFM69HW
74-
//#define MY_DEBUG_VERBOSE_RFM69
7575
//#define MY_RFM69_NEW_DRIVER
7676
//#define MY_RFM69_ENABLE_ENCRYPTION
7777
//#define MY_RFM69_NETWORKID 100
78+
//#define MY_DEBUG_VERBOSE_RFM69
7879
//#define MY_RF69_IRQ_PIN D1
7980
//#define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
8081
//#define MY_RF69_SPI_CS D2
82+
//#define MY_RFM69_ATC_MODE_DISABLED
8183

8284
// RS485 serial transport settings
8385
//#define MY_RS485
@@ -168,7 +170,7 @@ The next step is to enable NodeManager's additional functionalities and the modu
168170
// if enabled, a battery sensor will be created at BATTERY_CHILD_ID and will report vcc voltage together with the battery level percentage
169171
#define BATTERY_SENSOR 1
170172
// if enabled, a signal sensor will be created at RSSI_CHILD_ID (202 by default) and will report the signal quality of the transport layer
171-
#define SIGNAL_SENSOR 1
173+
#define SIGNAL_SENSOR 0
172174
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
173175
#define SERVICE_MESSAGES 0
174176

@@ -180,7 +182,7 @@ The next step is to enable NodeManager's additional functionalities and the modu
180182
#define MODULE_DIGITAL_OUTPUT 1
181183
// Enable this module to use one of the following sensors: SENSOR_DHT11, SENSOR_DHT22
182184
#define MODULE_DHT 0
183-
// Enable this module to use one of the following sensors: SENSOR_SHT21
185+
// Enable this module to use one of the following sensors: SENSOR_SHT21, SENSOR_HTU21D
184186
#define MODULE_SHT21 0
185187
// Enable this module to use one of the following sensors: SENSOR_SWITCH, SENSOR_DOOR, SENSOR_MOTION
186188
#define MODULE_SWITCH 0
@@ -379,22 +381,22 @@ The next step is to configure NodeManager with settings which will instruct how
379381

380382
### Set reporting intervals and sleeping cycles
381383

382-
If not instructed differently, the node will stay in awake, all the sensors will report every 10 minutes. Battery level and signal level will be automatically reported every 60 minutes. To change those settings, you can call the following functions on the nodeManager object:
384+
If not instructed differently, the node will stay awake and all the sensors will report every 10 minutes, battery level and signal level will be automatically reported every 60 minutes. To change those settings, you can call the following functions on the nodeManager object:
383385

384386
Function | Description
385387
------------ | -------------
386-
setSleepSeconds()/setSleepMinutes()/setSleepHours()/setSleepDays() | the time interval the node will spend in a (smart) sleep cycle
387-
setReportIntervalSeconds()/setReportIntervalMinutes()/setReportIntervalHours()/setReportIntervalDays() | the time interval the node will report the measures of all the attached sensors
388-
setBatteryReportSeconds()/setBatteryReportMinutes()/setBatteryReportHours()/setBatteryReportDays() | the time interval the node will report the battery level
389-
setSignalReportSeconds()/setSignalReportMinutes()/setSignalReportHours()/setSignalReportDays() | the time interval the node will report the radio signal level
388+
setSleepSeconds(), setSleepMinutes(), setSleepHours(), setSleepDays() | the time interval the node will spend in a (smart) sleep cycle
389+
setReportIntervalSeconds(), setReportIntervalMinutes(), setReportIntervalHours(), setReportIntervalDays() | the time interval the node will report the measures of all the attached sensors
390+
setBatteryReportSeconds(), setBatteryReportMinutes(), setBatteryReportHours(), setBatteryReportDays() | the time interval the node will report the battery level
391+
setSignalReportSeconds(), setSignalReportMinutes(), setSignalReportHours(), setSignalReportDays() | the time interval the node will report the radio signal level
390392

391393
For example, to put the node to sleep in cycles of 10 minutes:
392394

393395
~~~c
394396
nodeManager.setSleepMinutes(10);
395397
~~~
396398

397-
If you need every sensor to report at a different time interval, you can call `setReportIntervalMinutes()` or `setReportIntervalSeconds()` on the sensor's object. For example to have a DHT sensor reporting every 60 seconds while all the other sensors every 20 minutes:
399+
If you need every sensor to report at a different time interval, you can call `setBatteryReportSeconds(), setBatteryReportMinutes(), setBatteryReportHours(), setBatteryReportDays()` on the sensor's object. For example to have a DHT sensor reporting every 60 seconds while all the other sensors every 20 minutes:
398400
~~~c
399401
int id = nodeManager.registerSensor(SENSOR_DHT22,6);
400402
SensorDHT* dht = (SensorDHT*)nodeManager.get(id);
@@ -469,14 +471,14 @@ If you want to create a custom sensor and register it with NodeManager so it can
469471
// define what to do during receive() when the sensor receives a message
470472
void onReceive(const MyMessage & message);
471473
// define what to do when receiving a remote configuration message
472-
void onProcess(Request & request);
473-
// define what to do when receiving an interrupt
474-
void onInterrupt();
474+
void onProcess(Request & request);
475+
// define what to do when receiving an interrupt
476+
void onInterrupt();
475477
~~~
476478
477-
You can then instantiate your newly created class and register with NodeManager:
479+
You can then instantiate your newly created class and register it with NodeManager:
478480
~~~c
479-
nodeManager.registerSensor(new SensorCustom(&nodeManager,child_id, pin));
481+
nodeManager.registerSensor(new SensorCustom(&nodeManager,child_id, pin));
480482
~~~
481483

482484
### Configuring the sensors
@@ -747,6 +749,12 @@ Each sensor class can expose additional methods.
747749
void fadeTo(int value);
748750
~~~
749751

752+
### Creating a gateway
753+
754+
NodeManager can be also used to create a MySensors gateway. Open your config.h file and look for the gateway-specific defines under "MySensors gateway configuration". The most common settings are reported there, just uncomment those you need to use based on the network you are creating.
755+
756+
Please note you don't necessarily need a NodeManager gateway to interact with a NodeManager node. The NodeManager node is fully compatible with any existing gateway you are currently operating with.
757+
750758
### Upload your sketch
751759

752760
Upload your sketch to your arduino board as you are used to.
@@ -767,6 +775,7 @@ To activate a relay connected to the same node, child_id 100 we need to send a `
767775
No need to implement anything on your side since for built-in sensors this is handled automatically.
768776

769777
NodeManager exposes also a configuration service which is by default on child_id 200 so you can interact with it by sending `V_CUSTOM` type of messages and commands within the payload. For each `REQ` message, the node will respond with a `SET` message if successful.
778+
770779
Almost all the functions made available through the API can be called remotely. To do so, the payload must be in the format `<function_id>[,<value_to_set>]` where `function_id` is the number between square brackets you can find in the description above and, if the function takes and argument, this can be passed along in `value_to_set`.
771780
For example, to request a battery report, find the function you need to call remotely within the documentation:
772781
~~~c
@@ -806,11 +815,11 @@ If you want to decrease the temperature offset of a thermistor sensor to -2:
806815
~~~
807816
`100;1;2;0;48;105,-2`
808817

809-
Please note that anything set remotely will NOT persist a reboot apart from those setting the sleep interval which are saved to the EEPROM (provided `PERSIST` is enabled).
818+
Please note that anything set remotely will NOT persist a reboot apart from the sleep interval which is saved to the EEPROM (provided `PERSIST` is enabled).
810819

811820
## Understanding NodeManager: how it works
812821

813-
A NodeManager object is created for you at the beginning of your sketch and its main functions must called from within `before()`, `presentation()`, `loop()` and `receive()` to work properly. NodeManager will do the following during each phase:
822+
A NodeManager object is created for you at the beginning of your sketch and its main functions must be called from within `before()`, `presentation()`, `loop()` and `receive()` to work properly. NodeManager will do the following during each phase:
814823

815824
NodeManager::before():
816825
* Setup the interrupt pins to wake up the board based on the configured interrupts
@@ -1297,7 +1306,7 @@ Contributes to NodeManager are of course more than welcome.
12971306

12981307
### Reporting an issue or request an enhancement
12991308

1300-
For reporting an issue, requesting support for a new sensor or any other kind of enhancement, please drop a message either on the project's main page (<https://www.mysensors.org/download/node-manager>) or directly on Github (<https://github.com/mysensors/NodeManager/issues>).
1309+
For reporting an issue, requesting support for a new sensor or any other kind of enhancement, please drop a message either on the project's main page (<https://www.mysensors.org/download/node-manager>), on the MySensors Forum (<https://forum.mysensors.org/category/43/nodemanager>) or open an issue directly on Github (<https://github.com/mysensors/NodeManager/issues>).
13011310

13021311

13031312
### Contributing to the code
@@ -1398,8 +1407,9 @@ v1.5:
13981407
* Added common gateway settings in config.h
13991408

14001409
v1.6:
1401-
* Introduced new remote API to allow calling all NodeManager's and sensors' functions remotely
1402-
* Decoupled reporting intervals from sleeping cycles
1410+
* Introduced new remote API to allow calling almost ALL NodeManager's and its sensors' functions remotely
1411+
* Reporting interval configuration is now indipendent from the sleep cycle
1412+
* Reporting interval can be customized per-sensor
14031413
* All intervals (measure/battery reports) are now time-based
14041414
* Added support for BMP280 temperature and pressure sensor
14051415
* Added support for RS485 serial transport
@@ -1408,14 +1418,14 @@ v1.6:
14081418
* Added support for AM2320 temperature/humidity sensor
14091419
* Added support for PT100 high temperature sensor
14101420
* Added support for MH-Z19 CO2 sensor
1411-
* Added buil-in rain and soil moisture analog sensors
1421+
* Added support for analog rain and soil moisture sensors
14121422
* Added support for generic dimmer sensor (PWM output)
14131423
* Added support for power and water meter pulse sensors
1414-
* Radio signal level is reported automatically and on demand through child 202
1424+
* Radio signal level (RSSI) is now reported automatically like the battery level
14151425
* SensorRainGauge now supports sleep mode
14161426
* SensorSwitch now supports awake mode
14171427
* SensorLatchingRealy now handles automatically both on and off commands
14181428
* SensorMQ now depends on its own module
1419-
* Added automatic off capability (safeguard) to SensorDigitalOutput
1429+
* Added safeguard (automatic off) to SensorDigitalOutput
14201430
* Any sensor can now access all NodeManager's functions
14211431
* DHT sensor now using MySensors' DHT library

config.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@
2929
// RFM69 radio settings
3030
//#define MY_RADIO_RFM69
3131
//#define MY_RFM69_FREQUENCY RF69_868MHZ
32+
//#define MY_RFM69_FREQUENCY RFM69_868MHZ
3233
//#define MY_IS_RFM69HW
33-
//#define MY_DEBUG_VERBOSE_RFM69
3434
//#define MY_RFM69_NEW_DRIVER
3535
//#define MY_RFM69_ENABLE_ENCRYPTION
3636
//#define MY_RFM69_NETWORKID 100
37+
//#define MY_DEBUG_VERBOSE_RFM69
3738
//#define MY_RF69_IRQ_PIN D1
3839
//#define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
3940
//#define MY_RF69_SPI_CS D2
41+
//#define MY_RFM69_ATC_MODE_DISABLED
4042

4143
// RS485 serial transport settings
4244
//#define MY_RS485
@@ -121,7 +123,7 @@
121123
// if enabled, a battery sensor will be created at BATTERY_CHILD_ID (201 by default) and will report vcc voltage together with the battery level percentage
122124
#define BATTERY_SENSOR 1
123125
// if enabled, a signal sensor will be created at RSSI_CHILD_ID (202 by default) and will report the signal quality of the transport layer
124-
#define SIGNAL_SENSOR 1
126+
#define SIGNAL_SENSOR 0
125127
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
126128
#define SERVICE_MESSAGES 0
127129

@@ -131,9 +133,9 @@
131133
#define MODULE_DIGITAL_INPUT 1
132134
// Enable this module to use one of the following sensors: SENSOR_DIGITAL_OUTPUT, SENSOR_RELAY, SENSOR_LATCHING_RELAY
133135
#define MODULE_DIGITAL_OUTPUT 1
134-
// Enable this module to use one of the following sensors: SENSOR_DHT11, SENSOR_DHT22, SENSOR_DHT21
136+
// Enable this module to use one of the following sensors: SENSOR_DHT11, SENSOR_DHT22
135137
#define MODULE_DHT 0
136-
// Enable this module to use one of the following sensors: SENSOR_SHT21
138+
// Enable this module to use one of the following sensors: SENSOR_SHT21, SENSOR_HTU21D
137139
#define MODULE_SHT21 0
138140
// Enable this module to use one of the following sensors: SENSOR_SWITCH, SENSOR_DOOR, SENSOR_MOTION
139141
#define MODULE_SWITCH 0

0 commit comments

Comments
 (0)