Re: [Tinyos-help] Ultrasonic sensors on MDA300 + IRIS

2011-07-23 Thread hafid oussaadi
Hi Miklos,
>Try running at half the speed (8.7 KHz) to see if that works. Your
>Basestation also needs to be special, use the one we have on our
>website (it needs 125 kbps UART and a fastserial library).
Yes, you are right, I eliminated the red led blinking problem by increasing the 
sampling period in MicreadStreamTestC.nc : line 76 .I downloaded the 
BaseStation from 
http://szte-wsn.svn.sourceforge.net/viewvc/szte-wsn/tinyos-2.x/trunk/apps/BaseStation/
 and the FastSerial library from 
http://szte-wsn.svn.sourceforge.net/viewvc/szte-wsn/tinyos-2.x/trunk/tos/lib/FastSerial/.
 However, when I compiled  your BaseStation app for IRIS mote, I got an error 
apparently  because of this option in its Makefile : CFLAGS += 
-DPLATFORM_BAUDRATE=230400L.
when I removed this line everything  went fine but the yellow led in MIB520 was 
blinking which means queue overflow (serial transmission too slow) and loss 
packet percentage in the java application side was about 20%.So what was wrong ?
Regards,
Hafid___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ReadStream interface for MDA300 ADC channels

2011-07-23 Thread hafid oussaadi
Dear all,
I am using  MDA300 drivers from 
http://tinyos.cvs.sourceforge.net/viewvc/tinyos/tinyos-2.x-contrib/uoit/mda300ca/.
 I wonder if anyone had tried to design a ReadStrem interface for a single 
ended ADC channels.  Please, share your experience with me.
I appreciate your help in advance
Regards,
Hafid ___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Ultrasonic sensors on MDA300 + IRIS

2011-07-23 Thread Miklos Maroti
Hi Hafid,

The base station's serial is not fast enough for the incoming packets.
Try the 115200L baudrate. You also have to connect to your mote on the
PC with serial@/dev/tty0:115200

Best,
Miklos

On Sat, Jul 23, 2011 at 10:14 AM, hafid oussaadi  wrote:
> Hi Miklos,
>>Try running at half the speed (8.7 KHz) to see if that works. Your
>>Basestation also needs to be special, use the one we have on our
>>website (it needs 125 kbps UART and a fastserial library).
> Yes, you are right, I eliminated the red led blinking problem by increasing
> the sampling period in MicreadStreamTestC.nc : line 76 .I downloaded the
> BaseStation from
> http://szte-wsn.svn.sourceforge.net/viewvc/szte-wsn/tinyos-2.x/trunk/apps/BaseStation/ and
> the FastSerial library from
> http://szte-wsn.svn.sourceforge.net/viewvc/szte-wsn/tinyos-2.x/trunk/tos/lib/FastSerial/.
> However, when I compiled  your BaseStation app for IRIS mote, I got an error
> apparently  because of this option in its Makefile : CFLAGS +=
> -DPLATFORM_BAUDRATE=230400L.
> when I removed this line everything  went fine but the yellow led in MIB520
> was blinking which means queue overflow (serial transmission too slow) and
> loss packet percentage in the java application side was about 20%.So what
> was wrong ?
> Regards,
> Hafid
> ___
> 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] Ultrasonic sensors on MDA300 + IRIS

2011-07-23 Thread hafid oussaadi
Hi Miklos,
I still got the same error even with 115200L baudrate, this is the detailed 
error message:
in file included from opt/tinyos-2.x/tos/system/SchedulerBasicP.nc:41,
 from opt/tinyos-2.x/tos/system/TinySchedulerC.nc :40:
opt/tinyos-2.x/tos/platforms/micaz/hardware.h:66:  syntax error before 
`115200L` 
make: *** [exe0] Error 1
In fact, in hardware.h (attached file) there is one definition for 
PLATFORM_BAUDRATE:56700L , but even I change it I still get the same error! 
Regards,
Hafid  /** 
 *  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.  By
 *  downloading, copying, installing or using the software you agree to
 *  this license.  If you do not agree to this license, do not download,
 *  install, copy or use the software.
 *
 *  Copyright (c) 2004-2005 Crossbow Technology, Inc.
 *  Copyright (c) 2002-2003 Intel Corporation.
 *  Copyright (c) 2000-2003 The Regents of the University  of California.
 *  All rights reserved.
 *
 *  Permission to use, copy, modify, and distribute this software and its
 *  documentation for any purpose, without fee, and without written
 *  agreement is hereby granted, provided that the above copyright
 *  notice, the (updated) modification history and the author appear in
 *  all copies of this source code.
 *
 *  Permission is also granted to distribute this software under the
 *  standard BSD license as contained in the TinyOS distribution.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 *  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE INTEL OR ITS
 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *  @author Jason Hill, Philip Levis, Nelson Lee, David Gay
 *  @author Alan Broad 
 *  @author Matt Miller 
 *  @author Martin Turon 
 *
 *  $Id: hardware.h,v 1.7 2009/07/01 19:27:00 scipio Exp $
 */

