[Tinyos-help] some thing what shouldn't be in footer->neighborList

2008-05-20 Thread funofnet Funofnet
Hi,
this is where I suspect the bug : LinkEstimatorP.nc
**
 j = 0;
 newPrevSentIdx = 0;
NEIGHBOR_TABLE_SIZE = 10 // I added to have all the constants mentionned
    for (i = 0; i < NEIGHBOR_TABLE_SIZE && j < maxEntries; i++) {
  k = (prevSentIdx + i + 1) % NEIGHBOR_TABLE_SIZE;
  if ((NeighborTable[k].flags & VALID_ENTRY) &&
   (NeighborTable[k].flags & MATURE_ENTRY)) {
 footer->neighborList[j].ll_addr = NeighborTable[k].ll_addr;
 footer->neighborList[j].inquality = NeighborTable[k].inquality;
 newPrevSentIdx = k;
 dbg("LI", "Loaded on footer: %d %d %d\n", j, footer->neighborList[j].ll_addr,
 footer->neighborList[j].inquality);
 j++;
  }
    }
***
Normally footer->neighborList[] should contain distinct neighbour but in the 
case where the second and last element in the 
NeighborTable are mature and valid only element index 1 will be insert. Isn't 
it?
I explain more:
k = 0 + 0 + 1 % 10 = 1 (NeighborTable[1] is mature and valid) then 
 footer->neighborList[0].ll_addr = NeighborTable[1].ll_addr;
 footer->neighborList[0].inquality = NeighborTable[1].inquality;
then we continue until * i = 9 * 
k = 1 + 9 + 1 = 11 % 10 = 1 (NeighborTable[1] is mature and valid) then 
 footer->neighborList[1].ll_addr = NeighborTable[1].ll_addr;
 footer->neighborList[1].inquality = NeighborTable[1].inquality;
=> duplication !!!
Is it right my conclusion?
Thank you very much
Fun

__
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible 
contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail ___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] Problem with MultiHopOscilloscope

2008-05-20 Thread Antonio Prados Vilchez
Hi TinyOS users!!
 
I'm trying to understand how Collection Tree Protocol works. 
MultiHopOscilloscope would help me to do that, so I have downloaded it into 
three MICA2 motes. The problem is that it doesn't work. I have modified the 
application in order to know why it happens. The Send.sendDone event doesn't 
occur when a radio-transmission has finished. Am I doing anything wrong? Does 
anybody know if there is an actualized version of this application? Or should I 
modify anything in some library?
 
Thanks in advance.
 
==
Este mensaje se dirige exclusivamente a su destinatario, y puede contener 
información confidencial sometida a secreto profesional, o cuya divulgación 
esté legalmente prohibida.Cualquier opinión en él contenida es exclusiva de su 
autor y no representa necesariamente la opinión de la empresa. Si ha recibido 
este mensaje por error, le rogamos nos lo comunique de forma inmediata por esta 
misma vía y proceda a su eliminación, así como a la de cualquier documento 
adjunto al mismo. El correo electrónico vía Internet no es seguro y no se puede 
garantizar que no haya errores ya que puede ser interceptado, modificado, 
perdido o destruido, o contener virus. Cualquier persona que se ponga en 
contacto con nosotros por correo electrónico se considerará que asume estos 
riesgos.

This e-mail is addressed exclusively to the recipient and may contain 
privileged information under a professional confidential agreement or it may be 
against the law to disclose its contents. Any opinion contained in it belongs 
exclusively to his/her author and does not necessarily reflect the company's 
view. If you receive this e-mail in error, please let us know immediately (by 
return e-mail) and proceed to its destruction, as well as any document attached 
to it. The sending of e-mails through the Internet is not safe and, therefore, 
error-free communications cannot be guaranteed, as they can be intercepted, 
changed, misled or destroyed or they might contain a virus. Any user contacting 
us through e-mails shall be understood to be assuming these risks.
==___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] How to store data in a Mysql database from TOSSIM 2

2008-05-20 Thread Eva Maria Garcia
Hi all,

 

I am writting a Tinyos 2 application and I am simulating it with TOSSIM. I
have a Python script which takes data from a Mysql database and send this
data to the motes through Python packets. When the simulation ends, the
Python script gets final data and write it on the database. But I wish to
store intermediate data of the simulation but I don't know how to do it.
Currently, the intermediate data is stored on a text file and this text file
is readed by the Python application (line by line) and the data is written
to the database. Has someone any idea?

 

