Spidernet Lists | 1 Mar 2007 02:42
Picon

Debugging

Hi,
I am trying to debug my code. I am running under linux environment. I 
have avr-insight-6.3-1.i386.rpm already installed in root # /home
Is there a Graphical way to debug in Linux like we do in Avr-Studio 
under Windows... I understand we need to do something with avr-insight.. 
can anyone guide me???

Spidernet Lists | 1 Mar 2007 03:57
Picon

Debugging error

Hi,
The c code generated for Blink application for my platform is as follows:

#define nx_struct struct
#define nx_union union
#define dbg(mode, format, ...) ((void)0)
#define dbg_clear(mode, format, ...) ((void)0)
#define dbg_active(mode) 0
# 65 "/usr/lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h"
typedef signed char int8_t;

typedef unsigned char uint8_t;
# 104 "/usr/lib/gcc/avr/3.4.3/../../../../avr/include/stdint.h" 3
typedef int int16_t;

typedef unsigned int uint16_t;

I am getting the following error in avr-insight

/opt/tinyos-2.x/apps/Blink/build/chipconz/app.c:7: Error in sourced 
command file:
Undefined command: "typedef".  Try "help".

    while executing
"gdb_cmd "source $file_name""
    (procedure "source_file" line 4)
    invoked from within
"source_file"
    invoked from
within
(Continue reading)

Omprakash Gnawali | 1 Mar 2007 04:18
Picon
Favicon

Re: Implementing a routing protocol


> But CTP only applies to trees, so I'll have to make a number of
> changes to the interfaces so that they fit to what I need.
> Is there ongoing or planned work about generic routing protocols ? Or
> should I design this on my own and provide it at the end as a basis
> for future work (the code will be GPL) ?
> 
> Regards,
> Romain
> 

It is true that CTP only applies to trees. As you work on your
protocol, we would like your thoughts on what parts of the interface
of what component requires changes to accommodate your any-to-any
routing protocol. Even though CTP is designed as an address-free
routing protocol, we hope you will be able to use some parts of it
without major changes. Your comments and contributions are welcome.

Thanks.

- om_p

Xyza Ong | 1 Mar 2007 06:34
Picon
Favicon

Display Debug Messages from the Mote

Hello guys,

I would like to ask how to display and view debug messages from the mote.
I have four mica2 motes and a base mote installed with TOSBase.
I want to know and view the number of missed packets/msg or packet/msg sent from the motes and receive at the base mote. 

