On Mon, Jan 19, 2009 at 4:42 AM, Martin van de Goor <[email protected]> wrote: > Dear all, > > I am having a problem with CTP and packet bridging. I am using IRIS motes, > the latest TinyOS 2.x cvs version, and Windows/Cygwin. > First, the application is described. Second, the problem description is > given. Last, critical code parts are given. > > The goal of the application is to obtain distance estimates (based on RSSI) > between the Sender component and other nodes. This information should be > forwarded to the Base node using the Collection Tree Protocol. > > There are four components: > - Sender (ID=7): sends a packet burst every second using AMSend > - Intercepter (ID=3): receives Sender packets, adds RSSI information, sends > new message using Collection interface > - Base (ID=0): Based on BaseStationC, which acts as a TinyOS 2.x base > station that forwards packets between the UART and radio. The base is the > root of the Collection tree. It also adds RSSI information to packets if it > receives them from the Sender directly. > - Listener (pc): Based on RssiDemo. Listens for and displays packets. > > Packet received directly by Base: > Sender 7 RSSI 42 LQI 255 Seq 6 Packet 20 > > Packet received by the Intercepter and forwarded to Base: > Sender 7 RSSI 35 LQI 255 Seq 6 Packet 20 Intercepter 3 THL 1 ETX 10 > originSeqNo 149 AM type 11 data 7 > > But, usually within a few minutes (not deterministically), serial > communication stops and usually the error "bad packet" is given by Listener, > but not always. Using tos-serial-debug shows that there is no communication > at all, but the application is still running as lights keep flashing. The > base station flashes yellow, indicating it is dropping packets. > Only restarting 'Base' fixes the problem. The problem does not occur if the > Intercepter node is not started. > > Does anyone have a suggestion on the type of problem or how to find it? > Help would be much appreciated! > > Best regards, > > Martin van de Goor > > ***************** > ** Intercepter > ***************** > // sending of collection message > message_t colMsg; > event message_t* RssiMsgIntercept.receive(message_t *msg, void *payload, > uint8_t len) { > RssiMsg *rssiMsg = payload; > if (len == sizeof(*rssiMsg)) > { > RssiMsg *colRssiMsg = call RssiToRoot.getPayload(&colMsg, > sizeof(RssiMsg)); > if (colRssiMsg != NULL) > { > *colRssiMsg = *rssiMsg; > colRssiMsg->rssi = getRssi(msg); > colRssiMsg->lqi = getLqi(msg); > > resultSend = call RssiToRoot.send(&colMsg, sizeof(*colRssiMsg)); > } > } > return msg; > } > ***************** > ** Basestation > ***************** > // changes to BaseStationC.nc > components CollectionC; > BaseStationP.CollectionControl -> CollectionC; > BaseStationP.RootControl -> CollectionC; > BaseStationP.RadioReceive[COL_RSSIMSG] -> > CollectionC.Receive[COL_RSSIMSG]; > BaseStationP.RadioSnoop[COL_RSSIMSG] -> CollectionC.Snoop[COL_RSSIMSG];
CTP requires hop-by-hop ACKs to work. Are you sure your base station sends ACKs? It will be great if at least a basic CTP application by itself works. To test this, you can program your nodes with TestNetwork and see if that works for at least half an hour. Node programmed with id 0 will function as the root and you should see it packets from each node approximately 8 seconds. - om_p _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
