Re: [Tinyos-help] Implementation of CTP - SentCache
Omprakash, there are really two lookup implementations in LruCtpMsgCacheP. When I found the internal one (it comes first), I missed the missing "Cache." in front and thought it was the published one... Uh. Anyway, it's good to see that I understood the intention of the code correctly. The CTP is a really nice thing. Thanks, Oliver Omprakash Gnawali schrieb: > On Thu, Jul 31, 2008 at 7:01 AM, Oliver Frietsch > <[EMAIL PROTECTED]> wrote: >> Hello list, >> >> I'm currently working on a special-purpose derivate of CTP and therefore >> read all the source code to get an overview. One point that is totally >> unclear to me is in CtpForwardingEngineP (most recent CVS release). >> It says (line 439): >> >> // Once we are here, we have decided to send the packet. >> if (call SentCache.lookup(qe->msg)) { >> call CollectionDebug.logEvent(NET_C_FE_DUPLICATE_CACHE_AT_SEND); >> call SendQueue.dequeue(); >>if (call MessagePool.put(qe->msg) != SUCCESS) >> call CollectionDebug.logEvent(NET_C_FE_PUT_MSGPOOL_ERR); >>if (call QEntryPool.put(qe) != SUCCESS) >> call CollectionDebug.logEvent(NET_C_FE_PUT_QEPOOL_ERR); >> post sendTask(); >> return; >> } >> >> OK, so it should *stop sending* and drop the next packet, in the case >> that this packet (i.e. something very similar...) has already been sent >> before. That's what I think... >> >> Unfortunately, my opinion collides with the comment "Once we are here, >> we have decided to send the packet." > > The comment is misleading. As you note, there are more tests done > after the comment before deciding to send the packet. > > >> and the implementation of the cache >> itself. >> >> As stated in LruCtpMsgCacheP, the result of lookup is: "if key [packet] >> is in cache returns the index (offset by first), otherwise returns count >> [of enqueued packets]". >> So... The packet is dropped *everytime*, except that is is the first one >> in the sent cache or the cache is empty? What does this position imply >> for the packet, except that it is the oldest one that I can remember? >> >> I'm very sure that I missed something important, as this implementation >> looks senseless to me ATM. Please help me! > > Cache.lookup returns TRUE if a packet with the same signature is in > the cache. This TRUE/FALSE return by Cache.lookup is different from > what the internal lookup function in LruCtpMsgCacheP.nc returns. The > internal lookup function in LruCtpMsgCacheP.nc returns the position of > a packet in the cache if a similar packet is found, otherwise the size > of the cache. CTP does not use the internal lookup function > LruCtpMsgCacheP.nc. > > - om_p ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] collection, multiple roots, multiple id's - help
yeah, i made a typo in my question (more than one, i see), but you've right understood however. now i have another question: doing as you suggest to me, it's better to work on a modified version of the already existing CollectionC module or it's better to take the basic components and write/wire a new component from scratch. anyway, that's a bad news for me, because i've based a more than a month work for my thesis on this idea (different-id ==> different roots). I don't blame the wiki for this, because maybe it's only my bad english or my poor experience with tinyos (this is my real first work with it), but i think some more examples, maybe with some schemas showing the tree build up in a scenario like mine, will be useful for future newbie. thanks. ps: aside this, having someone that can understand my really ugly english, it's a success. On Friday 01 August 2008 05:52:51 Omprakash Gnawali wrote: > On Thu, Jul 31, 2008 at 4:05 AM, De-MonHell <[EMAIL PROTECTED]> wrote: > > hi all. > > > > THE EXAMPLE: > > i have 4 motes: 0,1,3,4 (these are their TOS_NODE_ID) > > Inside them i have basically the same application that use a single > > collection with AREA_ID as colllection id BUT: > > node 0 and 1 have a enum inside them like this: > >AREA_ID=0 > > node 3 and 4 have > >AREA_ID=1 > > > > (for every node: i change the AREA_ID, i recompile and finally i deploy) > > > > Node 0 and 2 will act as root of the collection service. > > node 2? You have five motes? > > > Node 1 and 3 will measure the ambient temperature and send it the the > > leader of their respective area (using the collection sender) > > so node 1 will send its data to node 0 and > > node 4 to node 3 > > I think there is a typo here - is node 3 your root? > > > This is (my) exptected behavior. > > > > THE PROBLEM: > > but this case sometimes work and sometimes not. both "temperature" nodes > > sent their data (connecting them to the pc i can see their printf ) > > node 0 and 2 indeed, sometimes both thei receive the data, sometimes only > > one of the two. > > > > INFO > > i'm using the tinyos 2 from CVS > > 4 tmotesky motes > > i attach the files of the application > > > > ANSWER?! > > am i missing something about the collection protocol? > > what can i check to understand what is failing? > > why sometimes work and sometimes not? > > The argument you pass to CollectionSenderC during its instantiation is > protocol id, the dispatch id of the protocol or application running on > top of CTP. So, you are not forming two separate/disjoint trees. If > you want two disjoint trees, you should run one instance of CTP in one > part of the network and another instance of CTP in another part of the > network. To do this, you can run CTP on two different AM types. > Otherwise, you will have multiple roots in the same network and the > packets will go to any or all of the roots depending on the dynamics > or topology. > > - om_p ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] tmote jtag adapter and olimex's msp-jtag-tiny in OS X
Hi, I'm trying to debug a tmote (telosb) with olimex's msp-jtag-tiny (which is the USB jtag pod from olimex). I built myself the adapter to match the 8-pin header of the tmote with the 14-pin connector of the jtag device, but I'm not sure if i did it well beacause the tmote's schematic is not clear. According to it, the 6th pin of the jtag connector is undefined, and thus I didn't connect it to the olimex device... has anyone built the adapter? it is ok to leave unconnected the 6th pin of the tmote's jtag 8-pin header? Besides, I've been having some trouble making the jtag device work on Mac OS X. I've seen that Olimex has plenty of documentation and drivers for windows (but not linux or OS X). I've seen some guides for configuring GDB to work with TI USB FET jtag device; does anyone know if the same procedure may work with olimex's device? any advice? thanks, Erwing ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] ActiveMessage: Receiving duplicates
Hi everybody, is there any possibility to receive duplicate AM-packets which are normally suppressed? I have a little snooper application that monitors the network packets. If I let a mote send one packet, turn it off and on again then the resend package is not being received by the snooper. If possible I do not want to mess around with the TinyOS code. Perhaps there is something I can add to the Makefile? Thanks Nicola ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Detecting one event in another event
Hi, The problem is exactly like this: ""When the message is send,send.done() event is generated.I start waiting for a packet to be received.If it doesn't come in 1ms,I will re-transmit else I will transmit the next packet."" *Coding part:* In send.done () { while ( timer <= 1000) { TOSH_uwait(1); //wait for 1microsecond timer++; if ( flag == 1) //flag is a conditional variable;If packet is received,Receive.receive() event will set the flag to 1. { call Leds.yellowToggle(); break; } } if ( timer == 1001) post ResendTask(); return SUCCESS; } I will transmit the next packet in receive.receive event. Conditional variable is not working in this regard.Any suggestion on different paradigm ? Regards, Kishore On Wed, Jul 30, 2008 at 11:54 PM, Eric Decker <[EMAIL PROTECTED]> wrote: > > > On Wed, Jul 30, 2008 at 10:55 AM, ram kishore <[EMAIL PROTECTED]> wrote: >> >> Hi all, >> >> When ever a packet is received, an event ReceiveMsg.receive(TOS_MsgPtr >> Msg) is generated.Can I detect this in some other event for example in >> send.senddone() event,so that I can perform alternative task.How to >> detect it? > > First I'm not sure what problem you are trying to solve. The description > you > give above sounds complicated. If I understand correctly from the event > handler for send.senddone you want to check to see if a message was > received and do something else. Is that correct? If so it seems simpler > to let the different handlers handler their one thing. Just an aside. > events are signaled from another module and as such are pieces of static > code. As such there isn't a way to detect an event in another event. > That said your alternative sounds like it might work but it depends on what > kind of events, async or not, are being used. And as soon as you start > mixing > async stuff and wanting it to interact with a task level event things get > complicated > quickly. > eric >> >> An alternative to this may be using conditional variables.I declare a >> global variable "flag" as "false".Keep performing some task in >> senddone() event.when a packet is received,receive event generated >> will set the flag as "true", then I will stop doing task in senddone() >> event.Will this work? >> >> >> Best Regards, >> Kishore >> ___ >> Tinyos-help mailing list >> Tinyos-help@millennium.berkeley.edu >> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > > > -- > Eric B. Decker > Senior (over 50 :-) Researcher > Autonomous Systems Lab > Jack Baskin School of Engineering > UCSC > > ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Has anybody used a Microchip 24LC64 for tinyos 2
Hi all I have the above I2C EEPROM within a board that otherwise more or less conforms with Telosb (but just has msp430 && CC2420). The EEPROM connects to ports P3.1 (SCL) and P3.3 (SDA). Has somebody some idea or sample code how to connect such a device (i need it for logging). Any kind of help would be welcome since I am not really deep in the intestines of chips. Thanks, Axel ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] eetx value doesn't increase for neighbors
On Fri, Aug 1, 2008 at 3:05 AM, Philippe BAYLE <[EMAIL PROTECTED]> wrote: > Thanks for your answer, > I thought that etx value should increase once the link becomes bad...? > What I understand now is that the link eetx is only increased for the > parent motes, not for the neighborsunless you send data packets that you > see there not acknowledgedbut beacons don't use acknowledgment so I > can't know if neighbors in the table are alive or not... The EETX value will decrease but much slower than you expect because the beacon frequency is controlled by a Trickle timer which might be firing at large intervals. - om_p ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Printf fails with TOSH_DATA_LENGTH=64 ?
I have been working with the default TOSH_DATA_LENGTH=28; I am outputting debugging information over the serial port (telosb). I needed to send larger packets so added DTOSH_DATA_LENGTH=64 in my makefile, that does allow me to send larger packets, but it seems to break printf, sample output below. I have started looking through printf.h/nc/etc but see nothing obviously wrong here. If anything larger packets would allow printf to send fewer packets over the serial port. Possibly the problem lies in PrintfClient? Before I spend a lot of time looking into this, I thought I would see if anyone has seen this problem before? I am using Tinyos 2.0.2 with the PrintfClient from CVS (for some reason the 2.0.2 PrintfClient didn't compile for me). sample output with default TOSH_DATA_LENGTH (28): SAS, Tx REQUEST SAS, RX Offer addr = 000f, rev rssi = -88, rssi = -43 Checking offers, got 1 offers best val = 0.810 address 000f parent 00 00 00 00 00 00 ba 5e SAS, Tx ACCEPT SAS, Tx ACCEPT SAS, RX Grant addr = f computed hop count as 1 computed parent address as 0x base address is 0x1f child addr 0x001f - 0x00ff APP, Associated APP, sending assoc evt NCEP, RX for me trans ack seq: 0, cancel resend, signal success. APP, NCEP send SUCCESS sample output after chanig TOSH_DATA_LENGTH=64: SAS, Tx REQUEST SAS, RX Offer addr = 000f, r= -43 Checking offers, got 1 offeraddress 000f parent 00 00 00, Tx ACCEPT SAS, Tx ACCEPT SAS, RX Grantop count as 1 computed parenbase address is 0x1f child aAPP, Associated APP, sendingNCEP, transport retry 1 NCEP, RX for me trans ack se signal success. APP, NCEP s ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] collection, multiple roots, multiple id's - help
On Fri, Aug 1, 2008 at 1:06 AM, De-MonHell <[EMAIL PROTECTED]> wrote: > > yeah, i made a typo in my question (more than one, i see), but you've right > understood however. > > now i have another question: doing as you suggest to me, it's better to work > on a modified version of the already existing CollectionC module or it's > better to take the basic components and write/wire a new component from > scratch. > > anyway, that's a bad news for me, because i've based a more than a month work > for my thesis on this idea (different-id ==> different roots). > I don't blame the wiki for this, because maybe it's only my bad english or my > poor experience with tinyos (this is my real first work with it), but i think > some more examples, maybe with some schemas showing the tree build up in a > scenario like mine, will be useful for future newbie. If the two clusters don't need to communicate with each other, you can compile one cluster with one AM ID and another cluster with a different AM ID. The AM ID is specified in CtpP.nc. We will improve the documentation based on user feedback. - om_p ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] tmote jtag adapter and olimex's msp-jtag-tiny in OS X
I tried to get the Olimex working on a linux box without luck. I finally revertedto using the TI USB JTAG. I did examine a bit the drivers Olimex provides for windows and they are different from the TI ones so I suspect there is enough different that the Linux driver for the TI doesn't work. You will also run into problems on Mac OS X because the tools that talk to the JTAG haven't been ported over. Namely the libraries and msp430-gdbproxy. We've gotten everything working by dual booting into Xubuntu 8.04 on the mac. We've also heard that running Xubuntu 8.04 under VirtualBox or VM Server also works. We tried running Xubuntu 8.04 on Parallels but the parallels usb driver has a problem which causes the Mac OS X kernel to panic when accessing the JTAG pod. It registers okay but when actually accessing it is when the panic occurs. eric On Fri, Aug 1, 2008 at 2:00 AM, Erwing R. Sanchez <[EMAIL PROTECTED]>wrote: > Hi, > I'm trying to debug a tmote (telosb) with olimex's msp-jtag-tiny > (which is the USB jtag pod from olimex). I built myself the adapter > to match the 8-pin header of the tmote with the 14-pin connector of > the jtag device, but I'm not sure if i did it well beacause the > tmote's schematic is not clear. According to it, the 6th pin of the > jtag connector is undefined, and thus I didn't connect it to the > olimex device... has anyone built the adapter? it is ok to leave > unconnected the 6th pin of the tmote's jtag 8-pin header? > Besides, I've been having some trouble making the jtag device work on > Mac OS X. I've seen that Olimex has plenty of documentation and > drivers for windows (but not linux or OS X). I've seen some guides > for configuring GDB to work with TI USB FET jtag device; does anyone > know if the same procedure may work with olimex's device? any advice? > thanks, > Erwing > ___ > Tinyos-help mailing list > Tinyos-help@millennium.berkeley.edu > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- Eric B. Decker Senior (over 50 :-) Researcher Autonomous Systems Lab Jack Baskin School of Engineering UCSC ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Detecting one event in another event
I would structure this as follows: The sendDone is async? I believe so. From sendDone, change your transmit state to ACK PENDING (or whatever you want to call it), post a task that starts the retransmit timer. If the timer expires fire off the send of the retransmission. In the receiver, if all checks out then change state appropriately and fire off the task again which cancels the timer. 1ms is kind of tight. how big are the packets and what is the transmission rate. eric On Fri, Aug 1, 2008 at 3:55 AM, ram kishore <[EMAIL PROTECTED]> wrote: > Hi, > The problem is exactly like this: > ""When the message is send,send.done() event is generated.I start waiting > for a packet to be received.If it doesn't come in 1ms,I will re-transmit > else I will transmit the next packet."" > > *Coding part:* > In send.done () > { > while ( timer <= 1000) > { > TOSH_uwait(1); //wait for 1microsecond > timer++; >if ( flag == 1) //flag is a conditional variable;If > packet is received,Receive.receive() event will set the flag to 1. >{ > call Leds.yellowToggle(); >break; >} > } > if ( timer == 1001) > post ResendTask(); > return SUCCESS; > > } > > > I will transmit the next packet in receive.receive event. > Conditional variable is not working in this regard.Any suggestion on > different paradigm ? > > Regards, > Kishore > > On Wed, Jul 30, 2008 at 11:54 PM, Eric Decker <[EMAIL PROTECTED]> wrote: > > > > > > On Wed, Jul 30, 2008 at 10:55 AM, ram kishore <[EMAIL PROTECTED]> > wrote: > >> > >> Hi all, > >> > >> When ever a packet is received, an event ReceiveMsg.receive(TOS_MsgPtr > >> Msg) is generated.Can I detect this in some other event for example in > >> send.senddone() event,so that I can perform alternative task.How to > >> detect it? > > > > First I'm not sure what problem you are trying to solve. The description > > you > > give above sounds complicated. If I understand correctly from the event > > handler for send.senddone you want to check to see if a message was > > received and do something else. Is that correct? If so it seems simpler > > to let the different handlers handler their one thing. Just an aside. > > events are signaled from another module and as such are pieces of static > > code. As such there isn't a way to detect an event in another event. > > That said your alternative sounds like it might work but it depends on > what > > kind of events, async or not, are being used. And as soon as you start > > mixing > > async stuff and wanting it to interact with a task level event things get > > complicated > > quickly. > > eric > >> > >> An alternative to this may be using conditional variables.I declare a > >> global variable "flag" as "false".Keep performing some task in > >> senddone() event.when a packet is received,receive event generated > >> will set the flag as "true", then I will stop doing task in senddone() > >> event.Will this work? > >> > >> > >> Best Regards, > >> Kishore > >> ___ > >> Tinyos-help mailing list > >> Tinyos-help@millennium.berkeley.edu > >> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > > > > > > > -- > > Eric B. Decker > > Senior (over 50 :-) Researcher > > Autonomous Systems Lab > > Jack Baskin School of Engineering > > UCSC > > > > > > -- Eric B. Decker Senior (over 50 :-) Researcher Autonomous Systems Lab Jack Baskin School of Engineering UCSC ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Printf fails with TOSH_DATA_LENGTH=64 ?
There was an update to cvs about a week ago witha fix for this. Try updating your cvs. Also, if the 2.0.2 version of printf wouldn't compile for you, but the newest one does, then you are not using 2.0.2 but something later. Kevin On Fri, Aug 1, 2008 at 9:03 AM, Alan Marchiori <[EMAIL PROTECTED]> wrote: > I have been working with the default TOSH_DATA_LENGTH=28; I am > outputting debugging information over the serial port (telosb). I > needed to send larger packets so added DTOSH_DATA_LENGTH=64 in my > makefile, that does allow me to send larger packets, but it seems to > break printf, sample output below. > > I have started looking through printf.h/nc/etc but see nothing > obviously wrong here. If anything larger packets would allow printf > to send fewer packets over the serial port. > > Possibly the problem lies in PrintfClient? > > Before I spend a lot of time looking into this, I thought I would see > if anyone has seen this problem before? I am using Tinyos 2.0.2 with > the PrintfClient from CVS (for some reason the 2.0.2 PrintfClient > didn't compile for me). > > sample output with default TOSH_DATA_LENGTH (28): > SAS, Tx REQUEST > SAS, RX Offer addr = 000f, rev rssi = -88, rssi = -43 > Checking offers, got 1 offers > best val = 0.810 address 000f parent 00 00 00 00 00 00 ba 5e > SAS, Tx ACCEPT > SAS, Tx ACCEPT > SAS, RX Grant addr = f > computed hop count as 1 > computed parent address as 0x > base address is 0x1f > child addr 0x001f - 0x00ff > APP, Associated > APP, sending assoc evt > NCEP, RX for me trans ack seq: 0, cancel resend, signal success. > APP, NCEP send SUCCESS > > sample output after chanig TOSH_DATA_LENGTH=64: > SAS, Tx REQUEST > SAS, RX Offer addr = 000f, r= -43 > Checking offers, got 1 offeraddress 000f parent 00 00 00, Tx ACCEPT > SAS, Tx ACCEPT > SAS, RX Grantop count as 1 > computed parenbase address is 0x1f > child aAPP, Associated > APP, sendingNCEP, transport retry 1 > NCEP, RX for me trans ack se signal success. > APP, NCEP s > ___ > Tinyos-help mailing list > Tinyos-help@millennium.berkeley.edu > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- ~Kevin ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] default event problem - not implemented
this should work right? On Thu, Jul 31, 2008 at 3:12 PM, Jack Travis <[EMAIL PROTECTED]> wrote: > Hi > > I have a problem defining the default events for my interface. > > The module implementation contains: > > signal Interface.Receive(msg, payload, len); > ... > default async event message_t* Interface.Receive(message_t* msg, void* > payload, uint8_t len) { >return msg; > } > > > And the interface contains: > > async event message_t* Receive(message_t* msg, void* payload, uint8_t len); > > > But When I wire an application to this Interface I always get the > following error: > > TestC.nc:32: `Interface.Receive' not implemented > > > I cant see why the default does not work. > Thanks > J > ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help