Skip to content

Commit 61e6cec

Browse files
tekka007henrikekblad
authored andcommitted
Fix regression, adjust parameters, typos (#699)
1 parent d204929 commit 61e6cec

File tree

5 files changed

+33
-28
lines changed

5 files changed

+33
-28
lines changed

MyConfig.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
* @brief Interval to dump content of routing table to eeprom
104104
*/
105105
#ifndef MY_ROUTING_TABLE_SAVE_INTERVAL_MS
106-
#define MY_ROUTING_TABLE_SAVE_INTERVAL_MS (10*60*1000ul)
106+
#define MY_ROUTING_TABLE_SAVE_INTERVAL_MS (30*60*1000ul)
107107
#endif
108108
/**
109109
* @def MY_TRANSPORT_SANITY_CHECK
@@ -114,17 +114,17 @@
114114

115115
/**
116116
* @def MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS
117-
* @brief Interval (in ms) of transport sanity checks
117+
* @brief Interval (in ms) for transport sanity checks
118118
*/
119119
#ifndef MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS
120-
#define MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS (60*1000ul)
120+
#define MY_TRANSPORT_SANITY_CHECK_INTERVAL_MS (15*60*1000ul)
121121
#endif
122122
/**
123123
* @def MY_TRANSPORT_DISCOVERY_INTERVAL_MS
124124
* @brief This is a gateway-only feature: Interval (in ms) to issue network discovery checks
125125
*/
126126
#ifndef MY_TRANSPORT_DISCOVERY_INTERVAL_MS
127-
#define MY_TRANSPORT_DISCOVERY_INTERVAL_MS (10*60*1000ul)
127+
#define MY_TRANSPORT_DISCOVERY_INTERVAL_MS (20*60*1000ul)
128128
#endif
129129

130130
/**

MySensors.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ MY_DEFAULT_RX_LED_PIN in your sketch instead to enable LEDs
239239
#endif
240240
#endif
241241

242+
#if defined(MY_REPEATER_FEATURE)
243+
#define MY_TRANSPORT_SANITY_CHECK
244+
#endif
245+
246+
242247
#if defined(MY_TRANSPORT_DONT_CARE_MODE)
243248
#error This directive is deprecated, set MY_TRANSPORT_WAIT_READY_MS instead!
244249
#endif

core/MySensorsCore.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ void _callbackTransportReady(void)
4040
{
4141
if (!_coreConfig.presentationSent) {
4242
presentNode();
43-
#if !defined(MY_GATEWAY_FEATURE)
4443
_registerNode();
45-
#endif
4644
_coreConfig.presentationSent = true;
4745
}
4846
}
@@ -153,6 +151,8 @@ void _begin(void)
153151
#if defined(MY_SENSOR_NETWORK)
154152
CORE_DEBUG(PSTR("MCO:BGN:INIT OK,TSP=%d\n"), isTransportReady());
155153
#else
154+
// no sensor network defined, call presentation & registration
155+
_callbackTransportReady();
156156
CORE_DEBUG(PSTR("MCO:BGN:INIT OK,TSP=NA\n"));
157157
#endif
158158
// reset wdt before handing over to loop

core/MyTransport.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,13 @@ void transportProcessMessage(void)
625625
// update routing table if msg not from parent
626626
#if defined(MY_REPEATER_FEATURE)
627627
#if !defined(MY_GATEWAY_FEATURE)
628-
if (last != getParentNodeId()) {
628+
if (last != _transportConfig.parentNodeId) {
629629
#else
630630
// GW doesn't have parent
631631
{
632632
#endif
633633
// Message is from one of the child nodes and not sent from this node. Add it to routing table.
634-
if (sender != getNodeId())
634+
if (sender != _transportConfig.nodeId)
635635
{
636636
transportSetRoute(sender, last);
637637
}
@@ -840,10 +840,10 @@ void transportProcessMessage(void)
840840
void transportInvokeSanityCheck(void)
841841
{
842842
if (!transportSanityCheck()) {
843-
TRANSPORT_DEBUG(PSTR("!TSF:SNK:FAIL\n")); // sanity check fail
843+
TRANSPORT_DEBUG(PSTR("!TSF:SAN:FAIL\n")); // sanity check fail
844844
transportSwitchSM(stFailure);
845845
} else {
846-
TRANSPORT_DEBUG(PSTR("TSF:SNK:OK\n")); // sanity check ok
846+
TRANSPORT_DEBUG(PSTR("TSF:SAN:OK\n")); // sanity check ok
847847
}
848848
}
849849

core/MyTransport.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@
3838
* - TSM:READY from <b>stReady</b> Transport is ready and fully operational
3939
* - TSM:FAIL from <b>stFailure</b> Failure in transport link or transport HW
4040
* - Transport support function (<b>TSF</b>)
41-
* - TSF:CHKUPL from @ref transportCheckUplink(), checks connection to GW
42-
* - TSF:ASID from @ref transportAssignNodeID(), assigns node ID
43-
* - TSF:PING from @ref transportPingNode(), pings a node
41+
* - TSF:CKU from @ref transportCheckUplink(), checks connection to GW
42+
* - TSF:SID from @ref transportAssignNodeID(), assigns node ID
43+
* - TSF:PNG from @ref transportPingNode(), pings a node
4444
* - TSF:WUR from @ref transportWaitUntilReady(), waits until transport is ready
4545
* - TSF:CRT from @ref transportClearRoutingTable(), clears routing table stored in EEPROM
4646
* - TSF:LRT from @ref transportLoadRoutingTable(), loads RAM routing table from EEPROM (only GW/repeaters)
4747
* - TSF:SRT from @ref transportSaveRoutingTable(), saves RAM routing table to EEPROM (only GW/repeaters)
4848
* - TSF:MSG from @ref transportProcessMessage(), processes incoming message
49-
* - TSF:SANCHK from @ref transportInvokeSanityCheck(), calls transport-specific sanity check
50-
* - TSF:ROUTE from @ref transportRouteMessage(), sends message
51-
* - TSF:SEND from @ref transportSendRoute(), sends message if transport is ready (exposed)
49+
* - TSF:SAN from @ref transportInvokeSanityCheck(), calls transport-specific sanity check
50+
* - TSF:RTE from @ref transportRouteMessage(), sends message
51+
* - TSF:SND from @ref transportSendRoute(), sends message if transport is ready (exposed)
5252
5353
*
5454
* Transport debug log messages:
@@ -80,13 +80,13 @@
8080
* | | TSM | FAIL | CNT=%%d | <b>Transition to stFailure state</b>, consecutive failure counter (CNT)
8181
* | | TSM | FAIL | PDT | Power-down transport
8282
* | | TSM | FAIL | RE-INIT | Attempt to re-initialize transport
83-
* | | TSF | CHKUPL | OK | Uplink OK
84-
* | | TSF | CHKUPL | OK,FCTRL | Uplink OK, flood control prevents pinging GW in too short intervals
85-
* | | TSF | CHKUPL | DGWC,O=%%d,N=%%d | Uplink check revealed changed network topology, old distance (O), new distance (N)
86-
* | | TSF | CHKUPL | FAIL | No reply received when checking uplink
87-
* | | TSF | ASID | OK,ID=%%d | Node ID assigned
88-
* |!| TSF | ASID | FAIL,ID=%%d | Assigned ID is invalid
89-
* | | TSF | PING | SEND,TO=%%d | Send ping to destination (TO)
83+
* | | TSF | CKU | OK | Uplink OK
84+
* | | TSF | CKU | OK,FCTRL | Uplink OK, flood control prevents pinging GW in too short intervals
85+
* | | TSF | CKU | DGWC,O=%%d,N=%%d | Uplink check revealed changed network topology, old distance (O), new distance (N)
86+
* | | TSF | CKU | FAIL | No reply received when checking uplink
87+
* | | TSF | SID | OK,ID=%%d | Node ID assigned
88+
* |!| TSF | SID | FAIL,ID=%%d | Assigned ID is invalid
89+
* | | TSF | PNG | SEND,TO=%%d | Send ping to destination (TO)
9090
* | | TSF | WUR | MS=%%lu | Wait until transport ready, timeout (MS)
9191
* | | TSF | MSG | ACK REQ | ACK message requested
9292
* | | TSF | MSG | ACK | ACK message, do not proceed but forward to callback
@@ -108,14 +108,14 @@
108108
* |!| TSF | MSG | REL MSG,NORP | Node received a message for relaying, but node is not a repeater, message skipped
109109
* |!| TSF | MSG | SIGN FAIL | Signing message failed
110110
* |!| TSF | MSG | GWL FAIL | GW uplink failed
111-
* | | TSF | SANCHK | OK | Sanity check passed
112-
* |!| TSF | SANCHK | FAIL | Sanity check failed, attempt to re-initialize radio
111+
* | | TSF | SAN | OK | Sanity check passed
112+
* |!| TSF | SAN | FAIL | Sanity check failed, attempt to re-initialize radio
113113
* | | TSF | CRT | OK | Clearing routing table successful
114114
* | | TSF | LRT | OK | Loading routing table successful
115115
* | | TSF | SRT | OK | Saving routing table successful
116-
* |!| TSF | ROUTE | FPAR ACTIVE | Finding parent active, message not sent
117-
* |!| TSF | ROUTE | DST %%d UNKNOWN | Routing for destination (DST) unknown, send message to parent
118-
* |!| TSF | SEND | TNR | Transport not ready, message cannot be sent
116+
* |!| TSF | RTE | FPAR ACTIVE | Finding parent active, message not sent
117+
* |!| TSF | RTE | DST %%d UNKNOWN | Routing for destination (DST) unknown, send message to parent
118+
* |!| TSF | SND | TNR | Transport not ready, message cannot be sent
119119
*
120120
* Incoming / outgoing messages:
121121
*

0 commit comments

Comments
 (0)