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'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 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> <<a href="mailto:
[EMAIL PROTECTED]
*.edu">[EMAIL PROTECTED]</a>> 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? If you observe that, the
> <br>bug might be unrelated to collection initialization and somewhere
else<br
*>in your program.<br><br><br> ...<br><br> message_t
new
*buf;<br><br> typedef struct newpkt
{<br> ui
*nt16_t val1;<br> uint16_t val2;<br> }
newpk
*t_t;
> <br><br><br> task void senddbgmsg()
{<br> n
*ewpkt_t* tpkt = (newpkt_t *)call TregSend.getPayload
(&newbuf);<br> &
*nbsp; tpkt->val1 =
0x1122;<br> tpkt->
*val2 = 0xcafe;<br> call TregSend.send(&newbuf,
siz
*eof(newpkt_t));
> <br> }<br><br><br> event message_t*
SensorReceive.recei
*ve(message_t* msg, void* payload, uint8_t len)
{<br> &
*nbsp; report_received();
*  
*; //Signal the successful receipt of a
packet<br><br> &
*nbsp; post senddbgmsg();
> <br><br> ....<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'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't know if the routing
engine<br
*>is getting properly initialized or not. I'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'm implementing the components/interfaces correctly. Following
is a
*part of<br>my configuration file (TregAppC.nc) and module
definiti
*on:-
> <br><br>configuration:-<br>components TregC, MainC, LedsC,
ActiveMessageC;<br
*> components CollectionC as
Collector;<br> components n
*ew CollectionSenderC(0xee);<br> components
SerialActiveMessageC;<b
*r> components new SerialAMSenderC(0x99);
> <br> components new AMReceiverC(0x77) as
SensorReceiver;<br>
* components new TimerMilliC() as
TregTimer;<br><br> TregC.Boo
*t -> MainC;<br> TregC.RadioControl ->
ActiveMessageC;<br>&nb
*sp; TregC.SerialControl -> SerialActiveMessageC;
> <br> TregC.RoutingControl ->
Collector;<br> TregC.Tr
*egSend -> CollectionSenderC;<br> TregC.RootUartSend ->
Seria
*lAMSenderC.AMSend;<br> TregC.RootUartPacket ->
SerialAMSenderC;
*<br> TregC.TregIntercept ->
> Collector.Intercept[0xee];<br> TregC.Leds ->
LedsC;<br> &n
*bsp;TregC.SensorRadioReceive ->
SensorReceiver;<br> TregC.TregT
*imer -> TregTimer;<br> TregC.RootControl ->
Collector;<br>&n
*bsp; TregC.RootTregReceive -> Collector.Receive
> [0xee];<br><br>-----END-----<br><br>module TregC :<br> uses
interf
*ace Boot;<br> uses interface SplitControl as
RadioControl;<br>&nbs
*p; uses interface SplitControl as SerialControl;<br> uses
int
*erface StdControl as RoutingControl;
> <br> uses interface Send as TregSend;<br> uses
interfac
*e Packet as RootUartPacket;<br> uses interface AMSend as
RootUartS
*end;<br> uses interface Receive as
SensorRadioReceive;<br> &n
*bsp;uses interface Intercept as TregIntercept;
> <br> uses interface Leds;<br> uses interface
Timer<T
*Milli> as TregTimer;<br> uses interface
RootControl;<br> &
*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