Thanks in advance,

Eva

 

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] CVS TestSerialBandwidth Code Error w/Fix

2008-05-20 Thread Federico Spadini
Hey Guys,

Just wanted to let you know that the application in
/apps/tests/TestSerialBandwidth/ has an error in the java file
TestSerial.java.

Line 78 should says String source = null; instead of String source = "";

 

Seemed to trivial to bug the guys on the devel list about.

 

Thanks

Federico

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] Sending data from PC to Mote.

2008-05-20 Thread Vincas Benevičius
I went through the mailing list, read TinyOS2 documentation, but couldn’t
get to the point, where everything works fine… I’m new to motes, so any help
would be very much appreciated. I need to send a message from PC to mote,
but just can’t get it right. I’m using TmoteSky platform. Mote is plugged to
USB port and recognized as serial port COM15 (I’m using FTDI USB to serial
drivers). On the PC, there is software written using C#. Everything works
fine, when I want to read information the mote is sending to serial port,
but I can’t write to it. Can anyone tell me exact packet format which is
needed to be sent to be recognized and accepted by mote? I tried various
formats according to google’d information, but neither of them worked.

On the mote side there’s:

uses interface Receive as SPReceive;
...
event *message_t SPReceive.receive(message_t* msg, void* payload, uint8_t
length) {
  Blink(0,100); //blinks red for 100ms
  return(msg);
} 

SPReceive is linked like this:

#define AM_SERIAL_MSG 103
...
components SerialActiveMessageC as SP;
...
AppC.SPReceive -> SP.Receive[AM_SERIAL_MSG];

On the PC side in Visual Studio:

SerialPort SP;
byte[] packet = { };
...
SP.PortName("COM15");
SP.Open();
SP.Write(packet, 0, packet.Length);
...


No matter what packets i send, i can't get the mote to blink...
Can anyone tell exact format of the packed whick is to be sent?
Something like this:

Frame byte (0x7e)
...
Payload
CRC 2 bytes
Frame byte(0x7e)

Thank You in advance.

Su pagarba, Vincas Benevičius
UAB "Baltec-CNC Technologies"
Raudondvario pl. 148, Kaunas LT 47157
Tel.: +370 684 02159
E-paštas: [EMAIL PROTECTED]
http://www.baltec-cnc.com




___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Problem with MultiHopOscilloscope

2008-05-20 Thread Omprakash Gnawali
On Tue, May 20, 2008 at 1:26 AM, Antonio Prados Vilchez
<[EMAIL PROTECTED]> wrote:
> Hi TinyOS users!!
>
> I'm trying to understand how Collection Tree Protocol works.
> MultiHopOscilloscope would help me to do that, so I have downloaded it into
> three MICA2 motes. The problem is that it doesn't work. I have modified the
> application in order to know why it happens. The Send.sendDone event doesn't
> occur when a radio-transmission has finished. Am I doing anything wrong?
> Does anybody know if there is an actualized version of this application? Or
> should I modify anything in some library?

Did you make any changes at all in the application?

Would it be possible for you to run apps/tests/TestNework on your
motes - make sure one of the nodes has id 0. You should then see the
root forwarding the received packets on the UART. The rest of the
motes will also send debug messages on their UARTs. If you send those
debug messages, we can look at the error messages.

- 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] Q about CTP protocol

2008-05-20 Thread Omprakash Gnawali
On Mon, May 19, 2008 at 1:14 PM, gaurav mathur <[EMAIL PROTECTED]> wrote:
> Hi,
> CTP provides Intercept interface, I am not getting how to use event
> Intercept.forward. Please give me a sample code demonstrating
> Intercept.forward event.

I do not have an example but maybe you can ask Dimas:
http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2008-January/030768.html

- 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] some thing what shouldn't be in footer->neighborList

