Re: [Tinyos-help] message structure , large buffers ?

2009-08-17 Thread Razvan Musaloiu-E.
Hi!

On Sun, 16 Aug 2009, Akankshu Dhawan wrote:

> Hi All
> I am having some problem with the message_t structure. I am creating a
> buffer size 1000 and as readStream.read(10) gets done in 0.01 sec. The
> message_t TEP has informed me that the message payload can be of size 28
> bytes. But if my buffer size is 1000 I cannot send it through this message
> structure.
> 1. Will I have to break this buffer into small packets while sending ?

Yes.

> In case I have to do this will I need multiple buffers so that I do not 
> loose out on audio signals while I am busing sending ?

Yes. The PoolC/QueueC should help in doing this.

> How long does transmission take on MICA2 motes ?

This is something I don't know. :-(

> 2. Is there any other way to transmit large buffers ?

As far as I know we don't have in tinyos a component that is doing this.

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


Re: [Tinyos-help] comunication client-serialforwarder

2009-08-17 Thread Urs Hunkeler
Hi Daniele,

Your message might not have been forwarded if you added an attachment. I
regularly have difficulties with attachments when sending a message to
this mailing list.

How do you know that the applet connects to the SerialForwarder? Did you
check for errors on the applet console? (if you don't know how to do
this, what browser do you use and which version?)

Usually, the applet runs in a special sandbox inside the browser and can
only connect to the server hosting the applet. So your SerialForwarder
would have to run on the webserver. If you use the local machine for the
webserver, the sandbox environment might make a difference between
"127.0.0.1" and the IP address of one of your network interfaces. Check
that you are using the right IP address (the same for the server and for
connecting to the serial forwarder). If you open the applet through a
file link, I don't know what happens.

Cheers,
Urs


Daniele Ricci schrieb:
> Hello dear friends.
> I have another question for you.
> I have this little-simple client(applet) that I have attacked.
> 
> It connects to serialForwarder, but can not read the package(received
> from nodes) that the server send to him.
> How I can do?
> thanks.
> 
> 
> p.s.
> I wrote this mail only to you because are hours that I try to send it
> but the service does not forward my mail to other and don't say nothing
> to me. Simply ignores them. you know why?
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] comunication client-serialforwarder

2009-08-17 Thread Urs Hunkeler
Hi Daniele,

The network connection is indeed established (I thought this might be 
the problem)! I guess that the serial forwarder protocol is a binary 
protocol and that it does not send Strings or carriage returns, so your 
code will not be able to read lines (though it could read bytes).

The best way to interact with the serial forwarder is probably to use 
the TinyOS Java libraries. You would have to include the packages that I 
recommended to you in a previous mail (also on the TinyOS help mailing 
list): comm, message, packet, and utils (maybe sf and/or tools are 
needed as well, but I don't think so).

In your applet, you could establish the connection to the serial 
forwarder with code like this:

// --

String comm = "s...@localhost:9002";
PhoenixSource ps = BuildSource.makePhoenix(comm, PrintStreamMessenger.err);
MoteIF mif = new MoteIF(ps);

// --

of course you'll have to import the appropriate packages and you need to 
include the TinyOS Java library classes into the jar file of your 
applet. If you get an error about not being able to load the native 
libraries, you'll have to modify the appropriate TinyOS library files 
and remove the corresponding "System.load(..)" lines, they are not 
really needed for this purpose.

Cheers,
Urs


Daniele Ricci wrote:
> thanks uhu!
> This is the output:
> -
> run:
> Waiting for the socket
> Socket is ready
> -
> But, can you do something for my situation?
> Even if I write only 2 lines in a message,whitout applet, it isn't sent 
> and no one says nothing to me.
> 
>  > Date: Mon, 17 Aug 2009 08:43:41 +0200
>  > From: u...@gmx.ch
>  > To: danie...@hotmail.it
>  > Subject: Re: comunication client-serialforwarder
>  >
>  > Hi Daniele,
>  >
>  > I think the most likely reason for this to not work is that the browser
>  > refuses the applet to open the network connection.
>  >
>  > To get more details from your code, could you replace the Client class
>  > with the following one (has more debugging output) and show me the 
> output?
>  >
>  >
>  > // 
>  >
>  > class client implements ActionListener {
>  > public void actionPerformed(ActionEvent e1) {
>  > try {
>  > Socket skt = new Socket("localhost",9002);
>  > BufferedReader in = new BufferedReader(new
>  > InputStreamReader(skt.getInputStream()));
>  >
>  > System.out.println("Waiting for the socket");
>  > while (!in.ready()) {}
>  > System.out.println("Socket is ready");
>  > String message = in.readLine();
>  > System.out.print("Received string1: " + message + "\n");
>  > System.out.println(in.readLine());
>  > jTextArea1.append("Server: " + message);
>  >
>  > System.out.print(messaggio + "out.print\n");
>  > in.close();
>  > }
>  > catch(Exception e) {
>  > System.out.print("Whoops! It didn't work! \n");
>  > e.printStackTrace();
>  > }
>  > }
>  >
>  > // 
>  >
>  > If you are using Firefox, the output should appear in the error console
>  > (tools -> error console).
>  >
>  > Cheers,
>  > Urs
>  >
>  >
>  > Daniele Ricci wrote:
>  > > I tried to send a different message from the original.
>  > > Without attachments and very short. This was also ignored and they 
> don't
>  > > say to me that it is stopped (stange).
>  > >
>  > > However I attack my applet to you, is very simple, it runs locally and
>  > > can connect to sf but wait messages (packets sent by the node) that
>  > > never get.
>  > > Look if you can do something.
>  > > thanks.
>  > >
>  > > ps. you can see that the file is small...
>  > >
>  > > > Date: Sun, 16 Aug 2009 20:26:07 +0200
>  > > > From: u...@gmx.ch
>  > > > To: danie...@hotmail.it; tinyos-help@millennium.berkeley.edu
>  > > > Subject: Re: comunication client-serialforwarder
>  > > >
>  > > > Hi Daniele,
>  > > >
>  > > > Your message might not have been forwarded if you added an 
> attachment. I
>  > > > regularly have difficulties with attachments when sending a 
> message to
>  > > > this mailing list.
>  > > >
>  > > > How do you know that the applet connects to the SerialForwarder? 
> Did you
>  > > > check for errors on the applet console? (if you don't know how to do
>  > > > this, what browser do you use and which version?)
>  > > >
>  > > > Usually, the applet runs in a special sandbox inside the browser 
> and can
>  > > > only connect to the server hosting the applet. So your 
> SerialForwarder
>  > > > would have to run on the webserver. If you use the local machine 
> for the
>  > > > webserver, the sandbox environment might make a difference between
>  > > > "127.0.0.1" and the IP address of one of your network interfaces. 
> Check
>  > > > that you are using the right IP address (the same for the server 
> and for
>  > > > connecting to the serial forwarder). If you open the applet through a
>  > > > file link, I don't know what happens.
>  > > >
>  > > > Cheers,
>  > > > Urs
> 
> ---

Re: [Tinyos-help] comunication client-serialforwarder

2009-08-17 Thread Urs Hunkeler
I am not sure what you mean by "put my applet into the package sf", but 
you probably should not do that.

At the beginning, you'll have to import the packages that you will need. 
E.g.:

import net.tinyos.comm.*;
import net.tinyos.packet.*;
...

Then you will have to replace the whole networking stuff (this will be 
done by the TinyOS libraries).

The first line in the code below defines the access string to the serial 
forwarder (check the mote-pc communications tutorial for details). The 
second line creates a PhoenixSource (not sure what it is exactly, but I 
think it is a low-level communication object that will then communicate 
with the serial forwarder). The third line will then create the actual 
mote interface where you will be able to register the appropriate 
listener for your packet format.

If you haven't implemented a standalone application, I strongly suggest 
that you do this first and then port this application later to an 
applet. It is much easier to debug a standalone application, plus you 
get step-by-step instructions from the TinyOS tutorials (really, read 
the mote-pc communications chapter!) and sample code.

Cheers,
Urs


Daniele Ricci wrote:
> ok.
> I have put my applet into the package sf.
> So it can seen the libreries.
> 
> what do exactly this code?
> --
> String comm = "s...@localhost:9002";
> PhoenixSource ps = BuildSource.makePhoenix(comm, PrintStreamMessenger.err);
> MoteIF mif = new MoteIF(ps);
> --
> 
> I have jast add this to print the commands?
> 
> Or should I change this?
> 
> while (!in.ready()) {}
> System.out.println("Socket is ready");
> String message = in.readLine();
> System.out.print("Received string1: " + message + "\n");
> System.out.println(in.readLine());
> 
> thanks!
> 
>  > Date: Mon, 17 Aug 2009 10:59:16 +0200
>  > From: u...@gmx.ch
>  > To: danie...@hotmail.it; tinyos-help@millennium.berkeley.edu
>  > Subject: Re: comunication client-serialforwarder
>  >
>  > Hi Daniele,
>  >
>  > The network connection is indeed established (I thought this might be
>  > the problem)! I guess that the serial forwarder protocol is a binary
>  > protocol and that it does not send Strings or carriage returns, so your
>  > code will not be able to read lines (though it could read bytes).
>  >
>  > The best way to interact with the serial forwarder is probably to use
>  > the TinyOS Java libraries. You would have to include the packages that I
>  > recommended to you in a previous mail (also on the TinyOS help mailing
>  > list): comm, message, packet, and utils (maybe sf and/or tools are
>  > needed as well, but I don't think so).
>  >
>  > In your applet, you could establish the connection to the serial
>  > forwarder with code like this:
>  >
>  > // --
>  >
>  > String comm = "s...@localhost:9002";
>  > PhoenixSource ps = BuildSource.makePhoenix(comm, 
> PrintStreamMessenger.err);
>  > MoteIF mif = new MoteIF(ps);
>  >
>  > // --
>  >
>  > of course you'll have to import the appropriate packages and you need to
>  > include the TinyOS Java library classes into the jar file of your
>  > applet. If you get an error about not being able to load the native
>  > libraries, you'll have to modify the appropriate TinyOS library files
>  > and remove the corresponding "System.load(..)" lines, they are not
>  > really needed for this purpose.
>  >
>  > Cheers,
>  > Urs
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] comunication client-serialforwarder

2009-08-17 Thread Urs Hunkeler
Hi Daniele,

The link for the mote-pc communication tutorial is:
http://docs.tinyos.net/index.php/Mote-PC_serial_communication_and_SerialForwarder

The link for a list of tutorials is:
http://docs.tinyos.net/index.php/TinyOS_Tutorials

For terminating a connection, you should do the following steps:
- ensure that nobody tries to send anything anymore
- deregister any listeners that you have previously registered: 
mif.deregisterListener(..) (mif is the MoteIF object you previously 
created; you'll have to keep a list of all listeners that you registered).
- close the low-level connection: ps.shutdown() (ps is the PhoenixSource 
object that you previously created).

Cheers,
Urs


Daniele Ricci wrote:
> It runs!
> Now, as before, remains in continuous listening that the packets arrive 
> from sf. 
> You can put the link of the tutorial please? 
> thanks
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] TOSSIM

2009-08-17 Thread sivagami amirthalingam
Hello all,
 I want to analyze the performance of the CTP protocol using the parameter like 
PRR and no. of packets forwarded by each node. 
  I am using TOSSIM simulator and 9 node grid topology. I counted no  of 
packets forwarded in the forward event of Intercept interface. The simulator 
gives different output each time it is simulated . I am not changing any of the 
parameters. But each time, it gives different count. Any one can help in this ? 
Is the simulator behaviour like this? If so, what values we can take for the 
analysis??

 Thank you.

A. Sivagami,CEG, Chennai



  See the Web's breaking stories, chosen by people like you. Check out 
Yahoo! Buzz. http://in.buzz.yahoo.com/___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] message structure , large buffers ?

2009-08-17 Thread himanshu barve
Hi . with the help of radio message_t you can send 128 bytes of data at a
time .
But out of that 128 byte ..some bytes are reserved for some extra data which
is not accessible to us.
So around 117 bytes can be sent at a time .
Initially that maximum limit is 28 as u said. You have to increase it . in
message_t and your platform specific radio chip header file. As in my case
(telosb) cc2240.h . There you will find TOSH_DATA_LENGTH . Change that field
to whatever you want below 117 bytes .
One more thing always compare length of data you are sending to maximum
limit . Which can be found from
call Send.maxPayloadLength() ;

cheers ..


>
> Date: Sun, 16 Aug 2009 21:30:25 -0400
> From: Akankshu Dhawan 
> Subject: [Tinyos-help] message structure , large buffers ?
> To: tinyos-help@millennium.berkeley.edu
> Message-ID:
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi All
> I am having some problem with the message_t structure. I am creating a
> buffer size 1000 and as readStream.read(10) gets done in 0.01 sec. The
> message_t TEP has informed me that the message payload can be of size 28
> bytes. But if my buffer size is 1000 I cannot send it through this message
> structure.
> 1. Will I have to break this buffer into small packets while sending ? In
> case I have to do this will I need multiple buffers so that I do not loose
> out on audio signals while I am busing sending ? How long does transmission
> take on MICA2 motes ?
>
>
> 2. Is there any other way to transmit large buffers ?
>
> I am looking at Anti Theft application as well since it is using ReadStream
> for the acceleration components and that has been really useful but even
> that application has used buffer size of 10 which was similar to
> Oscilloscope. 2 bytes per buffer element means I can have a maximum of 14
> elements in my buffer. Is my judgement true ?
>
>
>
> Looking forward to hearing from you.
>
>
> Thanks
> Akankshu
>
> --
> First they ignore you, then they laugh at you, then they fight you, then
> you
> win.
> - Mahatma Gandhi
> -- next part --
> An HTML attachment was scrubbed...
> URL:
> https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090816/ae77124a/attachment-0001.htm
>
> --
>


-- 
With Best Regards
Himanshu Barve
M.Tech Electrical Engineering (Power System)
IIT Kharagpur , West Bengal , India
Ph: - +91 9775201181
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] Question in use setGroup

2009-08-17 Thread Matteo Dany
Hi all,

I have a doubt use the function setGroup. I have two tmotes one send
message and other receive.
The mote sender modify the id group with the function setGroup( &msg,
10 ) and the receiver read the gid with the function group(msg), but
surprise the value of gid is different.

If setup the message with gid 10, when the receiver extract the gid,
the value is 0x22. If change 10 with another number the receiver
always return 0x22.

I don't know why.


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


[Tinyos-help] TOSSIM: How long should runNextEvent() take ?

2009-08-17 Thread David
Hi,

I'm trying to simulate something with tossim and I'm wondering how  
long a runNextEvent() call should take. When I call runNextEvent()  
from within Python the processor usage shoots up to about 100% and  
nothing happens untill I kill the Python process. Since I thought this  
might be Python specific I tried the simulation, which is simply  
creating the node and running runNextEvent(),  in C++ and had the same  
result. I expected my dbg messages from my nesc programm to pop up one  
after the other in short order but it seems that the node does not  
even boot up. Is this normal? Shouldn't runNextEvent() return rather  
quickly?

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


[Tinyos-help] Deluge T2 on Iris (Mac OS X): ERROR: Unable to retrieve the ident.

2009-08-17 Thread Urs Hunkeler
Hi,

I managed to get almost everything running for Deluge T2 on the Mac. I 
have the impression that the Deluge communication does not properly 
work. I use the mib520 programming board and I did check that I use the 
right port for the communication (ie. the port ending in a 'B' is the 
comm port, while the port ending in a 'A' is the programming port).

I get similar errors when trying to run the 'burn' script and when 
trying to ping a basestation mote (which I installed the conventional 
way with the 'make install' procedure). The mote is blinking and the 
output for the ping is for instance:

$ tos-deluge /dev/tty.usbserial-XBPWO5PZB iris -p 0
Flushing the serial port..
Checking if node is a Deluge T2 base station ...
Pinging node ...
--
Currently Executing:
   Prog Name:   BasestationAppC
   UID: 0x44140DED
   Compiled On: Mon Aug 17 16:39:36 2009
   Node ID: 0

ERROR: Unable to retrieve the ident.
--


Any ideas what might be wrong?

Cheers,
Urs

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


[Tinyos-help] Wireless Sensor Network to collect soil moisture data

2009-08-17 Thread Gary Lee
Hi,



Could someone let me know the current status of applying wireless sensor
networks to collect soil moisture data?



We have the following requirement:



Hardware: MicaZ/IRIS or some other motes from Xbow;

Softeware: we need open source softeware – TinyOS.



Any information is highly appreciated.



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

Re: [Tinyos-help] Count transmission/retransmission using TOSSIM (gdb)

2009-08-17 Thread Rémi Villé
2009/8/17 Razvan Musaloiu-E. 

> Hi!
>
>
> On Wed, 12 Aug 2009, Rémi Villé wrote:
>
>  2009/8/12 Omprakash Gnawali 
>>
>>  On Tue, Aug 11, 2009 at 9:31 AM, Rémi Villé wrote:
>>>
 2009/8/11 Rémi Villé 

>
> 2009/8/10 Omprakash Gnawali 
>
>>
>> On Mon, Aug 10, 2009 at 7:14 AM, Rémi Villé>
>> wrote:
>>
>>> 2009/8/6 Rémi Villé 
>>>

 2009/8/6 Rémi Villé 

>
> Hi,
>
> I would like to count the number of transmissions/retransmissions
> during
> a simulation with TOSSIM.
> For now, I only need to write this count on stdout using gdb(), but
> I
> dont know where is the ideal place to add it, I would like to
> estimate the
> number of (re)transmissions with as much accuracy as possible.
>
> Thanks,
>
> Rémi
>

 It's dbg().

>>>
>>> I must do that because I have modified the CtpRoutingEngine to use
>>> node to
>>> node similarity, and if I count the number of transmission using only
>>> Send.sendDone (of CollectionC.CollectionSenderC), I have not the
>>> total
>>> number of retransmission/retransmission...
>>>
>>
>> You can put your debug statements in the AM layer.
>>
>> - om_p
>>
>
> I didn't find exactly where to put the dbg statement in the AM layer
> yet,
> but maybe it would be a better idea to measure the data throughput
> (packets
> per second delivered) in the java application, it may be equivalent and
> costless for nodes in a future real deployment test.
>

 I think the good place to put the dbg statement is in "event void
 Model.sendDone(message_t* msg, error_t result){...}" in  the
 tos/lib/tossim/TossimActiveMessageC.nc file, but I'm not sure it
 includes
 Ack and re-transmissions...


>>> CTP retransmissions are done using the AM layer: each retransmission
>>> is a new packet as far as the AM layer is concerned. As long as you
>>> instrument the AM layer, you should catch all the retransmissions.
>>>
>>> - om_p
>>>
>>>
>> Thanks for your help, I think I can distinguish ack and other transmission
>> thanks to
>> tossim_metadata_t* metadata = getMetadata(msg);
>> and
>> metadata->ack != 0
>>
>>
> You can take a look in the TossimPacketModelC.nc to see how the ack field
> is used. It's set to TRUE when the .requestAck is called and then is
> returned as the answer for the .wasAcked. The model is suppose to set it to
> FALSE if the packet did not get to the destination.
>
> So, to make thinks clearer: there is ack packet in TOSSIM. The
> PacketAcknowlegements interface is simulated just by tracking in a variable
> (the ack from metadata) if the packet got it to the other end or not.
>
>  It's not a crucial question for me now, but is there a parameter in
>> tossim_metadata_t, tossim_header_t or tossim_footer_t which can allow me
>> to
>> distinguish transmissions and re-transmissions?
>>
>>
> The re-transmissions in CTP are application layer re-transmissions. Said
> differently, CTP doesn't use the PacketLink interface that can automatically
> retransmit the packet up a certain number of times. So I think you should
> probably instrument the CtpRoutingEngineP.nc to print at each send something
> informations about the packet that will allow you to know when the same
> packet is sent. There might be already some dbg statements that do this
> already there. :-)
>
> Note: I presume you are not using the CC2420sim.
>
> All the best!
> Razvan ME


You can take a look in the TossimPacketModelC.nc to see how the ack field is
> used. It's set to TRUE when the .requestAck is called and then is returned
> as the answer for the .wasAcked. The model is suppose to set it to FALSE if
> the packet did not get to the destination.
>
> So, to make thinks clearer: there is ack packet in TOSSIM. The
> PacketAcknowlegements interface is simulated just by tracking in a variable
> (the ack from metadata) if the packet got it to the other end or not.
>

So ack field sets to FALSE is just a tool for TOSSIM to know if a packet got
to the destination? but shouldn't be take in consideration in a total number
of transmissions if we want this count to be more realistic as possible?
Because in real mode, there's no way for a mote to know if a message that it
should receive hasn't be received (it surely must be done by the sender with
a time-out).

So when ack is TRUE it means that the sender waits for this message to be
acked, but it's not an ack? So if the sink never sets ack to TRUE it means
that it never requests its messages to be acked?

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

Re: [Tinyos-help] Deluge T2 on Iris (Mac OS X): ERROR: Unable to retrieve the ident.

2009-08-17 Thread Razvan Musaloiu-E.
Hi!

On Mon, 17 Aug 2009, Urs Hunkeler wrote:

> Hi,
>
> I managed to get almost everything running for Deluge T2 on the Mac. I
> have the impression that the Deluge communication does not properly
> work. I use the mib520 programming board and I did check that I use the
> right port for the communication (ie. the port ending in a 'B' is the
> comm port, while the port ending in a 'A' is the programming port).
>
> I get similar errors when trying to run the 'burn' script and when
> trying to ping a basestation mote (which I installed the conventional
> way with the 'make install' procedure). The mote is blinking and the
> output for the ping is for instance:
>
> $ tos-deluge /dev/tty.usbserial-XBPWO5PZB iris -p 0
> Flushing the serial port..
> Checking if node is a Deluge T2 base station ...
> Pinging node ...
> --
> Currently Executing:
>   Prog Name:   BasestationAppC
>   UID: 0x44140DED
>   Compiled On: Mon Aug 17 16:39:36 2009
>   Node ID: 0
>
> ERROR: Unable to retrieve the ident.
> --
>
>
> Any ideas what might be wrong?
>

Can you please try the latest CVS version? The new tos.py is using the 
ser...@... syntax and it should work fine in Mac OS. Make sure you 
recompile the tools in order to get the new tos-deluge. :-)

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


Re: [Tinyos-help] Help- Rssi and field group id

2009-08-17 Thread Miguel Torres
Hi Matteo Dany,

You only need to make this. For CC2420 and RF230.

#if defined(PLATFORM_TELOSB) || defined(PLATFORM_TMOTE)
  int16_t getRssi(message_t *msg){
int16_t rssi_raw = (int16_t) call CC2420Packet.getRssi(msg);
if (rssi_raw > 0x80)
  rssi_raw = rssi_raw - 256 - 45;
else
  rssi_raw = rssi_raw - 45;
return (int16_t) rssi_raw;
  }
#elif defined(PLATFORM_IRIS)
  int16_t getRssi(message_t *msg){
if(call PacketField.isSet(msg))
  return (int16_t) call PacketField.get(msg);
else
  return 0x;
  }
#else
  #error Radio chip not supported! Currently only works for motes with
CC2420 or RF230 radios.
#endif

Best regards,
Miguel Silva

-- Mensagem reencaminhada --
From: Mehmet Akif Antepli 
To: Matteo Dany 
Date: Sun, 16 Aug 2009 02:50:11 -0700
Subject: Re: [Tinyos-help] Help- Rssi and field group id
Yes, that's correct.

On Sun, Aug 16, 2009 at 2:43 AM, Matteo Dany  wrote:

Thanks,

I should understand, I read the rssi from a serial packet  with an
program write in C.
I put the rssi in a char and subtract -45.
It's right?

Thanks

2009/8/16 Mehmet Akif Antepli :
> Hi Matteo,
> You should interpret rssi reading as signed 8 bit value in 2's complement
> form.
> (From Page 64 of 87: CC2420 datasheet)
> "RSSI (0x13) - RSSI and CCA Status and Control Register" part
> On Sun, Aug 16, 2009 at 1:09 AM, Matteo Dany
 wrote:
>>
>> Hi guys,
>>
>> I have a tmote sky and I search to read a Rssi, but I have little
>> problem with convert Rssi .
>> I read correctly the Rssi from radio message and the value appears in
>> a range  0, 255. But how convert the value in dbm?
>> I search in google and I read the CC2420 datasheet, they suggest to
>> subtract -45 to the value found.
>> When I found 255 - 45 = 210 dbm? I read in the datasheet that the
>> range is from 0 to -100 dbm.
>> Where I wrong?
>>
>>
>> Thank you very much
>>
>> Matt
>> ___
>> Tinyos-help mailing list
>> Tinyos-help@millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>
>
> --
> Mehmet Akif Antepli
> Grad. Student
> Dept. of EEE
> Middle East Technical University
>

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


Re: [Tinyos-help] TOSSIM: How long should runNextEvent() take ?

2009-08-17 Thread David
My fault, had a neverending loop in the code. Sorry.

Am 17.08.2009 um 16:34 schrieb David:

> Hi,
>
> I'm trying to simulate something with tossim and I'm wondering how
> long a runNextEvent() call should take. When I call runNextEvent()
> from within Python the processor usage shoots up to about 100% and
> nothing happens untill I kill the Python process. Since I thought this
> might be Python specific I tried the simulation, which is simply
> creating the node and running runNextEvent(),  in C++ and had the same
> result. I expected my dbg messages from my nesc programm to pop up one
> after the other in short order but it seems that the node does not
> even boot up. Is this normal? Shouldn't runNextEvent() return rather
> quickly?
>
> David.
> ___
> 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] Help- Rssi and field group id

2009-08-17 Thread Miguel Torres
Yes, I now,
If you check this test applications:
apps/tests/cc2420/RssiToSerial/
apps/tutorials/RssiDemo/

The raw value is a 8 bit in fact.
But when you try to convert it, you get an value with 8 bits with
signal. Then you need one more bit, so we use 16bit.
That why I and everybody use a cast to 16bit, this way never lose data.

You still can translate the rssi outside the node's code. It's up to you.

Miguel Silva

2009/8/17 Matteo Dany :
> Ok, you translate the rssi inside the program installed on mote.
>
> But, why you cast a 16 bit the rssi? The function getRssi return a 8
> bit with platform tmote.
>
> Thanks
>
> 2009/8/17 Miguel Torres :
>> Hi Matteo Dany,
>>
>> You only need to make this. For CC2420 and RF230.
>>
>> #if defined(PLATFORM_TELOSB) || defined(PLATFORM_TMOTE)
>>  int16_t getRssi(message_t *msg){
>>    int16_t rssi_raw = (int16_t) call CC2420Packet.getRssi(msg);
>>    if (rssi_raw > 0x80)
>>      rssi_raw = rssi_raw - 256 - 45;
>>    else
>>      rssi_raw = rssi_raw - 45;
>>    return (int16_t) rssi_raw;
>>  }
>> #elif defined(PLATFORM_IRIS)
>>  int16_t getRssi(message_t *msg){
>>    if(call PacketField.isSet(msg))
>>      return (int16_t) call PacketField.get(msg);
>>    else
>>      return 0x;
>>  }
>> #else
>>  #error Radio chip not supported! Currently only works for motes with
>> CC2420 or RF230 radios.
>> #endif
>>
>> Best regards,
>> Miguel Silva
>>
>> -- Mensagem reencaminhada --
>> From: Mehmet Akif Antepli 
>> To: Matteo Dany 
>> Date: Sun, 16 Aug 2009 02:50:11 -0700
>> Subject: Re: [Tinyos-help] Help- Rssi and field group id
>> Yes, that's correct.
>>
>> On Sun, Aug 16, 2009 at 2:43 AM, Matteo Dany  wrote:
>>
>>    Thanks,
>>
>>    I should understand, I read the rssi from a serial packet  with an
>>    program write in C.
>>    I put the rssi in a char and subtract -45.
>>    It's right?
>>
>>    Thanks
>>
>>    2009/8/16 Mehmet Akif Antepli :
>>    > Hi Matteo,
>>    > You should interpret rssi reading as signed 8 bit value in 2's 
>> complement
>>    > form.
>>    > (From Page 64 of 87: CC2420 datasheet)
>>    > "RSSI (0x13) - RSSI and CCA Status and Control Register" part
>>    > On Sun, Aug 16, 2009 at 1:09 AM, Matteo Dany
>>  wrote:
>>    >>
>>    >> Hi guys,
>>    >>
>>    >> I have a tmote sky and I search to read a Rssi, but I have little
>>    >> problem with convert Rssi .
>>    >> I read correctly the Rssi from radio message and the value appears in
>>    >> a range  0, 255. But how convert the value in dbm?
>>    >> I search in google and I read the CC2420 datasheet, they suggest to
>>    >> subtract -45 to the value found.
>>    >> When I found 255 - 45 = 210 dbm? I read in the datasheet that the
>>    >> range is from 0 to -100 dbm.
>>    >> Where I wrong?
>>    >>
>>    >>
>>    >> Thank you very much
>>    >>
>>    >> Matt
>>    >> ___
>>    >> Tinyos-help mailing list
>>    >> Tinyos-help@millennium.berkeley.edu
>>    >> 
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>    >
>>    >
>>    >
>>    > --
>>    > Mehmet Akif Antepli
>>    > Grad. Student
>>    > Dept. of EEE
>>    > Middle East Technical University
>>    >
>>
>> --
>> Miguel Torres Silva
>>
>



-- 
Miguel Torres Silva

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


Re: [Tinyos-help] Count transmission/retransmission using TOSSIM (gdb)

2009-08-17 Thread Razvan Musaloiu-E.

Hi!

On Mon, 17 Aug 2009, Rémi Villé wrote:


2009/8/17 Razvan Musaloiu-E. 


Hi!


On Wed, 12 Aug 2009, Rémi Villé wrote:

 2009/8/12 Omprakash Gnawali 


 On Tue, Aug 11, 2009 at 9:31 AM, Rémi Villé wrote:



2009/8/11 Rémi Villé 



2009/8/10 Omprakash Gnawali 



On Mon, Aug 10, 2009 at 7:14 AM, Rémi Villé>
wrote:


2009/8/6 Rémi Villé 



2009/8/6 Rémi Villé 



Hi,

I would like to count the number of transmissions/retransmissions during
a simulation with TOSSIM.
For now, I only need to write this count on stdout using gdb(), but I
dont know where is the ideal place to add it, I would like to estimate the
number of (re)transmissions with as much accuracy as possible.

Thanks,

Rémi



It's dbg().



I must do that because I have modified the CtpRoutingEngine to use node to
node similarity, and if I count the number of transmission using only
Send.sendDone (of CollectionC.CollectionSenderC), I have not the total
number of retransmission/retransmission...



You can put your debug statements in the AM layer.

- om_p



I didn't find exactly where to put the dbg statement in the AM layer yet,
but maybe it would be a better idea to measure the data throughput (packets
per second delivered) in the java application, it may be equivalent and
costless for nodes in a future real deployment test.



I think the good place to put the dbg statement is in "event void
Model.sendDone(message_t* msg, error_t result){...}" in  the
tos/lib/tossim/TossimActiveMessageC.nc file, but I'm not sure it includes
Ack and re-transmissions...



CTP retransmissions are done using the AM layer: each retransmission
is a new packet as far as the AM layer is concerned. As long as you
instrument the AM layer, you should catch all the retransmissions.

- om_p



Thanks for your help, I think I can distinguish ack and other transmission 
thanks to
tossim_metadata_t* metadata = getMetadata(msg);
and
metadata->ack != 0



You can take a look in the TossimPacketModelC.nc to see how the ack field
is used. It's set to TRUE when the .requestAck is called and then is
returned as the answer for the .wasAcked. The model is suppose to set it to
FALSE if the packet did not get to the destination.

So, to make thinks clearer: there is ack packet in TOSSIM. The
PacketAcknowlegements interface is simulated just by tracking in a variable
(the ack from metadata) if the packet got it to the other end or not.

 It's not a crucial question for me now, but is there a parameter in

tossim_metadata_t, tossim_header_t or tossim_footer_t which can allow me to
distinguish transmissions and re-transmissions?



The re-transmissions in CTP are application layer re-transmissions. Said
differently, CTP doesn't use the PacketLink interface that can automatically
retransmit the packet up a certain number of times. So I think you should
probably instrument the CtpRoutingEngineP.nc to print at each send something
informations about the packet that will allow you to know when the same
packet is sent. There might be already some dbg statements that do this
already there. :-)

Note: I presume you are not using the CC2420sim.

All the best!
Razvan ME




You can take a look in the TossimPacketModelC.nc to see how the ack field is
used. It's set to TRUE when the .requestAck is called and then is returned
as the answer for the .wasAcked. The model is suppose to set it to FALSE if
the packet did not get to the destination.

So, to make things clearer: there is ack packet in TOSSIM. The
PacketAcknowlegements interface is simulated just by tracking in a variable
(the ack from metadata) if the packet got it to the other end or not.



So ack field sets to FALSE is just a tool for TOSSIM to know if a packet got
to the destination?


Yes.


but shouldn't be take in consideration in a total number
of transmissions if we want this count to be more realistic as possible?


True.


Because in real mode, there's no way for a mote to know if a message that it
should receive hasn't be received (it surely must be done by the sender with
a time-out).


The best place to count the lost acks might be this function from 
CpmModelC.nc:


   171void sim_gain_ack_handle(sim_event_t* evt)  {
   172  // Four conditions must hold for an ack to be issued:
   173  // 1) Transmitter is still sending a packet (i.e., not cancelled)
   174  // 2) The packet requested an acknowledgment
   175  // 3) The transmitter is on
   176  // 4) The packet passes the SNR/ARR curve
   177  if (requestAck && // This
   178  outgoing != NULL &&
   179  sim_mote_is_on(sim_node())) {
   180receive_message_t* rcv = (receive_message_t*)evt->data;
   181double power = rcv->reversePower;
   182double noise = packetNoise(rcv);
   183double snr = power - noise;
   184if (shouldAckReceive(snr)) {
   185  signal Model.acked(outgoing);
   186}
   187  }
   188  free_receive_message((receive_message_t*)evt->data);
   189  

[Tinyos-help] Compilation error

2009-08-17 Thread Daniel Souza Coelho
Hi friends

I started to learn Nesc now and I'm trying to compile a NesC aplication with
the following configuration file:


*includes sensorboard;

configuration **app**{
}
implementation {
  components Main, IntToLeds, IntToRfm,  appM,  TimerC, PhotoTemp, LedsC;

  Main.StdControl -> appM;
  Main.StdControl -> IntToLeds.StdControl;
  Main.StdControl -> IntToRfm.StdControl;
  Main.StdControl -> TimerC.StdControl;

 appM.ADC -> PhotoTemp.ExternalTempADC;
  appM.Timer -> TimerC.Timer[unique("Timer")];
  appM.IntOutput -> IntToRfm;
  appM.IntOutput -> IntToLeds;
 appM.Leds -> LedsC;

}*

But when I try to compile and put it in the mote I get this error mensage:

  nnn.nc:6: component IntToLeds not found
C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLInit.nc:51: expected
com
ponent `IntToLeds', but got component 'HPLInit'
nnn.nc:6: component IntToRfm not found
C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/avrmote/HPLInit.nc:51: expected
com
ponent `IntToRfm', but got component 'HPLInit'

I've tried a lot of things but this error always come. The code seens to be
correct, I have another example app which is almost the same thing and it
works.

Could anybody help me?? it's very important.

Thanks

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

Re: [Tinyos-help] Wireless Sensor Network to collect soil moisture data

2009-08-17 Thread Giri Baleri
Hi Gary,

Your best bet would be to use Crossbow' eKo Pro series system, which
provides out of the box solution for outdoor soil moisture monitoring.
You can find further details from the datasheet below.
http://www.xbow.com/Eko/pdf/eKo_pro_series_Datasheet.pdf

Feel free to contact me if you need further details.

Regards,
Giri


-Original Message-
From: "Gary Lee" 
To: tinyos-help@millennium.berkeley.edu
Sent: 8/17/09 8:28 AM
Subject: [Tinyos-help] Wireless Sensor Network to collect soil moisture
data

Hi,



Could someone let me know the current status of applying wireless sensor
networks to collect soil moisture data?



We have the following requirement:



Hardware: MicaZ/IRIS or some other motes from Xbow;

Softeware: we need open source softeware - TinyOS.





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


[Tinyos-help] comunication client (applet) to serialforwarder

2009-08-17 Thread Daniele Ricci

Hi.I have this little-simple client(applet) that I have 
attacked.--class client 
implements ActionListener {public void actionPerformed(ActionEvent e1) {try {
String comm = "s...@localhost:9002";PhoenixSource ps = 
BuildSource.makePhoenix(comm, PrintStreamMessenger.err);MoteIF mif = new 
MoteIF(ps);
Socket skt = new Socket("localhost",9002);BufferedReader in = new 
BufferedReader(newInputStreamReader(skt.getInputStream()));
System.out.println("Waiting for the socket");while (!in.ready()) 
{}System.out.println("Socket is ready");String message = 
in.readLine();System.out.print("Received string1: " + message + 
"\n");System.out.println(in.readLine());jTextArea1.append("Server: " + message);
System.out.print(message + "out.print\n");in.close();}catch(Exception e) 
{System.out.print("Whoops! It didn't work! \n");e.printStackTrace();  } 
}}---
It connects to serialForwarder, but it is waiting for messages  that the server 
(serialForwarder) sends to him.How I can do to have this messages 
(packets)?thanks
_
Porta Messenger in Vacanza! Scaricalo sul cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-messenger/default.aspx
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] errata corrige client-serialForwarder

2009-08-17 Thread Daniele Ricci

Hi.I have this little-simple client(applet) that I have 
attacked.--class client 
implements ActionListener {public void actionPerformed(ActionEvent e1) {try {
String comm = "s...@localhost:9002";PhoenixSource ps = 
BuildSource.makePhoenix(comm, PrintStreamMessenger.err);MoteIF mif = new 
MoteIF(ps);

Socket skt = new Socket("localhost",9002);BufferedReader in = new 
BufferedReader(newInputStreamReader(skt.getInputStream()));
System.out.println("Waiting for the socket");while (!in.ready()) 
{}System.out.println("Socket is ready");String message = 
in.readLine();System.out.print("Received string1: " + message + 
"\n");System.out.println(in.readLine());jTextArea1.append("Server: " + message);
System.out.print(message + "out.print\n");in.close();}catch(Exception e) 
{System.out.print("Whoops! It didn't work! \n");e.printStackTrace();} 
}}---
It connects to serialForwarder, but it is waiting for messages that the server 
(serialForwarder) sends to him.How I can do to have this messages 
(packets)?thanks
_
Porta Hotmail in vacanza. Leggi la posta dal cellulare!
http://new.windowslivemobile.msn.com/IT-IT/windows-live-hotmail/default.aspx___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Re : iris mote shematics?

2009-08-17 Thread shauqee

how we configure the gpio line to be an interrupt in the software.could you
release to me a sample.


Giri Baleri wrote:
> 
> Any GPIO line can be configured as an interrupt line in the software.
> INT1-4 can be used for your application (as long as you are not using them
> for any sensor power control).
> 
>  
> 
> Giri
> 
>  
> 
> 
> 
> From: ivi610 [mailto:ivi...@yahoo.fr] 
> Sent: Thursday, December 04, 2008 2:03 AM
> To: Giri Baleri
> Cc: tinyos help
> Subject: Re : [Tinyos-help] iris mote shematics?
> 
>  
> 
> Hello
> thanks, the connector schematics should be enough do develop a dedicated
> sensorboard.
> However, it seems Crossbow sells OEM IRIS hardware, so isn't there some
> datasheet associated?
> Furthermore, in the connector shematics, it is written that INT[1-4] are
> GPIO. Isn't there any interrupt line as  i need some?
> Thank you for the help
> Best Regards
> 
>  
> 
> Cyril
> 
>  
> 
>  
> 
> 
> 
> De : Giri Baleri 
> À : ivi610 
> Cc : tinyos help 
> Envoyé le : Mercredi, 3 Décembre 2008, 17h14mn 51s
> Objet : RE: [Tinyos-help] iris mote shematics?
> 
> Hello Cyril,
> 
>  
> 
> The schematic for the IRIS Mote is considered proprietary and not public
> yet. Whatever is in the MPR-MIB manual is all that can be disclosed at
> this time.
> 
> http://www.xbow.com/Support/Support_pdf_files/MPR-MIB_Series_Users_Manual.pdf
> 
>  
> 
> The hardware schematics in the public domain are available here.
> 
> http://www.tinyos.net/scoop/special/hardware
> 
>  
> 
> Giri
> 
>  
> 
> 
> 
> From: tinyos-help-boun...@millennium.berkeley.edu
> [mailto:tinyos-help-boun...@millennium.berkeley.edu] On Behalf Of ivi610
> Sent: Wednesday, December 03, 2008 2:01 AM
> To: tinyos help
> Subject: [Tinyos-help] iris mote shematics?
> 
>  
> 
> Hello,
> where could i find the hardware schematics of IRIS Mote and if possible of
> other motes supported by TinyOs?
> I would like to develop a dedicated sensorboard for it.
> Thanks for the help.
> 
>  
> 
> Cyril
> 
>  
> 
>  
> 
>  
> 
> 
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 

-- 
View this message in context: 
http://www.nabble.com/iris-mote-shematics--tp20810035p25000710.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.


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

[Tinyos-help] SerialForwarder

2009-08-17 Thread Nicky
Hi,

I'm having trouble running the SerialForwarder...
I'm trying to run it on a crossbow stargate, a memory limited device.
So limited I can't install TinyOS!

I installed TinyOS on my ubuntu desktop and copied over the libraries
(libgetenv.so and libtoscomm.so)
to the appropriate runtime path on the stargate...

However the System.loadLibrary("toscomm"); method fails even though its
looking in the right place.
And also System.load("path to library"); also fails.

Any help with this would be greatly appreciated!
-- 
Regards
Nick
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] message payload length for Iris

2009-08-17 Thread Miklos Maroti
Hi Akankshu,

The maximum is 127 bytes, limited by hardware, but this number also
includes the 13 bytes of ieee 802.15.4 header and the 1 byte 6lowpan
network byte (unless you use tframes). So the maximum payload length
is 113 bytes.

Miklos

On 8/18/09, Akankshu Dhawan  wrote:
> Dear Miklos
> I wanted to know what is the maximum data length for iris motes? I was using
> MICA2 motes earlier but they had message length of 28 bytes which could be
> extended to 100 somehting bytes which I found to be suitable.
>
> But I want to know what is the similar maximum for iris motes ? Also, can I
> change that ?
> I want to send a buffer of 200 elements.
>
> Please let me know if this will be possible ?
>
> I look forward to hearing from you.
>
> Regards
> Akankshu Dhawan
>
> --
> First they ignore you, then they laugh at you, then they fight you, then you
> win.
> - Mahatma Gandhi
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help