I figured out the problem as the packet size exceeding the default one of 28
bytes. My packet was 32 bytes long (incl. the header - 8 bytes). Just had to
add a compiler flag in the Makefile to sort out the problem.

-prem

On 5/4/07, Omprakash Gnawali <[EMAIL PROTECTED]> wrote:


Great - please send an email to the list once you have confirmed that
the problem you initially reported is unrelated to initialization.

- om_p

>
> You are right. It works with the modifications you suggested. I'm
looking
> into my code now to find the bug(s). Thanks a lot for sparing your
> invaluable time for looking into my problem. Will  let you know exactly
what
> was the bug in my code once I figure it out.
>
> thanks,
> Prem
>
> On 5/2/07, Omprakash Gnawali <[EMAIL PROTECTED]> wrote:
> >
> >
> > I changed your code so that it sends a debug message using the
> > collection sender after receiving sensor message. It turns out this
> > message successfully gets forwarded.
> >
> > This is what my topology looked like:
> >
> > 1 (root) - 2 (Treg) - 3 (SensorTreg)
> >
> > 3 sent a sensor message to 2 (AM_PARENT_ADDR = 2), 2 forwarded the
> > message to 1 which is what you wanted. Can you try the following code
> > and let us know if you observe forwarding?  If you observe that, the
> > bug might be unrelated to collection initialization and somewhere else
> > in your program.
> >
> >
> >   ...
> >
> >   message_t newbuf;
> >
> >   typedef struct newpkt {
> >     uint16_t val1;
> >     uint16_t val2;
> >   } newpkt_t;
> >
> >
> >   task void senddbgmsg() {
> >     newpkt_t* tpkt = (newpkt_t *)call TregSend.getPayload(&newbuf);
> >     tpkt->val1 = 0x1122;
> >     tpkt->val2 = 0xcafe;
> >     call TregSend.send(&newbuf, sizeof(newpkt_t));
> >   }
> >
> >
> >   event message_t* SensorReceive.receive(message_t* msg, void*
payload,
> > uint8_t len) {
> >         report_received();                      //Signal the
successful
> > receipt of a packet
> >
> >         post senddbgmsg();
> >
> >     ....
> >
> > }
> >
> >
> >
> > - om_p
> >
> >
> > HI,
> >
> > I want to use some nodes in my network to be members of the collection
> > tree
> > yet at the same time be able to receive packets from nodes that are
not
> > part
> > of the collection tree. I've tried instantiating the AMReceiverC
component
> > with a different AM_ID than the collection tree. However, I find that
> > though
> > the nodes are able to receive packets from the non-collection tree
nodes,
> > but are unable to send the packets upstream after performing some
> > computation based on the data received. I don't know if the routing
engine
> > is getting properly initialized or not. I'd really appreciate if
someone
> > cud
> > let me know as to whether my scheme is feasible or not and if so,
whether
> > I'm implementing the components/interfaces correctly. Following is a
part
> > of
> > my configuration file (TregAppC.nc)  and module definition:-
> >
> > configuration:-
> > components TregC, MainC, LedsC, ActiveMessageC;
> >   components CollectionC as Collector;
> >   components new CollectionSenderC(0xee);
> >   components SerialActiveMessageC;
> >   components new SerialAMSenderC(0x99);
> >   components new AMReceiverC(0x77) as SensorReceiver;
> >   components new TimerMilliC() as TregTimer;
> >
> >   TregC.Boot -> MainC;
> >   TregC.RadioControl -> ActiveMessageC;
> >   TregC.SerialControl -> SerialActiveMessageC;
> >   TregC.RoutingControl -> Collector;
> >   TregC.TregSend -> CollectionSenderC;
> >   TregC.RootUartSend -> SerialAMSenderC.AMSend;
> >   TregC.RootUartPacket -> SerialAMSenderC;
> >   TregC.TregIntercept -> Collector.Intercept[0xee];
> >   TregC.Leds -> LedsC;
> >   TregC.SensorRadioReceive -> SensorReceiver;
> >   TregC.TregTimer -> TregTimer;
> >   TregC.RootControl -> Collector;
> >   TregC.RootTregReceive -> Collector.Receive[0xee];
> >
> > -----END-----
> >
> > module TregC :
> >   uses interface Boot;
> >   uses interface SplitControl as RadioControl;
> >   uses interface SplitControl as SerialControl;
> >   uses interface StdControl as RoutingControl;
> >   uses interface Send as TregSend;
> >   uses interface Packet as RootUartPacket;
> >   uses interface AMSend as RootUartSend;
> >   uses interface Receive as SensorRadioReceive;
> >   uses interface Intercept as TregIntercept;
> >   uses interface Leds;
> >   uses interface Timer<TMilli> as TregTimer;
> >   uses interface RootControl;
> >   uses interface Receive as RootTregReceive;
> > -----End------
> >
> > thanks,
> > Prem
> >
>
> --Boundary_(ID_Rxiimgte0R0LysQ//Zl9Ug)
> Content-type: text/html; charset=ISO-8859-1
> Content-transfer-encoding: 7BIT
> Content-disposition: inline
>
> You are right. It works with the modifications you suggested. I&#39;m
looking
* into my code now to find the bug(s). Thanks a lot for sparing your
invaluabl
*e time for looking into my problem. Will&nbsp; let you know exactly what
was
*the bug in my code once I figure it out.
> <br><br>thanks,<br>Prem<br><br><div><span class="gmail_quote">On 5/2/07,
<b c
*lass="gmail_sendername">Omprakash Gnawali</b> &lt;<a href="mailto:
[EMAIL PROTECTED]
*.edu">[EMAIL PROTECTED]</a>&gt; wrote:</span><blockquote
class="gmail_quote" st
*yle="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex;
pa
*dding-left: 1ex;">
> <br>I changed your code so that it sends a debug message using
the<br>collect
*ion sender after receiving sensor message. It turns out this<br>message
succe
*ssfully gets forwarded.<br><br>This is what my topology looked like:
> <br><br>1 (root) - 2 (Treg) - 3 (SensorTreg)<br><br>3 sent a sensor
message t
*o 2 (AM_PARENT_ADDR = 2), 2 forwarded the<br>message to 1 which is what
you w
*anted. Can you try the following code<br>and let us know if you observe
forwa
*rding?&nbsp;&nbsp;If you observe that, the
> <br>bug might be unrelated to collection initialization and somewhere
else<br
*>in your program.<br><br><br>&nbsp;&nbsp;...<br><br>&nbsp;&nbsp;message_t
new
*buf;<br><br>&nbsp;&nbsp;typedef struct newpkt
{<br>&nbsp;&nbsp;&nbsp;&nbsp;ui
*nt16_t val1;<br>&nbsp;&nbsp;&nbsp;&nbsp;uint16_t val2;<br>&nbsp;&nbsp;}
newpk
*t_t;
> <br><br><br>&nbsp;&nbsp;task void senddbgmsg()
{<br>&nbsp;&nbsp;&nbsp;&nbsp;n
*ewpkt_t* tpkt = (newpkt_t *)call TregSend.getPayload
(&amp;newbuf);<br>&nbsp;&
*nbsp;&nbsp;&nbsp;tpkt-&gt;val1 =
0x1122;<br>&nbsp;&nbsp;&nbsp;&nbsp;tpkt-&gt;
*val2 = 0xcafe;<br>&nbsp;&nbsp;&nbsp;&nbsp;call TregSend.send(&amp;newbuf,
siz
*eof(newpkt_t));
> <br>&nbsp;&nbsp;}<br><br><br>&nbsp;&nbsp;event message_t*
SensorReceive.recei
*ve(message_t* msg, void* payload, uint8_t len)
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&

*nbsp;&nbsp;&nbsp;&nbsp;report_received();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
*;&nbsp;&nbsp;&nbsp;//Signal the successful receipt of a
packet<br><br>&nbsp;&
*nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;post senddbgmsg();
> <br><br>&nbsp;&nbsp;&nbsp;&nbsp;....<br><br> }<br><br><br><br>-
om_p<br><br><
*br>HI,<br><br>I want to use some nodes in my network to be members of the
col
*lection tree<br>yet at the same time be able to receive packets from
nodes th
*at are not part
> <br>of the collection tree. I&#39;ve tried instantiating the AMReceiverC
comp
*onent<br>with a different AM_ID than the collection tree. However, I find
tha
*t though<br>the nodes are able to receive packets from the non-collection
tre
*e nodes,
> <br>but are unable to send the packets upstream after performing
some<br>comp
*utation based on the data received. I don&#39;t know if the routing
engine<br
*>is getting properly initialized or not. I&#39;d really appreciate if
someone
* cud
> <br>let me know as to whether my scheme is feasible or not and if so,
whether
*<br>I&#39;m implementing the components/interfaces correctly. Following
is a
*part of<br>my configuration file (TregAppC.nc)&nbsp;&nbsp;and module
definiti
*on:-
> <br><br>configuration:-<br>components TregC, MainC, LedsC,
ActiveMessageC;<br
*>&nbsp;&nbsp;components CollectionC as
Collector;<br>&nbsp;&nbsp;components n
*ew CollectionSenderC(0xee);<br>&nbsp;&nbsp;components
SerialActiveMessageC;<b
*r>&nbsp;&nbsp;components new SerialAMSenderC(0x99);
> <br>&nbsp;&nbsp;components new AMReceiverC(0x77) as
SensorReceiver;<br>&nbsp;
*&nbsp;components new TimerMilliC() as
TregTimer;<br><br>&nbsp;&nbsp;TregC.Boo
*t -&gt; MainC;<br>&nbsp;&nbsp;TregC.RadioControl -&gt;
ActiveMessageC;<br>&nb
*sp;&nbsp;TregC.SerialControl -&gt; SerialActiveMessageC;
> <br>&nbsp;&nbsp;TregC.RoutingControl -&gt;
Collector;<br>&nbsp;&nbsp;TregC.Tr
*egSend -&gt; CollectionSenderC;<br>&nbsp;&nbsp;TregC.RootUartSend -&gt;
Seria
*lAMSenderC.AMSend;<br>&nbsp;&nbsp;TregC.RootUartPacket -&gt;
SerialAMSenderC;
*<br>&nbsp;&nbsp;TregC.TregIntercept -&gt;
> Collector.Intercept[0xee];<br>&nbsp;&nbsp;TregC.Leds -&gt;
LedsC;<br>&nbsp;&n
*bsp;TregC.SensorRadioReceive -&gt;
SensorReceiver;<br>&nbsp;&nbsp;TregC.TregT
*imer -&gt; TregTimer;<br>&nbsp;&nbsp;TregC.RootControl -&gt;
Collector;<br>&n
*bsp;&nbsp;TregC.RootTregReceive -&gt; Collector.Receive
> [0xee];<br><br>-----END-----<br><br>module TregC :<br>&nbsp;&nbsp;uses
interf
*ace Boot;<br>&nbsp;&nbsp;uses interface SplitControl as
RadioControl;<br>&nbs
*p;&nbsp;uses interface SplitControl as SerialControl;<br>&nbsp;&nbsp;uses
int
*erface StdControl as RoutingControl;
> <br>&nbsp;&nbsp;uses interface Send as TregSend;<br>&nbsp;&nbsp;uses
interfac
*e Packet as RootUartPacket;<br>&nbsp;&nbsp;uses interface AMSend as
RootUartS
*end;<br>&nbsp;&nbsp;uses interface Receive as
SensorRadioReceive;<br>&nbsp;&n
*bsp;uses interface Intercept as TregIntercept;
> <br>&nbsp;&nbsp;uses interface Leds;<br>&nbsp;&nbsp;uses interface
Timer&lt;T
*Milli&gt; as TregTimer;<br>&nbsp;&nbsp;uses interface
RootControl;<br>&nbsp;&
*nbsp;uses interface Receive as
RootTregReceive;<br>-----End------<br><br>than
*ks,<br>Prem<br></blockquote></div>
> <br>
>
> --Boundary_(ID_Rxiimgte0R0LysQ//Zl9Ug)--

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

Reply via email to