2008-05-20 Thread Omprakash Gnawali
On Tue, May 20, 2008 at 12:26 AM, funofnet Funofnet <[EMAIL PROTECTED]> wrote:
> Hi,
>
> this is where I suspect the bug : LinkEstimatorP.nc
>
> **
>
>  j = 0;
>  newPrevSentIdx = 0;
>
> NEIGHBOR_TABLE_SIZE = 10 // I added to have all the constants mentionned
> for (i = 0; i < NEIGHBOR_TABLE_SIZE && j < maxEntries; i++) {
>   k = (prevSentIdx + i + 1) % NEIGHBOR_TABLE_SIZE;
>   if ((NeighborTable[k].flags & VALID_ENTRY) &&
>(NeighborTable[k].flags & MATURE_ENTRY)) {
>  footer->neighborList[j].ll_addr = NeighborTable[k].ll_addr;
>  footer->neighborList[j].inquality = NeighborTable[k].inquality;
>  newPrevSentIdx = k;
>  dbg("LI", "Loaded on footer: %d %d %d\n", j,
> footer->neighborList[j].ll_addr,
>  footer->neighborList[j].inquality);
>  j++;
>   }
> }
>
> ***
>
> Normally footer->neighborList[] should contain distinct neighbour but in the
> case where the second and last element in the
>
> NeighborTable are mature and valid only element index 1 will be insert.
> Isn't it?
>
> I explain more:
>
>
>
> k = 0 + 0 + 1 % 10 = 1 (NeighborTable[1] is mature and valid) then
>
>  footer->neighborList[0].ll_addr = NeighborTable[1].ll_addr;
>  footer->neighborList[0].inquality = NeighborTable[1].inquality;
>
>
>
> then we continue until * i = 9 *
>
> k = 1 + 9 + 1 = 11 % 10 = 1 (NeighborTable[1] is mature and valid) then

You are updating prevSentIdx in the expression above to 1 - that
happens only after you exit the for loop. The correct expression
should be 0 + 9 + 1 = 10 % 10 = 0 so I don't think this is a bug.

Does this make sense?

- om_p
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Re : some thing what shouldn't be in footer->neighborList

2008-05-20 Thread funofnet Funofnet
Hi,
Oups, yes you are right ! I didn't pay enough attention.
Sorry,
Thank you very much Mr. Omprakash

__
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible 
contre les messages non sollicités 
http://mail.yahoo.fr Yahoo! Mail ___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] [Tinyos-devel] what version of Gcc should I be using? Possible bug?

2008-05-20 Thread Janos Sallai
Eric,

 

I can't help you, but I suspect that the gcc you're using to compile the
MCU application is not version 4.1.2. To get ncc spit out the correct
gcc version you need to type "ncc --version -target=telosb" (replacing
telosb with whatever mote you're using).

 

Also, in the future, please post such questions to tinyos-help instead
of tinyos-devel.

 

Janos

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eric
Decker
Sent: Tuesday, May 20, 2008 2:38 AM
To: [EMAIL PROTECTED]
Subject: [Tinyos-devel] what version of Gcc should I be using? Possible
bug?

 

I've been chasing a problem where the following code doesn't do the
right thing.

 

  bool isSetSCCI() {

return (TACCTL2 & SCCI);

  }

 

SCCI has the value 0x0400 (bit 10 of TACCTLx).  I would expect this to
return 0x0400 if

SCCI is set and 0 otherwise.  The code generated both with and without
optimization is

given below.  It basically does nothing.  Am I missing something?  (As I
get older my

brain definitely misses things)

 

(gdb) x/3i 460c

0x460c : mov &0x0166,r15 ;src
addr 0x0166

0x4610 :   clr r15 ;

0x4612 :   ret

 

 

Here is the code I'm running.  I'm a bit dubious of gcc 4.1.2.  What
version should I be

running?

 

cire-laptop (47): ncc --version

ncc: 1.2.4

nescc: 1.2.9

gcc: gcc (GCC) 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

Copyright (C) 2006 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is
NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

 


-- 
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] Problem with AMSend interface of CC2420

2008-05-20 Thread Juan Francisco Del Amor Lajarin
Hi all,
It´s my first time, so I apologise in advance if there are many erros with
my English, I am a student that is doing a report of interfaces about CC2420
Chipcom.

My doubt is why at first of the code of AMSend interface make this
operation  CC2420_SIZE = MAC_HEADER_SIZE + MAC_FOOTER_SIZE.

Waiting your news, a greeting.

Juan Francisco
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] Timers on MSP430

2008-05-20 Thread Alexandre Buist
Hi all,

1

I made a platform and I am trying out the timers. The Alarm32Khz16C is
working good but If I 

uses interface BusyWait as PreciseWait;  ( ->
BusyWaitMilliC )

and I test

call Leds.led2On(); //yellow

call PreciseWait.wait(5);

call Leds.led2Off(); //yellow

I get a delay of 187.5us with a big jitter of ±12.5us 

