hi I understand from the previously archived mails on this topic (by Janos Sallai while replying to abhishek) that serial communication introduces uncontrollable delay especially when using java. i'm trying to send packets to telosB mote. because i was experiencing high jitter i tried to level thing down my introducing some delay in packets and so i'm sending a packet every 30ms. I took readings of system times after sending each packet to analyze the amount of jitter that is being experienced. I observed a strange pattern in the time difference (obtained this my subtracting the system times for sending consecutive packets).
Most of the packet we send with a delay of either 47ms or 1047ms. As i introduced a delay of 30ms i'm guessing that packets that are being transmitted after 47 ms are being transmitted without any jitter (17ms being taken for processing instructions). But for a delay of 1047 it seems there's some kind of back off of one second. This should not be a floock as there's a considerable number of packets with this delay and same pattern was observed running the applicaitn several times. results from one of the test runs are listed bellow. Does anyone have any idea about some kind of back off of 1 second or could you please suggest any other explaination that might cross your mind. Thank you 1046 1047 47 47 1047 47 62 1047 47 47 1047 47 47 1046 47 1047 1063 1047 46 1047 47 1047 1063 46 63 47 1047 1047 46 1047 47 1047 63 1046 47 1047 47 1047 47 47 47 46 63 1062 1047 1047 1047 1047 1047 1062 47 47 1047 47 47 1047 46 47 1047 47 47 47 47 62 47 47 47 47 1062 47 63 1046 47 1047 47 47 47 47 62 47 1047 47 1062 1047 1047 1047 62 47 1047 1047 47 47 1062 47 47 63 46 1047 47 1047 1047 47 62 1047 47 1063 62 47 1047 1047 47 46 47 1047 1047 1047 62 1047 1047 47 47 62 47 47 1047 47 47 1047 1047 1046 47 1063 47 1047 46 47 1047 1047 1063 46 1047 47 47 47 47 47 47 62 47 1047 47 47 46 47 47 47 1047 47 1062 47 47 63 46 63 47 62 32 1062 47 47 1047 1047 46 1047 47 1063 47 46 47 1047 47 63 46 47 47 63 47 62 1047 47 1047 1047 46 1047 47 1063 1047 1046 47 47 1047 1047 62 47 47 47 47 1047 47 1047 46 63 47 1047 47 62 47 47 1047 1047 46 47 47 1047 47 47 47 47 1046 1063 1047 1047 47 1046 1063 1047 1047 1047 46 47 63 47 47 46 47 1063 31 1063 46 47 47 63 1047 1046 47 47 47 63 46 47 47 1047 47 47 47 1062 47 47 47 47 1047 46 On Mon, Jun 16, 2008 at 1:23 PM, Janos Sallai <[EMAIL PROTECTED]> wrote: > Abhishek: > > > > There is just too much jitter in the delays in the pc->mote communication, > especially if you use java. Most of this jitter you just can't control (JVM, > OS, USB, etc.) > > > > Have you considered moving the timing-sensitive code to the mote? > > > > Janos > > > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Abhishek > Anand > Sent: Monday, June 16, 2008 11:22 AM > To: Andrey Gursky; [email protected] > Subject: Re: [Tinyos-help] Mote-PC serial speed increasing > > > > Hi, > > > > I'm facing a similar problem! > > My protocol requires a strict time control on when the the packets are > actually transmitted from the base station. > > I have programmed by base-station-mote with the BaseStation app in > /$TOSROOT/apps/ folder. > > On the PC, my java program uses a the MoteIF class to send the packets > > But unfortunately, it takes randomly a value b/w 8 to 25ms for the packets > to be ultimately broadcasted thru radio. > > I mean the call to > > MoteIF.send(MoteIF.TOS_BCAST_ADDR, smsg); > in java takes anything b/w 8-25ms to return. > > > > This is causing a lot of problem for me because my application requires fine > timing control > > I'm okay with a delay of 20ms but is there any way to remove the randomness > of the time taken? > > In other words, is it possible to do something so that there is a FIXED gap > of few ms b/w call to MoteIF.send > > and the the commencement of the radio transmission of the packet at the > Base-station mote? > > > > Regards, > > Abhishek Anand > > IIT Guwahati > > On Mon, Jun 16, 2008 at 9:00 PM, Andrey Gursky <[EMAIL PROTECTED]> > wrote: > > Hi! > > Thanks Janos for your advices! > > I've changed the serial speed to 230400 (because of serial speed > declarations in GNU/Linux). It works :) > After simple test with printf() there is about 1 Kbyte/s :( > Than I've changed printf() test application. I supply printf() a string with > about 250 characters, then flush(). I could read about 8.5 Kbyte/s. It's > really more than standard for IRIS 57600 Kbit/s, but it is still less than > standard for other platforms. I've used PrintfClient to get the data. > > What do you think, is there a bottleneck easy to reprogram? I haven't tested > yet how much traffic I can transmit throw ZigBee. If this will not more than > 8.5 Kbyte/s then there is no sense to work around serial communication. > > Best regards, > Andrey > >> Andrey: >> >> I think the code change you're proposing should work. >> >> >So atm128 doesn't have speed enough to guarantee 256 KBit/s >> >data connection pc<->mote? If one want this, one should >> >implement a different platform with another microcontroller? >> >> There's a good chance that it works. Just give it a try. BTW, I bet you'll >> never >> be getting 250kbps worth of zigbee payload in through the radio... >> >> >By the way, MIB520 has also a microcontroller on board. >> >Is USART of Mote directly connected to FTDI chip or >> >throw this microcontroller? >> >> It's hooked up directly to the FTDI chip. >> >> >It seems to be not so easy even at the standard serial speed :( >> Obviously, 57600bps might not be sufficient to push through all the >> incoming >> radio traffic... >> >> Janos >> >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] >> On Behalf Of Andrey Gursky >> Sent: Thursday, June 12, 2008 6:00 AM >> To: [email protected] >> Subject: Re: [Tinyos-help] Mote-PC serial speed increasing >> >> Thanks Janos! >> >> > On the iris, the ubrr0 register is set, at initialization time, to a >> > calibrated >> > value for 57600bps. You can change the baud rate by writing this >> > register. >> > >> >> I've found in $TOSROOT/tos/chips/atm128 this code: >> >> command error_t Init.init() { >> if (PLATFORM_BAUDRATE == 19200UL) >> m_byte_time = 200; // 1 TMicor ~= 2.12 us, one byte = 417us ~= 200 >> else if (PLATFORM_BAUDRATE == 57600UL) >> m_byte_time = 68; // 1 TMicor ~= 2.12 us, one byte = 138us ~= 65 >> return SUCCESS; >> } >> >> I could add the line like this (or I should seek on to find ubrr0?) >> .. >> else if (PLATFORM_BAUDRATE == 256000UL) >> m_byte_time = ----->15<-----; // 1 TMicor ~= 2.12 us, one byte >> = ----->31us<----- ~= ----->15<----- >> .. >> >> > >> > This should work with a MIB520, but it is problematic with a MIB510. >> > Should >> > you have the former programming board, the bottleneck will probably be >> > the >> > interrupt load on the mote in the pc->mote direction. Note that the >> > serial >> > stack doesn't buffer outgoing packets (mote->pc), so the app must >> > assume >> > a lossy mote->pc link. >> > >> >> I have MIB520 (with usb) :) >> So atm128 doesn't have speed enough to guarantee 256 KBit/s data >> connection >> pc<->mote? If one want this, one should implement a different platform >> with another microcontroller? >> >> By the way, MIB520 has also a microcontroller on board. Is USART of Mote >> directly >> connected to FTDI chip or throw this microcontroller? >> >> There is one post seems to achieve similar goal: the highest speed :) >> >> https://www.millennium.berkeley.edu/pipermail/tinyos-help/2008-June/034218.html >> >> It seems to be not so easy even at the standard serial speed :( >> >> Could someone point me to reference where I can read about what the >> atm128x >> has yet free to use as quick and reliable communication with PC (SPI, >> I2C)? >> Or the best idea were to use other small design to exchange messages >> between >> PC and ZigBee motes? >> >> >> >> > >> > -----Original Message----- >> > From: [EMAIL PROTECTED] >> > [mailto:[EMAIL PROTECTED] >> > On Behalf Of Andrey Gursky >> > Sent: Tuesday, June 03, 2008 6:16 AM >> > To: [email protected] >> > Subject: [Tinyos-help] Mote-PC serial speed increasing >> > >> > Hi tinyOS-community! >> > >> > It seems possible (according datasheet) to use USART of ATmega128x in >> > >57600 >> > speed mode. Thus ZigBee functions of 250 Kbit/s it would be nice to >> > have this >> > speed also between basestation and PC. >> > Does somebody know exactly, whether it would be as of some other reasons >> > not >> > possible? Or have I to alter configuration in .../chip/atm1281 to get >> > this > >> > working? >> > >> > >> > Best regards, >> > Andrey >> > >> > P.S. Particularly I'm interesting in iris-motes. >> > _______________________________________________ >> > Tinyos-help mailing list >> > [email protected] >> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> > >> _______________________________________________ >> Tinyos-help mailing list >> [email protected] >> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