#ifndef HARDWARE_H
#define HARDWARE_H

#ifndef MHZ
/* Clock rate is ~8MHz except if specified by user 
   (this value must be a power of 2, see MicaTimer.h and MeasureClockC.nc) */
#define MHZ 8
#endif

#include 
#include 
#include 

// enum so components can override power saving,
// as per TEP 112.
enum {
  TOS_SLEEP_NONE = ATM128_POWER_IDLE,
};

// A/D channels
enum {
  CHANNEL_THERMISTOR = ATM128_ADC_SNGL_ADC1// normally unpopulated
};

enum {
  PLATFORM_BAUDRATE = 57600L
};

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

Re: [Tinyos-help] Ultrasonic sensors on MDA300 + IRIS

2011-07-23 Thread hafid oussaadi
Hi Miklos,
I fixed hardware.h by removing the PLATFORM_BAUDRATE definition and the 
application works fine . thanks for everything!
Best regards,
Hafid___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] cc2420 metadata

2011-07-23 Thread AKHILA S RAO
the RSSI of a packet is stored in its metadata once it is received. You
can use the CC2420Packet.getRSSI() to get the RSSI value of a packet
(which is an indicator for the signal power at which that packet was
received). The Tx power of the packet has to be sent by you in the payload
of the packet if you want it to be available at the receiver.

> Hi All,
>
> I wish to embed the tx_power and rssi value in the metadata part of a
> packet
> to be sent. Can I know how I can do that? What components/interface to
> use?
>
> Please help me.
>
> Many thanks in advance.
>
> Yusnaidi
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Tinyos-help] What is the maximum speed LED can toggle?

2011-07-23 Thread Michael Schippling
The "usual" thing would be to have a Timer
post a send() task, and use a busy semaphore
that is reset in sendDone(). Then you only need
one global" message buffer.

If it was the receive side that hung up I would
look at how you free the internal receive msg
buffers.

But it might be best to post your code...

MS



Lee Carol wrote:
> Hi Michael and Eric, thank you for replying.
> 
> It's the sending side that failed and I do not know how to debug a 
> buffer failure..
> After extensive testing, it does seem like some kind of buffer problem 
> as it always give me a few successful packet then die if I am on the 
> 40~50Hz but no packet is sent after that.
> 
> Any idea?
> Thanks
> 
> On Fri, Jul 22, 2011 at 5:47 PM, Michael Schippling  > wrote:
> 
> If you can't debug it with an LED or two...haha...
> Actually I have sometimes used a scope and once
> or twice have been forced to use a logic analyzer.
> 
> You should be able to flash the LED exactly as fast as
> you can execute a while-loop with a toggle in it.
> 
> There may be a buffer failure. Are you freeing each
> message buffer as soon as you are done? Is it the sending
> or receiving side that dies, and how do we know?
> 
> My speed tests using T1 and mica's of various flavors
> were able to run fairly fast for-mostly-ever, although
> 33/second is about the mica2 limit.
> 
> What platform are you using?
> 
> MS
> 
> Eric Decker wrote:
> 
> 
> 
> On Fri, Jul 22, 2011 at 2:19 PM, Lee Carol    >> wrote:
> 
>Hi, I am writing a program that, every time a packet is sent from
>mote, LED light toggles.
>When I increase the packet sending rate to 33Hz, my mote only
> works
>for few seconds then stop.
>I've examined my code and everything seems to work fine.
>Wondering if LED is causing the problem and want to know how fast
>the LED can be toggled.
> 
> 
> probably not.  Not much can go wrong with the LED.
> 
> I would recommend that you get a jtag pod and dig into what is
> actually going on.   trying to debug embedded systems using
> printfs and led while doable isnt the most efficient of
> programmer time.   my not so humble opinion.  (I've been doing
> embedded stuff since the 70's).
>  
> 
>Anyone knows?
>Thanks for viewing
> 
>Carol
> 
>_
>Tinyos-help mailing list
>Tinyos-help@millennium.__berkeley.edu
> 
> >
> 
>  
>  
> https://www.millennium.__berkeley.edu/cgi-bin/mailman/__listinfo/tinyos-help
> 
> 
> 
> 
> 
> 
> -- 
> Eric B. Decker
> Senior (over 50 :-) Researcher
> 
> 
> 
> 
> --__--__
> 
> 
> _
> 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] enumerator problem in tinyos-1.x at compilation

2011-07-23 Thread anushcbe

Hi 

am Anush doing my PG project work.