This corresponds to ticks of 30.5us (T32Khz) instead of (TMilli).

Any thoughts about the wrong precision or the big jitter?

 

2

When I try to wire my BusyWait like this:

uses interface BusyWait as PreciseWait;  ( ->
BusyWait32khzC )

This is what I get

In component `BusyWait32khzC':

/opt/tinyos-2.x/tos/chips/msp430/timer/BusyWait32khzC.nc: At top level:

/opt/tinyos-2.x/tos/chips/msp430/timer/BusyWait32khzC.nc:39: cannot find
`BusyWaitCounter'

…

Ok I found this error in the Wait32khzC.nc line 39 (“C” is missing)

   38   BusyWait = BusyWaitCounterC;
   39   BusyWaitCounter.Counter -> Msp430Counter32khzC;

Does anyone care to correct the source CVS?

 

Thanks,

 

 

 

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] problems about Deluge

2008-05-20 Thread Razvan Musaloiu-E.

Hi!

On Tue, 20 May 2008, jiwen zhang wrote:


Hello :

2008/5/20 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:


Hi!


On Sun, 18 May 2008, jiwen zhang wrote:

  Hello :


2008/5/16 Razvan Musaloiu-E. <[EMAIL PROTECTED]>:

Hi!


On Thu, 15 May 2008, jiwen zhang wrote:

Hello Razvan ME :


 today, i modify the application in the directory of app/Blink and let it
support deluge :

 -in the BlinkAppC.nc , use the component DelugeC and then
 DelugeC.Leds -> LedsC
 -Modify the Makefile , add "TINYOS_NP = BNP ","CFLAGS +=
 -DDELUGE_BASESTATION"



Have you first tried the burn and burn-net from apps/tests/deluge/Blink?




