RandomC (in lib) and UniqueSendC (in chips/cc2420/unique) are both wired the MainC.SoftwareInit. On my system it seems that that UniqueSendC is initialized first and hence without a seeded random number generator. As a result, all nodes have the same initial DSN. This leads to funny effects when nodes start to transmit simultaneously, as 802.15.4 ACKs are bound to the DSN only.

Contacting tinyos-devel on this, Phil proposed the following fix: “The trivial change is to have init() post a task that initializes the sequence number”. Now, this is really a nice and simple fix (and I tried it: it works).

Advertisements