i want to simulate the make pc so that i can run tinyviz. while doing that i
too facing same problem of redefinition of `uint8_t'; hope you have solved
the problem will you be able to help me to move forward from this point by
informing about the correction that i can build successfully.

Expecting you for replay.

Thank You

Regards

Anush




VJ shekar wrote:
> 
> Hello all,
> Iam trying to compile blink in tinyos-1.x, but its strange to see the
> following error.
> I haven't faced this error before.
> 
> VJ@Vijay /cygdrive/c/tinyos/cygwin/opt/tinyos-1.x/apps/blink
> $ make pc
> compiling Blink to a pc binary
> ncc -o build/pc/main.exe -g -O0 -board=micasb -pthread -target=pc  -Wall
> -Wshado
> w -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -fnesc-nido-tosnodes=1000
> -fnesc-cfile=buil
> d/pc/app.c  Blink.nc -lm
> /opt/tinyos-1.x/tos/system/tos.h:57: redefinition of `uint8_t'
> /usr/include/stdint.h:24: previous declaration of `uint8_t'
> /opt/tinyos-1.x/tos/system/tos.h:62: redefinition of `uint16_t'
> /usr/include/stdint.h:25: previous declaration of `uint16_t'
> In file included from /opt/tinyos-1.x/tos/platform/pc/hardware.h:43,
>  from /opt/tinyos-1.x/tos/system/tos.h:132:
> */opt/tinyos-1.x/tos/platform/pc/nido.h:63: `TOSH_NUM_NODES' undeclared
> here
> (not
>  in a function)
> /opt/tinyos-1.x/tos/platform/pc/nido.h:63: enumerator value for `TOSNODES'
> not i
> nteger constant
> make: *** [build/pc/main.exe] Error 1*
> **
> And my nido.h file looks like this with the 63rd line highlighted below.
> 
> #ifndef NIDO_H_INCLUDED
> #define NIDO_H_INCLUDED
> 
> /* in nesc/nesc-cpp.c, the TOSH_NUM_NODES macro is defined, so that
>TOSNODES is set to the value specified to the nesc compiler by the flag
>"-fnesc-nido-tosnodes=___" */
> enum {
>  * TOSNODES = TOSH_NUM_NODES,
> *  DEFAULT_EEPROM_SIZE = (512 * 1024)  // 512 KB
> };
> #include "event_queue.h"
> #include "adjacency_list.h"
> #include "rfm_model.h"
> #include "adc_model.h"
> #include "spatial_model.h"
> #include "nido_eeprom.h"
> #include "events.h"
> #include 
> typedef struct TOS_node_state{
>   long long time; // Time at which mote booted
>   int pot_setting;
> } TOS_node_state_t;
> typedef struct TOS_state {
>   long long tos_time;
>   int radio_kb_rate;
>   short num_nodes;
>   short current_node;
>   TOS_node_state_t node_state[TOSNODES];
>   event_queue_t queue;
>   rfm_model* rfm;
>   adc_model* adc;
>   spatial_model* space;
>   bool moteOn[TOSNODES];
>   /* Synchronization */
>   bool paused;
>   pthread_mutex_t pause_lock;
>   pthread_cond_t pause_cond;
>   pthread_cond_t pause_ack_cond;
> } TOS_state_t;
> #define NODE_NUM (tos_state.current_node)
> #define THIS_NODE (tos_state.node_state[tos_state.current_node])
> #define TOS_queue_insert_event(event) \
> queue_insert_event(&(tos_state.queue), event);
> extern TOS_state_t tos_state;
> int notifyTaskPosted(char* name);
> int notifyEventSignaled(char* name);
> int notifyCommandCalled(char* name);
> static void __nesc_nido_initialise(int mote);
> #include "dbg_modes.h"
> static void dbg_clear(TOS_dbg_mode mode, const char *format, ...);
> /* This function is here because it uses function pointers */
> void tos_state_model_init(void)
> {
>   dbg_clear(DBG_SIM|DBG_BOOT, "SIM: spatial model initialized.\n");
>   tos_state.space->init();
> 
>   dbg_clear(DBG_SIM|DBG_BOOT, "SIM: RFM model initialized at %i
> kbit/sec.\n", tos_state.radio_kb_rate);
>   tos_state.rfm->init();
> 
>   dbg_clear(DBG_SIM|DBG_BOOT, "SIM: ADC model initialized.\n");
>   tos_state.adc->init();
> }
> #endif
> 
> 
> Actually, im switching back from tinyos-2.x to tinyos-1.x.
> All the required environmental variables are set proparly as mentioned in
> the tutorials.
> Well, i have seen the same problem too in the previous posts, but that is
> related to cricket software and it is of no help to me.
> Could anyone please suggest me how to get over with this Error.
> Thanks a lot in advance.
> 
> Vijay.
> 
> ___
> 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://old.nabble.com/enumerator-problem-in-tinyos-1.x-at-compilation-tp17199797p32119972.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