arjo129 / darpasubt

Subterenean challenge n00bs
4 stars 3 forks source link

TX2 timer expiration clash #25

Closed lekoook closed 5 years ago

lekoook commented 5 years ago

Issue:

Master node's TX2 timer sometimes clashes with last node's (N-1) TX1.

Due to a slight delay for initial cycle sync and tight interval, the moment of last node's TX1 is very close to that of master node's TX2 timer expiration.

As a result, both of these events happens at the same time, causing master node to freeze.

Update: The point of clash is mistaken to be what was stated earlier above. The real point of clash is between master node going to sleep and last slave node's TX. Both are happening at the same time, leading to clash and freeze.

Potential fix:

  1. Increase TX2 timer duration
  1. Improve initial sync accuracy
lekoook commented 5 years ago

Update: The commit 5e577659558f5503e56b6cffecfd36d8425fd68c attempts to fix this issue. The fix works by adding one additional interval to the end of the active period. This extra interval gives ample time for each node to transmit their second TX as well as receive every other node's second TX before putting themselves to sleep. Important to note though is, this will increase transceiver on-to-off time ratio, thereby increasing power consumption as well as heat generation.

However, the commit also caused an issue to arise. Both TXs of first slave node will be received by master node before master's second TX. However, this problem does not arise with the remaining slaves, only the first slace. It also only occurs for the second cycle and after, first cycle of first slave works as intended right after joining network but not second cycle and onwards.

This issue will not occur for a ranging frequency of 5Hz and below, with a 12ms TX interval. At 10Hz, this issue occurs.