I have read in the tutorials that there are debug options but are they only available for TOSSIM e.g. dbg(DBG_USR1....  ?

Anyway, I tried that dbg(DBG_USR1... and used the java Listen tool but it only display the raw packets.

How can I display the msg explicitly?

By the way, I am confused with this. For example I want to know if the sequence numbers are sequential, so I include this code in the application

event TOS_MsgPtr ReceiveChirpMsg.receive(TOS_MsgPtr data) {
   ChirpPacket *pchpIn = (ChirpPacket *)(data->data);
    dbg( DBG_USR1, "ChirpM: receive chirp %x \n", pchpIn->nSeq);
    sn = pchpIn->nSeq;
    cntdiff = sn-nlastseq;
    dbg(DBG USR1, "The difference on the sequence number is %x\n", pchpIn->cntdiff);
    nlastseq = pchpIn->nSeq;
  :
  :
When I compiled the application after including that, there is no error, though the code has no effect upon uploading it in the mote or in java listen tool. :D
Now I think it should be incorporated in the TOSBase? Right?

Im sorry about that somewhat foolish question but I am confused.


Thanks!

regards,
xyza

Never miss an email again!
Yahoo! Toolbar
alerts you the instant new Mail arrives. Check it out.
<div>
<p>Hello guys,<br><br>I would like to ask how to display and view debug messages from the mote.<br>I have four mica2 motes and a base mote installed with TOSBase.<br>I want to know and view the number of missed packets/msg or packet/msg sent from the motes and receive at the base mote.&nbsp; <br><br>I have read in the tutorials that there are debug options but are they only available for TOSSIM e.g. dbg(DBG_USR1....&nbsp; ? <br><br>Anyway, I tried that dbg(DBG_USR1... and used the java Listen tool but it only display the raw packets. <br><br>How can I display the msg explicitly? <br><br>By the way, I am confused with this. For example I want to know if the sequence numbers are sequential, so I include this code in the application<br><br>event TOS_MsgPtr ReceiveChirpMsg.receive(TOS_MsgPtr data) {<br>&nbsp;&nbsp; ChirpPacket *pchpIn = (ChirpPacket *)(data-&gt;data);<br>&nbsp;&nbsp;&nbsp; dbg(
 DBG_USR1, "ChirpM: receive chirp %x \n", pchpIn-&gt;nSeq);<br>&nbsp;&nbsp;&nbsp; sn =
 pchpIn-&gt;nSeq;<br>&nbsp;&nbsp;&nbsp; cntdiff = sn-nlastseq;<br>&nbsp;&nbsp;&nbsp; dbg(DBG USR1, "The difference on the sequence number is %x\n", pchpIn-&gt;cntdiff);<br>&nbsp;&nbsp;&nbsp; nlastseq = pchpIn-&gt;nSeq;<br>&nbsp; :<br>&nbsp; :<br>When I compiled the application after including that, there is no error, though the code has no effect upon uploading it in the mote or in java listen tool. :D<br>Now I think it should be incorporated in the TOSBase? Right?<br><br>Im sorry about that somewhat foolish question but I am confused.<br><br><br>Thanks!<br><br>regards,<br>xyza<br></p>
<p> 

</p>
<a href="http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/">Never miss an email again!<br>Yahoo! Toolbar</a> alerts you the instant new Mail arrives.<a href="http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolbar/features/mail/"> Check it out.</a>
</div>
Nilesh Mishra | 1 Mar 2007 07:39
Picon

Radio Backoff and SPI baud rate

Hi,
     I have two connected questions wrt Radio interface in TinyOS (1.x
and Boomerang). I am using tmote-sky in Boomerang environment.

1. I am using the CC2420RadioC/M components to send data packets and
timestamping at the following places:
  a. Just prior to calling send command (say T1)
  b. At SFD fire (using CC2420TimeStampingC/M) (say T2)
  c. At sendDone event. (say T3)
Even when I am disabling back-offs in CC2420M I am seeing a random
delay (in T2-T1) of the order of 2-9 ms. Part of the time can be
attributed to SPI transfer from MSP430 RAM to CC2420 RAM (around 1.7ms
for 36 bytes) but what is causing the rest of the delay?

2. In the above calculations I used a SPI transfer rate of 162Kbps
between MSP430 RAM and Radio RAM which I have obtained doing some
experiments. Is it defined somewhere or default rate? Can it be
increased or changed? If yes where?

I can send the code in case ...

Thanks & Regards,
Nilesh

--

-- 
Nilesh Mishra
Department of Computer Science and Engineering,
Indian Institute of Technology Kanpur
Kanpur, India
mail: nilmish <at> cse.iitk.ac.in
        nilesh.mishra <at> yahoo.co.in
        nilmish <at> gmail.com
Jordi Casals | 1 Mar 2007 08:49
Picon

Re: I2C, T2 and micaz

Ok, thank you! I have read a thread talking about the same problem, and it's solved!!

The thread is:
http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2007-January/021749.html


2007/2/28, Philip Levis <pal <at> cs.stanford.edu>:
On Feb 26, 2007, at 6:39 AM, Jordi Casals wrote:

> Hi,
>
> I use T2 and a micaz platform and now I am trying to connect an I2C
> display to my micaz. I don't have the display yet, but I want to
> have my application ready as soon as possible. I would like to know
> if the writeDone event is signaled even there is no I2C device
> connected to my micaz. I don't know if I there is any problem...
> but Leds.set(0x02) is never called.
>
> Thank you
>
> ______________________________________________________________
> module RandomToI2CC{
>    uses{
>        interface Boot;
>        interface Leds;
>        interface Random;
>        interface Resource;
>        interface I2CPacket<TI2CBasicAddr> as I2C;
>        interface Timer<TMilli> as Timer;
>    }
> }
>
> implementation{
>    uint8_t counter = 0;
>
>    event void Boot.booted(){
>        call Leds.set(0);
>        call Timer.startPeriodic(TIMER_PERIOD);
>    }
>      event void Timer.fired(){
>        if(!(call Resource.isOwner())){
>            if(call Resource.request() == SUCCESS){
>                          }
>        }
>    }
>      event void Resource.granted(){
>        if(call I2C.write(I2C_START | I2C_STOP, 12, sizeof(uint8_t),
> &counter) == SUCCESS){
>            call Leds.set(0x01);
>        }else{
>            call Leds.set (0xFF);
>        }
>    }
>      async event void I2C.readDone(error_t error, uint16_t addr,
> uint8_t length, uint8_t* data){
>          }
>      async event void I2C.writeDone(error_t error, uint16_t addr,
> uint8_t length, uint8_t* data){
>        if(call Resource.release() == SUCCESS){
>            call Leds.set(0x04);
>        }
>        call Leds.set(0x02);
>    }
> }
> ______________________________________________________________


When it comes to I2C, things can be hard to debug. I suggest that you
take a look at how the I2C driver works (chips/atm128/i2c/
Atm128I2CMasterPacketP.nc). If you're not getting a writeDone(), then
chances are the I2C isn't issuing an interrupt in response to your
start condition.

Phil



--
Jordi Casals
E-mail: jordi.casals <at> gmail.com
<div>
<p>Ok, thank you! I have read a thread talking about the same problem, and it's solved!!<br><br>The thread is:<br><a href="http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2007-January/021749.html">http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2007-January/021749.html
</a><br><br><br></p>
<div>
<span class="gmail_quote">2007/2/28, Philip Levis &lt;<a href="mailto:pal <at> cs.stanford.edu">pal <at> cs.stanford.edu</a>&gt;:</span><blockquote class="gmail_quote">
On Feb 26, 2007, at 6:39 AM, Jordi Casals wrote:<br><br>&gt; Hi,<br>&gt;<br>&gt; I use T2 and a micaz platform and now I am trying to connect an I2C<br>&gt; display to my micaz. I don't have the display yet, but I want to
<br>&gt; have my application ready as soon as possible. I would like to know<br>&gt; if the writeDone event is signaled even there is no I2C device<br>&gt; connected to my micaz. I don't know if I there is any problem...
<br>&gt; but Leds.set(0x02) is never called.<br>&gt;<br>&gt; Thank you<br>&gt;<br>&gt; ______________________________________________________________<br>&gt; module RandomToI2CC{<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;uses{<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface Boot;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface Leds;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface Random;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface Resource;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface I2CPacket&lt;TI2CBasicAddr&gt; as I2C;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface Timer&lt;TMilli&gt; as Timer;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt; }<br>&gt;<br>&gt; implementation{<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;uint8_t counter = 0;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;event void Boot.booted(){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call Leds.set(0);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call Timer.startPeriodic(TIMER_PERIOD);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;}
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event void Timer.fired(){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!(call Resource.isOwner())){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(call Resource.request() == SUCCESS){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event void 
Resource.granted(){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(call I2C.write(I2C_START | I2C_STOP, 12, sizeof(uint8_t),<br>&gt; &amp;counter) == SUCCESS){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call Leds.set(0x01);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}else{<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call Leds.set
(0xFF);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;async event void I2C.readDone(error_t error, uint16_t addr,<br>&gt; uint8_t length, uint8_t* data){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;async event void I2C.writeDone(error_t error, uint16_t addr,
<br>&gt; uint8_t length, uint8_t* data){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(call Resource.release() == SUCCESS){<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call Leds.set(0x04);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call Leds.set(0x02);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt; }<br>&gt; ______________________________________________________________
<br><br><br>When it comes to I2C, things can be hard to debug. I suggest that you<br>take a look at how the I2C driver works (chips/atm128/i2c/≤br>Atm128I2CMasterPacketP.nc). If you're not getting a writeDone(), then<br>
chances are the I2C isn't issuing an interrupt in response to your<br>start condition.<br><br>Phil<br>
</blockquote>
</div>
<br><br clear="all"><br>-- <br>Jordi Casals<br>E-mail: <a href="mailto:jordi.casals <at> gmail.com">jordi.casals <at> gmail.com
</a>
</div>
Philip Levis | 1 Mar 2007 09:02
Picon

Re: Questions about using I2C on MicaZ / MTS300 (TinyOS 2)

On Jan 3, 2007, at 12:50 PM, Thomas Wagner wrote:

> Hi again,
>
> Would you mind if I ask you another question?
>
> We have to write our program (wich communicates with the Mote  
> Network) in VB.net, so we are about to code some kind of message  
> listener in .net. Now we're hanging in decoding / encoding our  
> messages. In particular, building the checksum (which we think are  
> the last 2 bytes before the "ending" (7E)). Could you give us a few  
> tips about the algorithm? Could you also give us a little insight  
> what Bytes 1 to 10 (0 = "beginning" (7E)) mean? (We think that  
> Bytes 3 and 4 are the destination address, Byte 7 the count of the  
> payload bytes + checksum and Byte 9 is eventually the AM Type, but  
> the other ones we don't know.)
>
> Many Thanks...

TEP 113 (Serial Communication) describes the packet format.

Phil

Romain Thouvenin | 1 Mar 2007 09:57
Picon

Re: Implementing a routing protocol

On 3/1/07, Omprakash Gnawali <gnawali <at> usc.edu> wrote:
>
> > But CTP only applies to trees, so I'll have to make a number of
> > changes to the interfaces so that they fit to what I need.
> > Is there ongoing or planned work about generic routing protocols ? Or
> > should I design this on my own and provide it at the end as a basis
> > for future work (the code will be GPL) ?
> >
> > Regards,
> > Romain
> >
>
> It is true that CTP only applies to trees. As you work on your
> protocol, we would like your thoughts on what parts of the interface
> of what component requires changes to accommodate your any-to-any
> routing protocol. Even though CTP is designed as an address-free
> routing protocol, we hope you will be able to use some parts of it
> without major changes. Your comments and contributions are welcome.
>
> Thanks.
>
> - om_p
>

Sure. I should start working on the design quite soon now.

Romain
rachna goel | 1 Mar 2007 10:19
Picon
Favicon

problem regardint XSENSOR MTS 300 application

hi all,
I m trying to compile XSENSOR MTS 300 application that comes with tiny OS installation cd in xbow folder.But every time it is showing the following error
Voltage component not found
 
could some body tell me where to get this voltage component.
thnx in advance
Rachna Goel
Project Engineer
C-DAC,Pune
 

Here’s a new way to find what you're looking for - Yahoo! Answers
<div>
<div>hi all,</div>  <div>I m trying to compile XSENSOR MTS 300 application that comes with tiny OS installation cd in xbow folder.But every time it is showing the following error</div>  <div>Voltage component not found</div>  <div>&nbsp;</div>  <div>could some body tell me where to get this voltage component.</div>  <div>thnx in advance</div>  <div>Rachna Goel</div>  <div>Project Engineer</div>  <div>C-DAC,Pune</div>  <div>&nbsp;</div>
<p> 
	

	
		</p> 
Here&#146;s a new way to find what you're looking for - <a href="http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/">Yahoo! Answers</a>
</div>
Muhammad Azhar | 1 Mar 2007 10:25
Picon
Favicon

Queue and time sync

Hi all,

   If a number of motes are sending data to the root every 10 secs, does the 
root need some sort of Queue to enqueue the messages, so that no messages 
are lost?  'Coz when I did something like this, there were a few instances 
when the motes were not sending messages to the root, although it'd come 
back later.  The motes were places statically, so is it possible that the 
link quality is affecting the transmission?  Or is it simply because I 
didn't put my messages in queue, thus, some messages were not processed by 
the root?

   Also, are there any recommended articles on simple time synchronization?  
I've read RBS and TPSN, but I don't really know how to implement the former 
while for the latter, I do not have any idea on lowering the granularity of 
the clock as well as time stamping the packets at the RFM layer instead of 
the application layer.  Although there are codes for the latter, I think 
they're really quite complex.  I'd like to implement a really simple time 
synchronization.
   By the way, what exactly does "local clock" mean?  Is it just referring 
to the timer value?  In that case, wouldn't all "local clocks" start from 
zero?  If it is referring to a specific time, then how do we implement this? 
  In fact, is it possible to do this if my root is permanently attached to 
the USB port of the PC where it is always receiving data?  Also, if we want 
to use a reference clock, does it mean that other motes do not necessarily 
need a "clock"?

   I'm really quite lost on implementing time sync.  Furthermore, I can't 
seem to find pseudocodes on this too (the only codes I found were 
implemented by Saurabh G. which I really find too complex).  But most 
importantly, I need to know what local clock is referring to.  Many thanks 
for your patience.

Regards,
Azhar


Gmane