Probably it will help someone. I found how to do what I want without big changes. So you have to:
-
commented out in MyConfig.h this line:
#define MY_REGISTRATION_FEATURE -
add changes to MyTransport.cpp (add marked lines of code)
bool transportCheckUplink(bool force) {
#if !defined(MY_PARENT_NODE_IS_STATIC) and !defined(MY_REGISTRATION_FEATURE)
if (!force && (hwMillis() - _transportSM.lastUplinkCheck) < CHKUPL_INTERVAL) {
TRANSPORT_DEBUG(PSTR("TSF:CHKUPL:OK,FCTRL\n")); // flood control
return true;
}
// ping GW
uint8_t hopsCount = transportPingNode(GATEWAY_ADDRESS);
// verify hops
if (hopsCount != INVALID_HOPS) {
// update
_transportSM.lastUplinkCheck = hwMillis();
TRANSPORT_DEBUG(PSTR("TSF:CHKUPL:OK\n"));
// did distance to GW change upstream, eg. re-routing of uplink nodes
if (hopsCount != _nc.distance) {
TRANSPORT_DEBUG(PSTR("TSF:CHKUPL:DGWC,O=%d,N=%d\n"), _nc.distance, hopsCount); // distance to GW changed
_nc.distance = hopsCount;
}
return true;
}
else {
TRANSPORT_DEBUG(PSTR("TSF:CHKUPL:FAIL\n"));
return false;
}
#else
return true;
#endif
} -
add to your node's sketch:
#define MY_NODE_ID 7
#define MY_PARENT_NODE_ID 0
#define MY_PARENT_NODE_IS_STATIC
After that you will be able to start your device, send data even if the parent node is disabled (the request just fail). Once you enable GW you will be able to get presentation, heartbeat status, do standard requests to the node.