Re: [Tinyos-help] semaphore and tossim

2011-08-09 Thread Michael Schippling
Any sort of waiting is a bad idea in TOS because it is
non-pre-emptive. There is a threads implementation, of
which I know nothing, that might provide sync primitives
if you insist on doing it the way you describe.

However the pattern you probably want is fairly standard:

task1()
{
 someMessage.send()
}

someMessage.sendDone()
{
 // did it go out ok?
}

mymessage.receive()
{
 post task2();
}

task2()
{
// continue from here
}


Hopefully you can interpret my shorthand sketch
MS


ehsan enayati wrote:
> Hi, i'm doing my thesis simulations in tinyos2.1 and TOSSIM, in one of 
> my component i need to wait for an event(general concept of event not 
> the one in tinyos) to happen
> , i broadcast a packet via AMSend and i should wait till first response 
> comes back and then continue my program sth like this:
> .
> .
> AMSend.send()
> WAIT and after receiving first response continue from here
> .
> .
> .
>  
>  i wanted to use semaphore but it didn't worked in TOSSIM, please help 
> me my thesis deadline is near and i should solve this problem as soon as 
> possible.
>  
> 
> With the best regards
> *Ehsan Enayati*
> M.Sc. Student ,Information Technology
> Sharif University Of Technology
> enay...@ce.sharif.edu 
> http://ce.sharif.edu/~enayati
> 
> 
> 
> 
> ___
> 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] MultihopOscilloscope does not seem to update interval

2011-08-09 Thread G G
Hi all,

Does MultihopOscilloscope take care of messages sent from the gui over the 
serial to update sampling frequency as (Basestation + Oscilloscope) does? I do 
not see SerialActiveMessageC.Receive being connected anywhere. Am I missing 
something? Is the following setup correct?


Setup:
mote 1: MultihopOscilloscope with ID = 0, connected to mib510
mote 2,3: MultihopOscilloscope with IDs = 2,3

The README looks similar to Oscilloscope, so I thought it should have similar 
behavior (except that its using ctp).

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

[Tinyos-help] how to measure code execution time

2011-08-09 Thread Xiaohui Liu
Hi everyone,

How can I measure the time for a snippet of code (e.g., a function call
foo), either synchronous or asynchronous, to execute?
A straight forward way can be:
start_time = Call LocalTime.get();
foo();
end_time = call LocalTime.get();

(end_time - start_time) is regarded as the execution time of function call
foo(). However, asynchronous code can preempt foo() during its execution,
thus (end_time - start_time) may be overestimation of foo()'s actual
execution time.

An alternative can be something like the following:
disable interrupt;
start_time = Call LocalTime.get();
foo();
end_time = call LocalTime.get();
enable interrupt;

However, this can be problematic also if some critical interrupts (e.g.,
packet reception) occur when the interrupt is disabled. Can anyone have some
idea on how execution time can be measured without the above issues? Any
help is appreciated.

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

[Tinyos-help] avr-gcc error during 'make' - TinyOS 2.1.1, Ubuntu 9.10

2011-08-09 Thread Kushal Sarkara
Hello everyone,

I am using TinyOS 2.1.1 on Ubuntu 9.10. I am faced with the following error
when I type in the 'make' command:

*kushal@Home:/opt/tinyos-2.1.1/apps/Thesis/FiniteSampleProcessor$ make micaz
*
*mkdir -p build/micaz*
*mig java -target=micaz -DIDENT_APPNAME=\"VoltageMonitorS\"
-DIDENT_USERNAME=\"kushal\" -DIDENT_HOSTNAME=\"Home\"
-DIDENT_USERHASH=0x99f51698L -DIDENT_TIMESTAMP=0x4e421ce1L
-DIDENT_UIDHASH=0x5622b5baL -java-classname=VoltageMonitorStreamMsg
VoltageMonitorStream.h VoltageMonitorStreamMsg -o
VoltageMonitorStreamMsg.java*
*avr-gcc: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found
(required by avr-gcc)*
*failed to parse message file VoltageMonitorStream.h*
*make: *** [VoltageMonitorStreamMsg.java] Error 1*

Everything was going smoothly until a couple of hours ago when I installed
the updates for the following:

*Commit Log for Tue Aug  9 17:12:21 2011*
*
*
*Upgraded the following packages:*
*avr-binutils-tinyos (2.17-20080806) to 2.17-20110726*
*avr-gcc-tinyos (4.1.2-20080806) to 4.1.2-20110803*
*avr-libc-tinyos (1.4.7-20080806) to 1.6.7-20110726*
*avrdude-tinyos (5.4-20080806) to 5.10-20110802*

Can somebody please enlighten me as to why avr-gcc is being used to compile,
as opposed to avr-gcc-tinyos? I thought about installing avr-gcc but it
indicates that the tinyos packages will have to be removed and I am not sure
that that is the correct thing to do. Also, is there any way I can download
the GLIBC_2.11 in question? I'm trying not to uninstall and reinstall TinyOS
here, is there any other way?

Thanks in advance

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

[Tinyos-help] Problem with MSP430F261​7 and TestSeri

2011-08-09 Thread Juan Verdu
Hi,
I created a mote using a MSP430F2617 microcontroller with libraries of
MSP430X under TinyOS 2.1, which compiling with the msp430-gcc( version
3.2.3) of the mspgcc. I made several ​changes in Ubuntu and TinyOS operating
systems. This mote the program through a USB port  using BSL pins, I used
the pins VCC, GND, RST #, TCK, and RX_BSL TX_BSL (P1.1 and P2.2) of the
microcontroller. With this configuration using the tos-bsl I could program
the micro with applications like Blink which makes it the right way.
I've also tried to interrupt the execution by pressing a button and done
right. When I run the application TestSerial not done correctly, I have
another mote which made ​​by me if it does well but not the last two motes
and all hardware configuration are identical in all cases. In all the motes
I have another USB port to run the application using the pins VCC, GND,
TX_Uart0 and RX_Uart (Pins 29 and 40 of the MSP430F2617 64-pin). I have to
indicate that the mote that works well all the time I tried it with Code
Composer from Texas
so do not know if some registers like those were modified .

Using a tool like Siow (serial) I got the following results:

Mote good: 7E 45 00 FF FF 00 00 08 00 89 00 09 00 00 00 00 00 00 81 91 7E
...
Motes incorrect: FE  C5 00 FF FF 00 00 08 00 09 00 08 00 00 00 00 00 00 E0
69 FE ...

The speed with which I use is 115200 but I have also tried other speeds.

I think it's a problem of synchronizing clocks using the UART USC but  I'm
not sure, Could someone help me?

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