Most likely what is happening is that you are trashing your
message data in the "hop" mote because you return the buffer
in receive() while send() is still trying to use it.
You should copy the message and post send() as a task --
both good pieces of general advice.

You'll eventually want to make some kind of hop queue instead
of just passing things along directly as well...

Also I don't think you need to modify TOSBase at all, although
you may need to put some discrimination of messages into the
host program if the base station can receive both the original
and hopped messages.

MS

mehmet kaplan wrote:
Hi everyone,
This is my first e-mail:)
I'm starter in developing TinyOS applications. I've tried a sense application in TinyOS 1.15. I'm getting sensor values with OscilloscopeRf application and send via radio connection. I loaded TOSBase application to another mote which is connected to PC. With SerialForwarder and Oscilloscope applications, I saw sensor values in Oscilloscope. After that I've decided to add a hop to this application. I've written an application that basicly get radio values from mote that runs OscilloscopeRf application and send this values via radio to the mote that runs TOSBase application. Network is like this: mote2(OscilloscopeRf) -> mote4(rfm to rfm) -> mote1(TOSBase)
I changed OscilloscopeRf dataTask() like this:
/call DataMsg.send(/*TOS_BCAST_ADDR*/4, sizeof(struct OscopeMsg), &msg[currentMsg])/ I changed control in TOSBase RadioReceive.receive event
/if ((!Msg->crc) || (Msg->group != TOS_AM_GROUP))
      return Msg;/
to
/if ((!Msg->crc) || (Msg->group != TOS_AM_GROUP) ||
     ((Msg->addr != TOS_BCAST_ADDR) && (Msg->addr != addr)))
      return Msg;/
for controlling destination id.
In my hop application I used GenericComm component. and basicly did this:
/event TOS_MsgPtr Receive.receive(TOS_MsgPtr m) {
  TOS_Msg msg;
  memcpy(&msg, m, sizeof(TOS_Msg));
  call Send.send(1, sizeof(struct OscopeMsg),&msg);
  call Leds.greenToggle();
  return m;/
/ }/
After running all motes, Serial Forwarder is getting all packets, green led of the mote1 and mote4 toggles, in Oscilloscope I saw Mote2 Channel1 but values are wrong and like this:
http://img72.imageshack.us/img72/9382/oscilloscopegi9.jpg
I couldn't solve the problem, it can be a simple mistake, but like I said I'm new in TinyOS.
Thanks for your interest...
------------------------------------------------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos. <http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM->


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to