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
Copy file name to clipboardExpand all lines: README.md
+32-22Lines changed: 32 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,14 +70,16 @@ Since NodeManager has to communicate with the MySensors gateway on your behalf,
70
70
// RFM69 radio settings
71
71
//#define MY_RADIO_RFM69
72
72
//#define MY_RFM69_FREQUENCY RF69_868MHZ
73
+
//#define MY_RFM69_FREQUENCY RFM69_868MHZ
73
74
//#define MY_IS_RFM69HW
74
-
//#define MY_DEBUG_VERBOSE_RFM69
75
75
//#define MY_RFM69_NEW_DRIVER
76
76
//#define MY_RFM69_ENABLE_ENCRYPTION
77
77
//#define MY_RFM69_NETWORKID 100
78
+
//#define MY_DEBUG_VERBOSE_RFM69
78
79
//#define MY_RF69_IRQ_PIN D1
79
80
//#define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
80
81
//#define MY_RF69_SPI_CS D2
82
+
//#define MY_RFM69_ATC_MODE_DISABLED
81
83
82
84
// RS485 serial transport settings
83
85
//#define MY_RS485
@@ -168,7 +170,7 @@ The next step is to enable NodeManager's additional functionalities and the modu
168
170
// if enabled, a battery sensor will be created at BATTERY_CHILD_ID and will report vcc voltage together with the battery level percentage
169
171
#defineBATTERY_SENSOR 1
170
172
// 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
-
#defineSIGNAL_SENSOR1
173
+
#defineSIGNAL_SENSOR0
172
174
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
173
175
#defineSERVICE_MESSAGES 0
174
176
@@ -180,7 +182,7 @@ The next step is to enable NodeManager's additional functionalities and the modu
180
182
#defineMODULE_DIGITAL_OUTPUT 1
181
183
// Enable this module to use one of the following sensors: SENSOR_DHT11, SENSOR_DHT22
182
184
#defineMODULE_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
184
186
#defineMODULE_SHT21 0
185
187
// Enable this module to use one of the following sensors: SENSOR_SWITCH, SENSOR_DOOR, SENSOR_MOTION
186
188
#defineMODULE_SWITCH 0
@@ -379,22 +381,22 @@ The next step is to configure NodeManager with settings which will instruct how
379
381
380
382
### Set reporting intervals and sleeping cycles
381
383
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:
383
385
384
386
Function | Description
385
387
------------ | -------------
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
390
392
391
393
For example, to put the node to sleep in cycles of 10 minutes:
392
394
393
395
~~~c
394
396
nodeManager.setSleepMinutes(10);
395
397
~~~
396
398
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:
398
400
~~~c
399
401
int id = nodeManager.registerSensor(SENSOR_DHT22,6);
400
402
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
469
471
// define what to do during receive() when the sensor receives a message
470
472
voidonReceive(const MyMessage & message);
471
473
// 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();
475
477
~~~
476
478
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:
@@ -747,6 +749,12 @@ Each sensor class can expose additional methods.
747
749
void fadeTo(int value);
748
750
~~~
749
751
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
+
750
758
### Upload your sketch
751
759
752
760
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 `
767
775
No need to implement anything on your side since for built-in sensors this is handled automatically.
768
776
769
777
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
+
770
779
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`.
771
780
For example, to request a battery report, find the function you need to call remotely within the documentation:
772
781
~~~c
@@ -806,11 +815,11 @@ If you want to decrease the temperature offset of a thermistor sensor to -2:
806
815
~~~
807
816
`100;1;2;0;48;105,-2`
808
817
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).
810
819
811
820
## Understanding NodeManager: how it works
812
821
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:
814
823
815
824
NodeManager::before():
816
825
* 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.
1297
1306
1298
1307
### Reporting an issue or request an enhancement
1299
1308
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>).
1301
1310
1302
1311
1303
1312
### Contributing to the code
@@ -1398,8 +1407,9 @@ v1.5:
1398
1407
* Added common gateway settings in config.h
1399
1408
1400
1409
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
1403
1413
* All intervals (measure/battery reports) are now time-based
1404
1414
* Added support for BMP280 temperature and pressure sensor
1405
1415
* Added support for RS485 serial transport
@@ -1408,14 +1418,14 @@ v1.6:
1408
1418
* Added support for AM2320 temperature/humidity sensor
1409
1419
* Added support for PT100 high temperature sensor
1410
1420
* 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
1412
1422
* Added support for generic dimmer sensor (PWM output)
1413
1423
* 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
1415
1425
* SensorRainGauge now supports sleep mode
1416
1426
* SensorSwitch now supports awake mode
1417
1427
* SensorLatchingRealy now handles automatically both on and off commands
1418
1428
* SensorMQ now depends on its own module
1419
-
* Added automatic off capability (safeguard) to SensorDigitalOutput
1429
+
* Added safeguard (automatic off) to SensorDigitalOutput
1420
1430
* Any sensor can now access all NodeManager's functions
Copy file name to clipboardExpand all lines: config.h
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,16 @@
29
29
// RFM69 radio settings
30
30
//#define MY_RADIO_RFM69
31
31
//#define MY_RFM69_FREQUENCY RF69_868MHZ
32
+
//#define MY_RFM69_FREQUENCY RFM69_868MHZ
32
33
//#define MY_IS_RFM69HW
33
-
//#define MY_DEBUG_VERBOSE_RFM69
34
34
//#define MY_RFM69_NEW_DRIVER
35
35
//#define MY_RFM69_ENABLE_ENCRYPTION
36
36
//#define MY_RFM69_NETWORKID 100
37
+
//#define MY_DEBUG_VERBOSE_RFM69
37
38
//#define MY_RF69_IRQ_PIN D1
38
39
//#define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
39
40
//#define MY_RF69_SPI_CS D2
41
+
//#define MY_RFM69_ATC_MODE_DISABLED
40
42
41
43
// RS485 serial transport settings
42
44
//#define MY_RS485
@@ -121,7 +123,7 @@
121
123
// 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
122
124
#defineBATTERY_SENSOR 1
123
125
// 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
-
#defineSIGNAL_SENSOR1
126
+
#defineSIGNAL_SENSOR0
125
127
// if enabled, send a SLEEPING and AWAKE service messages just before entering and just after leaving a sleep cycle and STARTED when starting/rebooting
126
128
#defineSERVICE_MESSAGES 0
127
129
@@ -131,9 +133,9 @@
131
133
#defineMODULE_DIGITAL_INPUT 1
132
134
// Enable this module to use one of the following sensors: SENSOR_DIGITAL_OUTPUT, SENSOR_RELAY, SENSOR_LATCHING_RELAY
133
135
#defineMODULE_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
135
137
#defineMODULE_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
137
139
#defineMODULE_SHT21 0
138
140
// Enable this module to use one of the following sensors: SENSOR_SWITCH, SENSOR_DOOR, SENSOR_MOTION
0 commit comments