Hi Andre,
It's difficult to tell what's going on here as this kind of problem really needs a small, concise piece of code to help explain what you are doing (see https://stackoverflow.com/help/mcve for some pointers). I'm not sure but I think you may be misunderstanding the sequence of events happening, here's some thoughts and hopefully something will help: - Your startDone function fires every time the radio is turned on, and it sends *a brand new packet* with it's nodeid value set to the that node's TOS_NODE_ID. When you say "When node 13 is to retransmit, the starDone function loads nodeid = 13 (is the Node that is transmitting), this is what is wrong, since I wanted nodei = 24 to remain unchanged" I'm really confused by this, perhaps this is what you are misunderstanding? What is happening in your startDone function is not retransmitting a received packet, it is sending a new packet. Are you trying to create a mesh network? Look at TinyOS Collection Tree Protocol (CTP) which handles packet sniffing and retransmissions for you. Trying to implement an efficient mesh network from scratch is rather complicated. - I think that the receive event is only signalled when a packet arrives which is addressed to that node. If you want to 'sniff' messages in the air destined for another node, you need to use the AM Snoop component, not Receive - The CC2420 by default does not signal any packets received which are not addressed directly to this node. So to use Snoop with CC2420 I think you need to use the CFLAGS += -DCC2420_NO_ADDRESS_RECOGNITION in your Makefile. - In your startDone event you are setting your message value to the static TOS_NODE_ID value (rcm->nodeid = TOS_NODE_ID ) but then a couple of lines later in your debug statement you are printing the nodeid variable, which is different (that seems to be set in your Receive event with nodeid= rcm->nodeid;) This seems wrong...? - When you say "But in the output of the debug, the [origin =% hu] is always equal value [trans =% hu]" isn't this what should be happening? James ________________________________ From: [email protected] <[email protected]> on behalf of arsaraiva <[email protected]> Sent: 09 May 2017 14:08:09 To: [email protected] Subject: Re: [Tinyos-help] Variable with static TOS_NODE_ID Actually nodeid is declared in the booted function, as nodeid = TOS_NODE_ID. What I have to do is that when the startDone function is run, it loads the varialvel nodeid with the value of the node and does not change. What is happening now is that starDone executes on node 24 (for example) and there nodeid = 24, sends the packet that was received by node 13. When node 13 is to retransmit, the starDone function loads nodeid = 13 (is the Node that is transmitting), this is what is wrong, since I wanted nodei = 24 to remain unchanged, so when node 13 retransmitted the packet and it arrived at the sink (node 0) the sink would know that the packet originated at the node 24 (I do not care if he went through 13). Could I explain my question better? -- View this message in context: http://tinyos-help.10906.n7.nabble.com/Variable-with-static-TOS-NODE-ID-tp25094p25100.html Sent from the TinyOS - Help mailing list archive at Nabble.com. _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
