Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NodeManager_GasSensor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartHome
NodeManager_GasSensor
Commits
0abfc20e
Commit
0abfc20e
authored
8 years ago
by
user2684
Browse files
Options
Downloads
Patches
Plain Diff
Add debug messages before and after activating the radio #25
parent
899059e2
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NodeManagerTemplate/NodeManager.cpp
+9
-8
9 additions, 8 deletions
NodeManagerTemplate/NodeManager.cpp
NodeManagerTemplate/NodeManager.h
+2
-2
2 additions, 2 deletions
NodeManagerTemplate/NodeManager.h
NodeManagerTemplate/config.h
+2
-2
2 additions, 2 deletions
NodeManagerTemplate/config.h
with
13 additions
and
12 deletions
NodeManagerTemplate/NodeManager.cpp
+
9
−
8
View file @
0abfc20e
...
...
@@ -13,6 +13,7 @@ const char* AWAKE = "AWAKE";
const
char
*
REBOOT
=
"REBOOT"
;
const
char
*
CLEAR
=
"CLEAR"
;
const
char
*
WAKEUP
=
"WAKEUP"
;
const
char
*
STARTED
=
"STARTED"
;
/***************************************
PowerManager
...
...
@@ -21,7 +22,7 @@ const char* WAKEUP = "WAKEUP";
// set the vcc and ground pin the sensor is connected to
void
PowerManager
::
setPowerPins
(
int
ground_pin
,
int
vcc_pin
,
long
wait
)
{
#if DEBUG == 1
Serial
.
print
(
"P
OWE
R G="
);
Serial
.
print
(
"P
W
R G="
);
Serial
.
print
(
ground_pin
);
Serial
.
print
(
" V="
);
Serial
.
println
(
vcc_pin
);
...
...
@@ -964,13 +965,6 @@ void NodeManager::setSleepBetweenSend(int value) {
// register a sensor to this manager
int
NodeManager
::
registerSensor
(
int
sensor_type
,
int
pin
,
int
child_id
)
{
#if DEBUG == 1
if
(
_startup
)
{
Serial
.
print
(
"NodeManager v"
);
Serial
.
println
(
VERSION
);
_startup
=
false
;
}
#endif
// get a child_id if not provided by the user
if
(
child_id
<
0
)
child_id
=
_getAvailableChildId
();
// based on the given sensor type instantiate the appropriate class
...
...
@@ -1095,6 +1089,10 @@ Sensor* NodeManager::get(int child_id) {
// setup NodeManager
void
NodeManager
::
before
()
{
#if DEBUG == 1
Serial
.
print
(
"NodeManager v"
);
Serial
.
println
(
VERSION
);
#endif
if
(
_reboot_pin
>
-
1
)
{
#if DEBUG == 1
Serial
.
print
(
"REB P="
);
...
...
@@ -1157,6 +1155,9 @@ void NodeManager::before() {
// present NodeManager and its sensors
void
NodeManager
::
presentation
()
{
#if DEBUG == 1
Serial
.
println
(
"RADIO OK"
);
#endif
// present the service as a custom sensor to the controller
#if DEBUG == 1
Serial
.
print
(
"PRES I="
);
...
...
This diff is collapsed.
Click to expand it.
NodeManagerTemplate/NodeManager.h
+
2
−
2
View file @
0abfc20e
...
...
@@ -41,7 +41,7 @@
#define EEPROM_SLEEP_UNIT 4
// define NodeManager version
#define VERSION 1.
2
#define VERSION 1.
3
/************************************
* Include user defined configuration settings
...
...
@@ -196,6 +196,7 @@
// include MySensors libraries
#include
<core/MySensorsCore.h>
#include
<core/MyHwAVR.h>
//#include <core/MyHwATMega328.h>
// include third party libraries
#if MODULE_DHT == 1
...
...
@@ -665,7 +666,6 @@ class NodeManager {
void
_sleep
();
int
_getAvailableChildId
();
int
_getInterruptInitialValue
(
int
mode
);
bool
_startup
=
true
;
};
#endif
This diff is collapsed.
Click to expand it.
NodeManagerTemplate/config.h
+
2
−
2
View file @
0abfc20e
...
...
@@ -13,10 +13,10 @@
*/
#define MY_BAUD_RATE 9800
//#define MY_DEBUG
//
#define MY_NODE_ID 100
#define MY_NODE_ID 100
#define MY_RADIO_NRF24
//
#define MY_RF24_ENABLE_ENCRYPTION
#define MY_RF24_ENABLE_ENCRYPTION
//#define MY_RF24_CHANNEL 76
//#define MY_RADIO_RFM69
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment