[Tinyos-help] About the length of the fields in message_t

2011-07-18 Thread
In http://www.tinyos.net/tinyos-2.x/doc/html/tep111.html , it says The
CC2420 header is 11 bytes long.
But I print the length of each field of message_t with dbg() in tossim,
%d %d %d %d %d
\n,sizeof(message_t),sizeof(message_header_t),TOSH_DATA_LENGTH,sizeof(message_footer_t),sizeof(message_metadata_t)
I got the following result:
41 7 28 2 4

Why the header length is 7, and why the footer length is 2 while the doc
says that cc2420 don't have a footer?
-- 
Regards,
Xiaozong Cui
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] About the length of the fields in message_t

2011-07-18 Thread
I got the reason, the tossim message type is not the same with the cc2420
message type,
but I still have a question:

the doc  http://www.tinyos.net/tinyos-2.x/doc/html/tep111.html says the
CC2420 has 7 bytes in meta, but the definition of cc2420_metadata_t is like
this,
typedef nx_struct cc2420_metadata_t {
  nx_uint8_t rssi;
  nx_uint8_t lqi;
  nx_uint8_t tx_power;
  nx_bool crc;
  nx_bool ack;
  nx_bool timesync;
  nx_uint32_t timestamp;
  nx_uint16_t rxInterval;

  /** Packet Link Metadata */
#ifdef PACKET_LINK
  nx_uint16_t maxRetries;
  nx_uint16_t retryDelay;
#endif
} cc2420_metadata_t;

It seems not 7 bytes.

2011/7/18 崔晓宗 cpp...@gmail.com

 In http://www.tinyos.net/tinyos-2.x/doc/html/tep111.html , it says The
 CC2420 header is 11 bytes long.
 But I print the length of each field of message_t with dbg() in tossim,
 %d %d %d %d %d
 \n,sizeof(message_t),sizeof(message_header_t),TOSH_DATA_LENGTH,sizeof(message_footer_t),sizeof(message_metadata_t)
 I got the following result:
 41 7 28 2 4

 Why the header length is 7, and why the footer length is 2 while the doc
 says that cc2420 don't have a footer?
 --
 Regards,
 Xiaozong Cui




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

Re: [Tinyos-help] micaz voltage increasing when battery droop

2011-05-24 Thread
Battery Voltage. The returned value represents the difference
 * between the battery voltage and V_BG (1.23V). The formula to convert
 * it to mV is: 1223 * 1024 / value.


2011/5/25 Michael Schippling sc...@santafe.edu

 As I understand it, the mica platforms measure battery voltage
 by taking a reading from a fixed 1.23v chip. Since the ADC
 reference (full-scale-value) _is_ the battery itself, the
 reading from the chip will _increase_ as the battery droops.

 You may be seeing this effect, but I thought the Voltage
 components for each platform handled this in their read
 methods and also converted the result to milli-volts.

 MS

 srsini srsini wrote:
  Hello,
  i try to compute the remaining power in the battry in micaz !! but each
  time i do the test i find that the power is increasing . that's strange
  , i don't understand the matter. PLZ any idea could help.
  i use this
 
  #
   */
  module VoltageP
  {
provides interface Atm128AdcConfig;
  }
  implementation
  {
async command uint8_t Atm128AdcConfig.getChannel()
{
  // select the 1.23V (V_BG). Reference: Table 97, page 244 from the
  Atmega128
  return ATM128_ADC_SNGL_1_23;
}
 
async command uint8_t Atm128AdcConfig.getRefVoltage()
{
  return ATM128_ADC_VREF_OFF;
}
 
async command uint8_t Atm128AdcConfig.getPrescaler()
{
  return ATM128_ADC_PRESCALE;
}
  }
  #
 
  Bye
 
 
  
 
  ___
  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




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

[Tinyos-help] About ctp_routing_header_t* getHeader(message_t* ONE m)

2011-05-19 Thread
ctp_routing_header_t* getHeader(message_t* ONE m) {
  return (ctp_routing_header_t*)call BeaconSend.getPayload(m, call
BeaconSend.maxPayloadLength());
 }

