Hi,

It's always a good idea to send a copy to the forum so that others can 
contribute. Also, somebody else might have a similar problem and would 
be glad to see what we have been discussing.

For multihop communication, I strongly recommend to start with the 
Collection protocol, as everything you need there is already implemented:
http://docs.tinyos.net/index.php/Network_Protocols#Collection

Basically, instead of the regular send/receive interfaces you send your 
packets over the collection interface, and it does all the 
routing/multi-hop transport for you.

The anchor node calls RootControl.setRoot(true), and forwards any 
received messages over the serial port. The relay does not need to do 
anything specific (just start the radio), in fact the targets will also 
act as relays. I recommend to use the same code for all three types of 
nodes (easier to maintain) and to just configure a node as the anchor 
when the node ID has a specific value (as demonstrated in the tutorial).

On the relay nodes you just need to increment the hop count for each 
message. You can intercept messages before they are forwarded. To do 
this you'll have to implement the Intercept interface. The code could 
look something likes this:

event bool forward(message_t* msg, void* payload, uint8_t len) {
   MyMsg* data = (MyMsg*)payload; // cast to your own data structure
   data->hopCount++; // increase the hop count of the message
   return true; // tell the underlying system to forward the message
}

Cheers,
Urs



On 10/18/10 5:11 AM, (¯`•._.•Lance•._.•´¯) wrote:
> Hi Hunkeler,
>                    Thanks for u reply.
>
> Well my project is about tracking the target inside the mesh network.I will
> have three types  of node ..
> 1) *Target *: Only board casting the message which contain  Hop count , node
> i d, and temperature
>
> 2,)*Relay * : Received the bcast  and check the Node it ..if the Id is from
> the target  increase the hop count  if the ID is from  other relay  increase
> the hop count inside the msg by 1  and re boardcast the msg.
>
> 3)*Ancho*r : Received the bcast and check the node  ID just like the realy
> .. but this time the anchor will send the msg directly to the base satation
> which is within the transmisssion range by fixing the address in the msg.
> *
> Implementation... *
> Assume we have four anchors( position is alrady known) arrange into square
> form.the distance between the any two anchor is two transmisssion range
> distance , Some realy node in between . Forming a mesh network and  track
> the target by looking at the hop count from each Anchor.
>
> Now my problem is that if i put the base station close to one of the Anchor
> (A1) .then i am not able to receive the infromation from the rest of the
> anchor A2,A3,A4.  SO now i wan to  forward the information from Each anchor
> back to the base without changing any information. IS that possibile?
>
> Currently my program code is working fine for every anchor just that i don't
> know how to forward the message back to station .
>
> HOpe you can understand what i mean......I really need ur value advices.
>
> Pls help  me and looking forward to ur reply.
>
> Thanks for ur time.
> Regards,
> lance

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to