Today(5.18) , i spend much time downloading the deluge/tinyos-2.x from
http://hinrg.cs.jhu.edu/git/deluge/tinyos-2.x.git . ( it is so slow to
download it -:( )
i do according to deluge-t2-manual.pdf .
the process is that :
./Bootstrap
+ aclocal
+ autoconf
+ [ -d config-aux ]
+ automake -a -c
+ set -x
+ cd platforms/mica/uisp
+ ./bootstrap
autoheader: WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
autoheader: WARNING: and `config.h.top', to define templates for ` config.h.in'
autoheader: WARNING: is deprecated and discouraged.
autoheader:
autoheader: WARNING: Using the third argument of `AC_DEFINE' and
autoheader: WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
autoheader: WARNING: `acconfig.h':
autoheader:
autoheader: WARNING:   AC_DEFINE([NEED_FUNC_MAIN], 1,
autoheader:   [Define if a function `main' is needed.])
autoheader:
autoheader: WARNING: More sophisticated templates can also be produced, see the
autoheader: WARNING: documentation.
+ rm -f config.cache src/config.cache

*there are some warnings .  are there some influence ?*



It should be ok, I also get them.

  ./configure

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking for gcc... gcc
checking for C compiler default output file name... a.exe
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for perl... /usr/bin/perl
checking for python... /usr/local/bin/python
checking for nescc... /usr/bin/nescc
configure: Default ncc build target is mica
configure: ...but using a tos/.default-platform file is a better choice
configure: TinyOS directory is /opt/tinyos-2.x/tos
checking for cygwin... yes
checking for JDK location... /cygdrive/d/Program Files/Java/jdk1.5.0_01
configure: creating ./config.status
config.status: creating Makefile
config.status: error: cannot find input file: Makefile  .in

*there is an error , the it jump out . what is the reason ?*



I don't have much experience with Cywgin. On my Windows machine when I run
'./configure --prefix=$HOME/local' I didn't get any errors. I don't know if
it makes a different or not but I'm using the latest Cygwin.



i have download tinyos-2.x.git and /deluge/tinyos-2.x.git , and when i run


I just committed the latest version also to CVS so you can also grab it 
from there.



./configure , i get the same error as i said before.
maybe it's the problem of cygwin .
these are the tools i have installed : (according to the specification
of TinyOS 2.0 install instructions 
file:///G:/tinyos/文档资料/doc/html/install-tinyos.html)

avr-gcc-3.4.3-1
avarice-2.4-1
nesc-1.2.8b-1
tinyos-2.0.2-2
msp430tools-binutils-2.16-20050607
msp430tools-libc-20050308cvs-20050608
avr-binutils-2.15tinyos-3
avr-libc-1.2.3-1
avr-insight-6.3-1
tinyos-tools-1.2.4-2
msp430tools-base-0.1-20050607
msp430tools-gcc-3.2.3-20050607
msp430tools-python-tools-1.0-1

the cygwin version in my computer is cygwin-1.2a.tgz . in addition , i have
update the version of python to 2.4.5 .


I didn't use cygwin-1.2a.tgz. I just installed the latest Cygwin using the 
latest setup.exe from here:

http://www.cygwin.com/setup.exe
Then I installed the following rpms:
 4806 Mar  8 20:53 msp430tools-base-0.1-20050607.cygwin.i386.rpm
  8091730 Mar  8 20:54 msp430tools-binutils-2.16-20050607.cygwin.i386.rpm
  3985679 Mar  8 20:54 msp430tools-gcc-3.2.3-20050607.cygwin.i386.rpm
   402602 Mar  8 20:54 msp430tools-libc-20050308cvs-20050608.cygwin.i386.rpm
81149 Mar  8 20:53 msp430tools-python-tools-1.0-1.cygwin.noarch.rpm
  1097975 Mar  8 20:54 nesc-1.2.8b-1.cygwin.i386.rpm
After that I checkout the latest CVS versi

[Tinyos-help] Order of placement of global variables in SRAM

2008-05-20 Thread raj raj
Dear all,

Is there a way to force some order in the way variables (global/static) are 
placed in .data and .bss sections ? For example, let my program has 2 
initialized global variables g1 and g2 and 5 uninitialized global variables 
u1,u2,u3,u4 and u5. g1 and g2 are first placed in program memory after .text 
section and __do_copy_data copies them to the starting address in SRAM. u1 
through u5 are not explictitly stored in program memory but __do_copy_bss 
places them just after g1 and g2 in SRAM and zeroes them out. I want to know if 
I can somehow specify the order of these variables, say  g1 followed by g2; 
then u3,u4,u5,u1,u2.

I noticed that the order in which the variables are declared/defined in C file 
or assembly file does not correspond to the way they are placed in SRAM.

Thanks in advance,
Raj



  ___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] How to store data in a Mysql database from TOSSIM 2

2008-05-20 Thread Paul Stickney
How does the intermediate get generated?

On Tue, May 20, 2008 at 3:44 AM, Eva Maria Garcia
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
>
>
> I am writting a Tinyos 2 application and I am simulating it with TOSSIM. I
> have a Python script which takes data from a Mysql database and send this
> data to the motes through Python packets. When the simulation ends, the
> Python script gets final data and write it on the database. But I wish to
> store intermediate data of the simulation but I don't know how to do it.
> Currently, the intermediate data is stored on a text file and this text file
> is readed by the Python application (line by line) and the data is written
> to the database. Has someone any idea?
>
>
>
> Thanks in advance,
>
> Eva
>
>
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Sending data from PC to Mote.

2008-05-20 Thread Paul Stickney
You may want to look at the SF interface in $TOSROOT/support/sdk/c/sf
(I'm not saying use it, although I find it handy, but it should offer
some insight on packet encoding, etc.)

On Tue, May 20, 2008 at 5:23 AM, Vincas Benevičius
<[EMAIL PROTECTED]> wrote:
> I went through the mailing list, read TinyOS2 documentation, but couldn't
> get to the point, where everything works fine… I'm new to motes, so any help
> would be very much appreciated. I need to send a message from PC to mote,
> but just can't get it right. I'm using TmoteSky platform. Mote is plugged to
> USB port and recognized as serial port COM15 (I'm using FTDI USB to serial
> drivers). On the PC, there is software written using C#. Everything works
> fine, when I want to read information the mote is sending to serial port,
> but I can't write to it. Can anyone tell me exact packet format which is
> needed to be sent to be recognized and accepted by mote? I tried various
> formats according to google'd information, but neither of them worked.
>
> On the mote side there's:
>
> uses interface Receive as SPReceive;
> ...
> event *message_t SPReceive.receive(message_t* msg, void* payload, uint8_t
> length) {
>  Blink(0,100); //blinks red for 100ms
>  return(msg);
> }
>
> SPReceive is linked like this:
>
> #define AM_SERIAL_MSG 103
> ...
> components SerialActiveMessageC as SP;
> ...
> AppC.SPReceive -> SP.Receive[AM_SERIAL_MSG];
>
> On the PC side in Visual Studio:
>
> SerialPort SP;
> byte[] packet = { };
> ...
> SP.PortName("COM15");
> SP.Open();
> SP.Write(packet, 0, packet.Length);
> ...
>
>
> No matter what packets i send, i can't get the mote to blink...
> Can anyone tell exact format of the packed whick is to be sent?
> Something like this:
>
> Frame byte (0x7e)
> ...
> Payload
> CRC 2 bytes
> Frame byte(0x7e)
>
> Thank You in advance.
>
> Su pagarba, Vincas Benevičius
> UAB "Baltec-CNC Technologies"
> Raudondvario pl. 148, Kaunas LT 47157
> Tel.: +370 684 02159
> E-paštas: [EMAIL PROTECTED]
> http://www.baltec-cnc.com
>
>
>
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Sending data from PC to Mote.

2008-05-20 Thread Razvan Musaloiu-E.

Hi!

You might find useful this TEP:
http://www.tinyos.net/tinyos-2.x/doc/html/tep113.html
and the information from here:

http://tinyos.cvs.sourceforge.net/*checkout*/tinyos/tinyos-2.x-contrib/jhu/python/README.html
The important thing is to always send Data Frames when you send from PC to 
mote. A mote will ignore a NoAck Frame.


--
Razvan ME

On Tue, 20 May 2008, Vincas Benevičius wrote:


I went through the mailing list, read TinyOS2 documentation, but couldn’t
get to the point, where everything works fine… I’m new to motes, so any help
would be very much appreciated. I need to send a message from PC to mote,
but just can’t get it right. I’m using TmoteSky platform. Mote is plugged to
USB port and recognized as serial port COM15 (I’m using FTDI USB to serial
drivers). On the PC, there is software written using C#. Everything works
fine, when I want to read information the mote is sending to serial port,
but I can’t write to it. Can anyone tell me exact packet format which is
needed to be sent to be recognized and accepted by mote? I tried various
formats according to google’d information, but neither of them worked.

On the mote side there’s:

uses interface Receive as SPReceive;
...
event *message_t SPReceive.receive(message_t* msg, void* payload, uint8_t
length) {
 Blink(0,100); //blinks red for 100ms
 return(msg);
}

SPReceive is linked like this:

#define AM_SERIAL_MSG 103
...
components SerialActiveMessageC as SP;
...
AppC.SPReceive -> SP.Receive[AM_SERIAL_MSG];

On the PC side in Visual Studio:

SerialPort SP;
byte[] packet = { };
...
SP.PortName("COM15");
SP.Open();
SP.Write(packet, 0, packet.Length);
...


No matter what packets i send, i can't get the mote to blink...
Can anyone tell exact format of the packed whick is to be sent?
Something like this:

Frame byte (0x7e)
...
Payload
CRC 2 bytes
Frame byte(0x7e)

Thank You in advance.

Su pagarba, Vincas Benevičius
UAB "Baltec-CNC Technologies"
Raudondvario pl. 148, Kaunas LT 47157
Tel.: +370 684 02159
E-paštas: [EMAIL PROTECTED]
http://www.baltec-cnc.com




___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] Matlab, Basestation, and Reading the Serial Port

2008-05-20 Thread Joey Wilson
Hello all,

I am trying to read data directly from the serial port, using Matlab and the
Basestation tinyos program.  When I use the "java net.tinyos.tools.Listen"
program, it appears that all my packet data is being received by the
basestation correctly.  However, I would like to read the data directly into
matlab.  I am attempting to use the following matlab code to read 10
packets.


s = serial('/dev/ttyUSB0','BaudRate',115200);
fopen(s);
counter = 0;
while(counter<10)
  if (s.BytesAvailable > PACKETSIZE)
packet = fread(s,PACKETSIZE)
counter = counter+1;
  end
end
*

Now, the problem that I am having is that the alignment of each packet
coming in can be different.  For example, if I know the 3rd byte is the node
ID, I try to read the 3rd byte.  This shifts around though, so I can't parse
the data consistently.  I think it is happening whenever a packet is
corrupted/dropped over the radio.  Does the basestation program do something
to compensate for corrupted packets that I am not taking into account in my
matlab code?

Is there a better way to read the serial data directly into matlab without
having these parsing issues?  Any help is appreciated.  Thanks.

-Joey
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Matlab, Basestation, and Reading the Serial Port

2008-05-20 Thread Michael Schippling
You might be having trouble with the "escape" byte
used to preface certain values. If it is used it
will add an extra byte to the stream. See all the
teps and the octavetech document that get referenced
on this list about every 3 months...

MS

Joey Wilson wrote:
> Hello all,
> 
> I am trying to read data directly from the serial port, using Matlab and 
> the Basestation tinyos program.  When I use the "java 
> net.tinyos.tools.Listen" program, it appears that all my packet data is 
> being received by the basestation correctly.  However, I would like to 
> read the data directly into matlab.  I am attempting to use the 
> following matlab code to read 10 packets.
> 
> 
> s = serial('/dev/ttyUSB0','BaudRate',115200);
> fopen(s);
> counter = 0;
> while(counter<10)
>   if (s.BytesAvailable > PACKETSIZE)
> packet = fread(s,PACKETSIZE)
> counter = counter+1;
>   end
> end
> *
> 
> Now, the problem that I am having is that the alignment of each packet 
> coming in can be different.  For example, if I know the 3rd byte is the 
> node ID, I try to read the 3rd byte.  This shifts around though, so I 
> can't parse the data consistently.  I think it is happening whenever a 
> packet is corrupted/dropped over the radio.  Does the basestation 
> program do something to compensate for corrupted packets that I am not 
> taking into account in my matlab code?
> 
> Is there a better way to read the serial data directly into matlab 
> without having these parsing issues?  Any help is appreciated.  Thanks.
> 
> -Joey
> 
> 
> 
> 
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Matlab, Basestation, and Reading the Serial Port

2008-05-20 Thread Greg Hackmann
Joey Wilson wrote:
> Now, the problem that I am having is that the alignment of each packet 
> coming in can be different.  For example, if I know the 3rd byte is the 
> node ID, I try to read the 3rd byte.  This shifts around though, so I 
> can't parse the data consistently.  I think it is happening whenever a 
> packet is corrupted/dropped over the radio.  Does the basestation 
> program do something to compensate for corrupted packets that I am not 
> taking into account in my matlab code?

TinyOS doesn't use constant-sized serial packets, which is probably 
what's causing your problem.  Even if your payloads are always the same 
type and size, the TinyOS serial stack does escaping that can add some 
bytes to the packet.

If you're using TinyOS 2.x, then TEP 113 gives pretty good documentation 
of the TinyOS serial format.

> Is there a better way to read the serial data directly into matlab 
> without having these parsing issues?  Any help is appreciated.  Thanks.

Since MATLAB has the ability to embed Java code, you could try using 
TinyOS's Java SDK.  I don't know if/how MATLAB handles callbacks from 
Java to MATLAB, but it's worth looking into at least.

Greg Hackmann
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] Order of placement of global variables in SRAM

2008-05-20 Thread Urs Hunkeler
Hi Raj,

Maybe the "nocommon" attribute might do something interesting towards 
your goal: http://www.ohse.de/uwe/articles/gcc-attributes.html

Alternatively it might be possible to declare your variables in in-line 
assembly (and then use them as externally declared variables).

Or you could declare your variables inside a struct rather than directly.

Or again, you could rearrange the variables in the generated binary by 
swapping symbols. I couldn't find any tools that would allow you to do 
this, you'd probably have to write your own tool :-)

My guess is that the compiler arranges the variables according to the 
order in which they get used (how are the functions arranged in the 
binary?) or according to size/type. Most solutions above are compiler- 
and platform-dependent. To have a somewhat cross-platform solution I 
would use the struct approach, making sure that the variables are by 
design already aligned on 16-bit word boundaries.

Why do you need a special arrangement of the variables?

Cheers,
Urs


raj raj wrote:
> Dear all,
> 
> Is there a way to force some order in the way variables (global/static) are 
> placed in .data and .bss sections ? For example, let my program has 2 
> initialized global variables g1 and g2 and 5 uninitialized global variables 
> u1,u2,u3,u4 and u5. g1 and g2 are first placed in program memory after .text 
> section and __do_copy_data copies them to the starting address in SRAM. u1 
> through u5 are not explictitly stored in program memory but __do_copy_bss 
> places them just after g1 and g2 in SRAM and zeroes them out. I want to know 
> if I can somehow specify the order of these variables, say  g1 followed by 
> g2; then u3,u4,u5,u1,u2.
> 
> I noticed that the order in which the variables are declared/defined in C 
> file or assembly file does not correspond to the way they are placed in SRAM.
> 
> Thanks in advance,
> Raj
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help