The code above is from Collection Tree Protocol.
What does the 'ONE' mean? Can anyone explain the parameter ( message_t* ONE
m ) for me? Thanks.

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

[Tinyos-help] About nx_uint8_t (COUNT(0) data)[0]

2011-05-04 Thread
In tos/lib/net/Ctp.h , there is a struct

typedef nx_struct {
  nx_ctp_options_toptions;
  nx_am_addr_tparent;
  nx_uint16_t etx;
  nx_uint8_t (COUNT(0) data)[0]; // Deputy place-holder, field will probably
be removed when we Deputize Ctp
} ctp_routing_header_t;

I am puzzled  by nx_uint8_t (COUNT(0) data)[0], what is COUNT(0) used for?
-- 
Regards,
Xiaozong Cui
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] make micaz sim error

2011-04-20 Thread
I complie Blink and the following error happened. But I compile BaseStation,
it worked very good.
My platform is Ubuntu 9.10 , tinyos 2.1.1, with python 2.6.5


Blink$ make micaz sim

mkdir -p simbuild/micaz
  placing object files in simbuild/micaz
  writing XML schema to app.xml
  compiling BlinkAppC to object file sim.o
ncc -c -shared -fPIC -o simbuild/micaz/sim.o -g -O0 -tossim
-fnesc-nido-tosnodes=1000 -fnesc-simulate
-fnesc-nido-motenumber=sim_node\(\) -fnesc-gcc=gcc -Wall -Wshadow -Wnesc-all
-target=micaz -fnesc-cfile=simbuild/micaz/app.c -board=micasb
-DDEFINED_TOS_AM_GROUP=0x22 --param max-inline-insns-single=10
-DIDENT_APPNAME=\BlinkAppC\ -DIDENT_USERNAME=\cui2\
-DIDENT_HOSTNAME=\cui2-desktop\ -DIDENT_USERHASH=0xd75161f8L
-DIDENT_TIMESTAMP=0x4daec4b9L -DIDENT_UIDHASH=0x8b84c72aL
-Wno-nesc-data-race BlinkAppC.nc   -fnesc-dump=components
-fnesc-dump=variables -fnesc-dump=constants -fnesc-dump=typedefs
-fnesc-dump=interfacedefs -fnesc-dump=tags -fnesc-dumpfile=app.xml
In component `TossimPacketModelC':
/opt/tinyos-2.1.1/tos/lib/tossim/TossimPacketModelC.nc: In function
`startDoneTask.runTask':
/opt/tinyos-2.1.1/tos/lib/tossim/TossimPacketModelC.nc:98: Control.startDone
not connected
/opt/tinyos-2.1.1/tos/lib/tossim/TossimPacketModelC.nc: In function
`stopDoneTask.runTask':
/opt/tinyos-2.1.1/tos/lib/tossim/TossimPacketModelC.nc:103: Control.stopDone
not connected
make: *** [sim-exe] error 1


-- 
Regards,
Xiaozong Cui
___
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 get the battery level of my mica2 or iris mote

2011-04-13 Thread
Use component  VoltageC, you can get the voltage of the node.

2011/4/1 sofia aparicio aparicioso...@hotmail.com

  Hello,

 I would like to know how can I get the battery left in my mica2 or iris
 mote.

 Thank you.

 Sofia


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




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

Re: [Tinyos-help] Micaz RF Power

2011-04-12 Thread
There you will find the CC2420Packet implementation, with the setPower
command. That will allow you to change the transmission power. That command
accepts values from 0 to 31.

2011/4/13 Dave McGee daveomc...@gmail.com

 Hi there,

 Can anyone tell me what the RF power range is on a MicaZ mote? (Is it like
 0 - 15?)

 Regards,
 Dave

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




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

[Tinyos-help] Question about the sample frequency of the mts300 sensorboard on micaz

2011-03-18 Thread
I use the MicStreamC to sample sound. To test the sampling time, I set the red
light on at the beginning of the program, and then

#defind SAMPLE_LENGTH 100
call MicReadStream.postBuffer(sampleBuf, SAMPLE_LENGTH);
call MicReadStream.read(1000);

finally, I set the green light on in MicReadStream.readDone(error_t result,
uint32_t actualPeriod) .

event void MicReadStream.readDone(error_t result, uint32_t actualPeriod)
{
call Leds.led1On();// the green light
}

Then I run the program on micaz node, and I used a timer to test the time
from the red light on to the green light on. but I get that it used about
1.2 second.

Then I changed the parameter in MicReadStream.read() to MicReadStream.read(1)
 MicReadStream.read(2)  MicReadStream.read(10)  MicReadStream.read(100) ,
and the time it used remain the same.

I wonder if there is a limit frequency for mts300 or tinyos to sample data.

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

Re: [Tinyos-help] Question about the sample frequency of the mts300 sensorboard on micaz

2011-03-18 Thread
I got the answer.
The MicStreamC need a 1.2second warm up time in the code of the mts300
folder.
(tos/sensorboard/mts300/MicP.nc)
line 76
 call Timer.startOneShot(1200);

2011/3/18 崔晓宗 cpp...@gmail.com

 I use the MicStreamC to sample sound. To test the sampling time, I set the red
 light on at the beginning of the program, and then

 #defind SAMPLE_LENGTH 100
 call MicReadStream.postBuffer(sampleBuf, SAMPLE_LENGTH);
 call MicReadStream.read(1000);

 finally, I set the green light on in MicReadStream.readDone(error_t result,
 uint32_t actualPeriod) .

 event void MicReadStream.readDone(error_t result, uint32_t actualPeriod)
 {
 call Leds.led1On();// the green light
 }

 Then I run the program on micaz node, and I used a timer to test the time
 from the red light on to the green light on. but I get that it used about
 1.2 second.

 Then I changed the parameter in MicReadStream.read() to MicReadStream.read(1)
  MicReadStream.read(2)  MicReadStream.read(10)  MicReadStream.read(100) ,
 and the time it used remain the same.

 I wonder if there is a limit frequency for mts300 or tinyos to sample data.

 --
 Regards,
 Xiaozong Cui




-- 
Regards,
Xiaozong Cui
___
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 configure the max communicating distance of Micaz

2011-03-17 Thread
I found the command was defined like this, CC2420Packet.setPower( message_t*
p_msg, uint8_t power )

Is the parameter p_msg the message I want to send, and dose that mean I must
call setPower() every time I want to send a message?

2011/3/14 崔晓宗 cpp...@gmail.com

 Thank you for your answers.


 2011/3/11 Breno Guimarães bren...@gmail.com

 In that case you should look the CC2420 interfaces
 tos/chips/cc2420/

 There you will find the CC2420Packet implementation, with the setPower
 command. That will allow you to change the transmission power. That command
 accepts values from 0 to 31.

 Let me know if you have further questions

 Good luck,

 Breno Guimaraes

 2011/3/11 崔晓宗 cpp...@gmail.com

 Micaz

 2011/3/11 Breno Guimarães bren...@gmail.com

 Hi,

 Which mote are you using?

 Breno Guimaraes

 2011/3/11 崔晓宗 cpp...@gmail.com

 I am using TinyOS 2.x, and I want to control the distance of
 communication to save power. Please someone help me.
 Thanks in advance.

 --
 Regards,
 Xiaozong Cui


 ___
 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




 --
 Regards,
 Xiaozong Cui



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




 --
 Regards,
 Xiaozong Cui




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

Re: [Tinyos-help] Arrays in TinyOs

2011-03-14 Thread
yes.
For example,

uint16_t array[10];

在 2011年3月14日 下午6:03,lulu cheng lulu66_...@hotmail.com写道:

  Hi,

 I need to collect certain sets of data and just curious, is there array for
 tinyos?

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




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

[Tinyos-help] How to configure the max communicating distance of Micaz

2011-03-11 Thread
I am using TinyOS 2.x, and I want to control the distance of communication
to save power. Please someone help me.
Thanks in advance.

-- 
Regards,
Xiaozong Cui
___
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 configure the max communicating distance of Micaz

2011-03-11 Thread
Micaz

2011/3/11 Breno Guimarães bren...@gmail.com

 Hi,

 Which mote are you using?

 Breno Guimaraes

 2011/3/11 崔晓宗 cpp...@gmail.com

 I am using TinyOS 2.x, and I want to control the distance of communication
 to save power. Please someone help me.
 Thanks in advance.

 --
 Regards,
 Xiaozong Cui


 ___
 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




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

[Tinyos-help] Send float or double types over the serial port

2011-03-02 Thread
According to the tutorial, we can send a struct from the mote to the PC over
the serial port.
The struct is defined as below,

typedef nx_struct MyMsg{
nx_uint16_t nodeid;
nx_uint16_t data;
}MyMsg;

and use MIG to generate a java file or other language used on the PC.

what if I want to add a float or double type to the struct?
I simplely add  double data2 to the struct, but the MIG tool complained
that data2 must be a network type
How should I write the code.
Please help.

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

Re: [Tinyos-help] sending a string from tinyos

2011-02-23 Thread
0x48 is equal to 72 in decimal,  if you receive them on PC, you can turn
them into 'H'.

2011/2/23 Shamali Gunawardena shama...@yahoo.com

 thanks for the reply. How do you define it.

 I tried with just sending one character first. (the variable name is
 character)

 1. char charcter; (doesn't work) - compilation problem
 2. nx_uint8_t character- assigned the value 'H' and 0x48  to the message.
 In both cases the received value was 72 (the decimal value)

 How do I get around that.

 regards,

 Shamali
 --
 *From:* 崔晓宗 cpp...@gmail.com
 *To:* Shamali Gunawardena shama...@yahoo.com;
 Tinyos-help@millennium.berkeley.edu
 *Sent:* Wed, February 23, 2011 1:49:36 PM
 *Subject:* Re: [Tinyos-help] sending a string from tinyos

 you can send the string as a char array, which is similar to sending
 integers.

 2011/2/23 Shamali Gunawardena shama...@yahoo.com

 Hi,

 This is a pretty basic question. I need to know how I can send a string
 (eg Hello) in nesC. I know how to send integers (unit_16_t and etc)
 How do I specify the data type and how do I assign the value.

 thanks

 Regards,

 Shamali




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




 --
 Regards,
 Xiaozong Cui





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

Re: [Tinyos-help] sending a string from tinyos

2011-02-23 Thread
You can define a struct just follow this tutorial
http://docs.tinyos.net/index.php/Mote-mote_radio_communication
http://docs.tinyos.net/index.php/Mote-mote_radio_communication

typedef nx_struct BlinkToRadioMsg {
  nx_uint8_t string[10];
  nx_uint16_t i;
} BlinkToRadioMsg;

besides , I add  char c; in Blink and there is no compiling error.



2011/2/23 Shamali Gunawardena shama...@yahoo.com

 Ok so everything transmitted will be received in its decimal format and I
 have to convert it. Am I correct? In that case I would run into another
 problem. say I get a combination of integers and strings (eg Hello123) then
 how can I decide on what to convert and what not to for example 72 could
 mean its H or the number 72. unless I know the length or the type of the
 data received I will not be able to interpret it.
 and why doesn't the char work ? how can I declare an array with
 nx_uint8_t.

 I am sorry for the repeated mail. but am desperate to go past this point.

 Regards,

 Shamali

 --
 *From:* 崔晓宗 cpp...@gmail.com
 *To:* Shamali Gunawardena shama...@yahoo.com;
 Tinyos-help@millennium.berkeley.edu
 *Sent:* Wed, February 23, 2011 2:38:21 PM

 *Subject:* Re: [Tinyos-help] sending a string from tinyos

 0x48 is equal to 72 in decimal,  if you receive them on PC, you can turn
 them into 'H'.

 2011/2/23 Shamali Gunawardena shama...@yahoo.com

 thanks for the reply. How do you define it.

 I tried with just sending one character first. (the variable name is
 character)

 1. char charcter; (doesn't work) - compilation problem
 2. nx_uint8_t character- assigned the value 'H' and 0x48  to the message.
 In both cases the received value was 72 (the decimal value)

 How do I get around that.

 regards,

 Shamali
 --
 *From:* 崔晓宗 cpp...@gmail.com
 *To:* Shamali Gunawardena shama...@yahoo.com;
 Tinyos-help@millennium.berkeley.edu
 *Sent:* Wed, February 23, 2011 1:49:36 PM
 *Subject:* Re: [Tinyos-help] sending a string from tinyos

 you can send the string as a char array, which is similar to sending
 integers.

 2011/2/23 Shamali Gunawardena shama...@yahoo.com

 Hi,

 This is a pretty basic question. I need to know how I can send a string
 (eg Hello) in nesC. I know how to send integers (unit_16_t and etc)
 How do I specify the data type and how do I assign the value.

 thanks

 Regards,

 Shamali




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




 --
 Regards,
 Xiaozong Cui





 --
 Regards,
 Xiaozong Cui





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

Re: [Tinyos-help] sending a string from tinyos

2011-02-22 Thread
you can send the string as a char array, which is similar to sending
integers.

2011/2/23 Shamali Gunawardena shama...@yahoo.com

 Hi,

 This is a pretty basic question. I need to know how I can send a string (eg
 Hello) in nesC. I know how to send integers (unit_16_t and etc)
 How do I specify the data type and how do I assign the value.

 thanks

 Regards,

 Shamali




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




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

Re: [Tinyos-help] Mote-PC serial communication...have not display any data

2011-02-18 Thread
Did you add a . to the classpath?
And you'd better read the raw data with some tools to check what data the PC
receiced

在 2011年2月18日 下午4:13,zhou2090 zhou2...@126.com写道:

  when I input the command

 java net.tinyos.tools.MsgReader BlinkToRadioMsg

 it just like this:

 sinwel@ubuntu:/opt/tinyos-2.x/apps/BlinktoRadio$ java 
 net.tinyos.tools.MsgReader -comm $MOTECOM BlinkToRadioMsg
 serial@/dev/ttyUSB1:57600: resynchronising
 serial@/dev/ttyUSB1:57600: ignoring unknown packet type 0x0

 then it waiting forever ,have not  display any data like the tutorial

 1152232617609: Message
   [nodeid=0x2]
   [counter=0x1049]

 1152232617609: Message
   [nodeid=0x2]
   [counter=0x104a]

 1152232617609: Message
   [nodeid=0x2]
   [counter=0x104b]



 i have check everystep about the lesson,but i can't find the reason,so i 
 dumped.



 anyone can help me ?

 thanks a lot






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




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

Re: [Tinyos-help] Mote-PC serial communication...have not display any data

2011-02-18 Thread
Maybe the AM_BLINKTORADIOMSG in your head file is not equal to 6,I guess.

在 2011年2月18日 下午4:27,zhou2090 zhou2...@126.com写道:



  And you'd better read the raw data with some tools to check what data the
 PC receiced

 yes , i have check that
 sinwel@ubuntu:/opt/tinyos-2.x/apps/BaseStation$ java
 net.tinyos.tools.Listen -comm $MOTECOM

 serial@/dev/ttyUSB1:57600: resynchronising
 serial@/dev/ttyUSB1:57600: ignoring unknown packet type 0x0
 00 FF FF FF FF 04 00 06 00 01 00 F5
 00 FF FF FF FF 04 00 06 00 01 00 F6
 00 FF FF FF FF 04 00 06 00 01 00 F7
 00 FF FF FF FF 04 00 06 00 01 00 F8
 00 FF FF FF FF 04 00 06 00 01 00 F9
 so ?






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

[Tinyos-help] Micaz and mts300/mts310 microphone to sample sound

2011-02-17 Thread
Hi,
I am using Micaz and MTS310 sensorboard's microphone to sample the sound,
and I got the following data
594 361 493 494 424 592 515 489 562 426 447 451 458 562

But I don't know how to use and parse these data. If I want to konw the
sound is relatively large or small, how should I calculate them.

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

Re: [Tinyos-help] largest valid value assigned to a variable of uint16_t type?

2011-01-28 Thread
2^16 - 1

2011/1/27 Michael Schippling sc...@santafe.edu

 What is 2^16?  Oh, we aren't playing Jeopardy!?
 0x = 65535d

 MS

 Gary Lee wrote:
  Hi,
 
  What is the largest valid value assigned to a variable of uint16_t type?
 
  Thanks a lot,
 
  gary
 
 
  
 
  ___
  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




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

[Tinyos-help] ADC in TinyOS 2.x (Micaz platform)

2010-12-26 Thread
I want to read the ADC value from one pin of the 51 connector. And the
interface tos.chips.atm128.adc.Atm128AdcConfig has 3
commands,getChannelhttp://www.tinyos.net/tinyos-2.x/doc/nesdoc/micaz/ihtml/tos.chips.atm128.adc.Atm128AdcConfig.html#getChannel
(),getPrescalerhttp://www.tinyos.net/tinyos-2.x/doc/nesdoc/micaz/ihtml/tos.chips.atm128.adc.Atm128AdcConfig.html#getPrescaler
(),getRefVoltagehttp://www.tinyos.net/tinyos-2.x/doc/nesdoc/micaz/ihtml/tos.chips.atm128.adc.Atm128AdcConfig.html#getRefVoltage
().
I am confused about the relation of the output,the prescaler and the ref
voltage.

Please help me.

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

Re: [Tinyos-help] Put text en message_t

2010-12-15 Thread
you can refer to Tinyos Tutorial.
--
void sendMessage() {
EasyCollectionMsg* msg =
  (EasyCollectionMsg*)call Send.getPayload(packet,
sizeof(EasyCollectionMsg));
msg-data = 0x;

if (call Send.send(packet, sizeof(EasyCollectionMsg)) != SUCCESS)
  call Leds.led0On();
else
  sendBusy = TRUE;
  }

2010/12/16 Edel A. Rodriguez Sanchez ean...@udg.co.cu

 I'am trying to send a message. I have done that:

 1. message_t packet;   // Message buffer
 2. uint8_t Msg[8]; // Message that i want to send.
 3. call AMPacket.setDestination(packet, node);   // Put the dest of
 message
 4. bat, how i put the mesaje Msg in the packet packet?

 Thanks

 *
 *
 Edel Angel Rodríguez Sánchez
 Facultad de Informática
 *Universidad de Granma. Cuba*

 --
 *From: *tinyos-help-requ...@millennium.berkeley.edu
 *To: *tinyos-h...@millennium.berkeley.edu
 *Sent: *Wednesday, December 15, 2010 5:21:57 AM
 *Subject: *Tinyos-help Digest, Vol 92, Issue 50

 Send Tinyos-help mailing list submissions to
 tinyos-help@millennium.berkeley.edu

 To subscribe or unsubscribe via the World Wide Web, visit

 https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

 or, via email, send a message with subject or body 'help' to
 tinyos-help-requ...@millennium.berkeley.edu

 You can reach the person managing the list at
 tinyos-help-ow...@millennium.berkeley.edu

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Tinyos-help digest...


 Today's Topics:

1. MSP430 General IO on TelosB hardware (Joey Wilson)
2. Re: MSP430 General IO on TelosB hardware (Jos? A. Tarifa)
3. Re: (no subject) (Yong, Chee Yeew)
4. Re: CTP: CC2420Packet.getPower() (Yusnaidi Md Yusof)


 --

 Message: 1
 Date: Tue, 14 Dec 2010 16:11:47 -0700
 From: Joey Wilson doughywil...@gmail.com
 Subject: [Tinyos-help] MSP430 General IO on TelosB hardware
 To: tinyos-help@millennium.berkeley.edu
 Message-ID:
 
 aanlktimxqjhjgpmfoxwzna_dvpaw+wdmz_az68+3+...@mail.gmail.comaanlktimxqjhjgpmfoxwzna_dvpaw%2bwdmz_az68%2b3%2b...@mail.gmail.com
 
 Content-Type: text/plain; charset=utf-8

 Hello all,

 I am trying to figure out an easy way to turn on/off a digital output from
 the TelosB hardware from TinyOS software. I have been searching the web and
 found that some people say to use the MSP430GeneralIOC component in the
 application wiring, but this is not working. I have tried a lot of variants
 and can't seem to figure it out. Could anyone explain how to wire the
 MSP430's general IO components correctly?

 Thanks for your time.
 -- next part --
 An HTML attachment was scrubbed...
 URL:
 https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20101214/dfd5cd84/attachment-0001.htm

 --

 Message: 2
 Date: Wed, 15 Dec 2010 02:13:13 +0100
 From: Jos? A. Tarifa jostar...@alum.us.es
 Subject: Re: [Tinyos-help] MSP430 General IO on TelosB hardware
 To: Tinyos-help tinyos-help@millennium.berkeley.edu
 Message-ID: 4d081629.4080...@alum.us.es
 Content-Type: text/plain; charset=utf-8

 I've tried to use these functionality... and it seems it works!! :D

 Components:
  components HplMsp430GeneralIOC as GeneralIOC;
  components new Msp430GpioC() as DigitalA;
  components new Msp430GpioC() as DigitalB;
  components new Msp... (etc).

 Wiring:
  DigitalA - GeneralIOC.Port23;// This is pin#3 from the 6-pin
 connector
  DigitalB - GeneralIOC.Port26;// This is pin#4 from the 6-pin
 connector

  ModuleC.DigA - DigitalA;
  ModuleC.DigB - DigitalB;

 And then, in your application module (named ModuleC) you must define
 these interfaces:
  uses interface GeneralIO as DigA;
  uses interface GeneralIO as DigB;

 For example, if you want to set pin#3 to output, you write
  call DigA.makeOutput();

 If you want to set pin#4 to 1 (like output), you can write:
  call DigB.makeOutput();
  ...
  call DigB.set();


 http://www.tinyos.net/tinyos-2.1.0/doc/nesdoc/telosb/ihtml/tos.interfaces.GeneralIO.html

 I hope to help you... if you need further help... ask to the mailing list
 :)

 Regards,
 Jose A.

 

 El 15/12/2010 0:11, Joey Wilson escribi?:
  Hello all,
 
  I am trying to figure out an easy way to turn on/off a digital output
  from the TelosB hardware from TinyOS software. I have been searching
  the web and found that some people say to use the MSP430GeneralIOC
  component in the application wiring, but this is not working. I have
  tried a lot of variants and can't seem to figure it out. Could anyone
  explain how to wire the MSP430's general IO components correctly?
 
  Thanks for your time.
 
 
  ___
  Tinyos-help mailing list
  

Re: [Tinyos-help] mig and tymo

2010-12-13 Thread
Maybe there was somthing wrong with your tymo/mh/mhpacket.h file. Is the
struct named mhpacket_t? Or you should give us the code in your head file.

2010/12/14 et...@uni-potsdam.de

 I'm trying to generate classes from the header files delivered by tymo.
 By calling:
 mig python -target=mica2 -python-class-name MHPacket
 tymo/mh/mhpacket.h mhpacket_t -o MHPacketHeader.py

 i get the error:
 error: tag mhpacket_t not found
 failed to parse message file tymo/mh/mhpacket.h

 I also tried mhpacket_header_t and removing the 'other' struct from
 header file but the error still occurs.
 Can somebody tell me what i'm doing wrong or what i have to do instead?

 Best regards,
 Enrico




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




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

Re: [Tinyos-help] toscheck errors

2010-12-11 Thread
javax.Comm is used for Serial Communication, the details can be found in
Getting Started page

2010/12/11 Dridi Hinda dridi_hi...@yahoo.fr

 Hello all;

 When I type toscheck I have errors and warnings ;toscheck completed with
 errors:

 -- WARNING: No java  in current path.

 -- WARNING: could not found the javax.Comm classes .Please ensure the Java
 Comm
 API is installed correctly.

 Can someone Help me to fix these errors ?




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




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

Re: [Tinyos-help] Duplicate data from EasyCollection

2010-12-09 Thread
I tried your suggestion, however it seems not  taking effect to my motes.
Is the hardware acknowledgements got late too? Is there some method to make
the ACK send quicker or prolong the waiting time.

Thank you.

在 2010年12月9日 下午3:33,Urs Hunkeler urs.hunke...@epfl.ch写道:

 Hi,

 I think your two questions might be related. I had a similar problem
 once where it turned out that the ACKs were received too late. In my
 case it helped to enable hardware acknowledgments. You can try this by
 adding the following line to your Makefile:
 CFLAGS+=-DCC2420_HW_ACKNOWLEDGEMENTS

 Then rebuild the application with the following command:
 make clean  make micaz

 (Use the make clean to ensure that the app will be completely rebuilt).

 Cheers,
 Urs

 On 12/09/2010 08:12 AM, cui wrote:
  I modified the apps/EasyCollection to add a counter in the message, and
  I found that the Root received every message for many times(about 30).
  Is that normal and how can I avoid this.
  part of my code
  -
  module NodeC {
  uses interface Boot;
  uses interface SplitControl as RadioControl;
  uses interface StdControl as RoutingControl;
  uses interface Send;
  uses interface Leds;
  uses interface TimerTMilli;
  uses interface RootControl;
  uses interface Receive;
  }
  implementation {
  message_t packet;
  bool sendBusy = FALSE;
  uint16_t counter = 0;
  event void Boot.booted() {
  call RadioControl.start();
  }
  event void RadioControl.startDone(error_t err) {
  if (err != SUCCESS)
  call RadioControl.start();
  else {
  call RoutingControl.start();
  call Timer.startPeriodic(2000);
  }
  }
  event void RadioControl.stopDone(error_t err) {}
  void sendMessage() {
  SensorMsg* msg =
  (SensorMsg*)call Send.getPayload(packet, sizeof(SensorMsg));
  msg-nodeid = TOS_NODE_ID;
  msg-sensorType = SENSOR_TYPE_SOUND;
  msg-data = counter++;
  if (call Send.send(packet, sizeof(SensorMsg)) != SUCCESS)
  call Leds.led0On();
  else
  sendBusy = TRUE;
  }
  event void Timer.fired() {
  if (!sendBusy) {
  call Leds.led2Toggle();
  sendMessage();
  }
  }
  event void Send.sendDone(message_t* m, error_t err) {
  if (err != SUCCESS)
  call Leds.led0On();
  sendBusy = FALSE;
  }
  }
  
  module RootC {
  uses interface Boot;
  uses interface SplitControl as RadioControl;
  uses interface SplitControl as SerialControl;
  uses interface StdControl as RoutingControl;
  uses interface AMSend as UartAMSend;
  uses interface AMPacket as UartAMPacket;
  uses interface Packet as UartPacket;
  uses interface Leds;
  uses interface TimerTMilli;
  uses interface RootControl;
  uses interface Receive;
  }
  implementation {
  message_t packet;
  SensorMsg *sensorMsg;
  bool UartSendBusy = FALSE;
  event void Boot.booted() {
  call RadioControl.start();
  call SerialControl.start();
  }
  event void RadioControl.startDone(error_t err) {
  if (err != SUCCESS)
  call RadioControl.start();
  else {
  call RoutingControl.start();
  call RootControl.setRoot();
  }
  }
  event void RadioControl.stopDone(error_t err) {}
  event void SerialControl.startDone(error_t error) {
  if( error == SUCCESS ) {
  call Leds.led0Toggle();
  } else {
  call SerialControl.start();
  call Leds.led2Toggle();
  }
  }
  event void SerialControl.stopDone(error_t err) {};
  event void UartAMSend.sendDone(message_t *msg, error_t err) {
  if(packet==msg) {
  UartSendBusy = FALSE;
  }
  }
  event void Timer.fired() {
  }
  event message_t*
  Receive.receive(message_t* msg, void* payload, uint8_t len) {
  SensorMsg *btrpkt = (SensorMsg *)call UartPacket.getPayload(packet,
 NULL);
  sensorMsg = (SensorMsg*)payload;
  btrpkt-nodeid = sensorMsg-nodeid;
  btrpkt-sensorType = sensorMsg-sensorType;
  btrpkt-data = sensorMsg-data;
  call Leds.led1Toggle();
  if( (call UartAMSend.send(AM_BROADCAST_ADDR, packet,
  sizeof(SensorMsg)))==SUCCESS) {
  UartSendBusy = TRUE;
  }
  return msg;
  }
  2010-12-09




-- 
Be the change you want to see in the world.
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help