Node Behavior - Kvel2D/ecs193-wireless-sensor-network GitHub Wiki

Nodes with the has_sensor flag enabled create new data packets every PACKET_PERIOD (ms). Relay nodes (nodes with no sensors that pass along data packets) will generate a health packet every HEALTH_PACKET_PERIOD (ms).

Currently, the gateway node will generate a health packet on reset, but never again. If something is wrong with the network, start by resetting the gateway node, then work your way down. No packets would be lost from resetting the gateway node since it always immediately sends the data to serial.

The node's sleep durations are implemented such that it will sleep just long enough until its next action: Reading, HealthPacket, Transmit, or Receive.

Each relay also has rudimentary duplicate packet checking resulting from failed ACK's using each packet's packet.number and packet.origin_id.

⚠️ **GitHub.com Fallback** ⚠️