[Tinyos-help] CC1000 radio

2011-07-08 Thread Surfman19
Hello,

I want to use the radio of the mica2 mote with 915.9988 MHz. The radio is 
called CC1000. Could someone tell which pins of the atmega128 are used to 
control the radio?

are these all pins which are necessary to connect the CC1000 to the atmega128?

// A/D channels
enum {
  CHANNEL_RSSI   = ATM128_ADC_SNGL_ADC0,
  CHANNEL_THERMISTOR = ATM128_ADC_SNGL_ADC1,// normally unpopulated
  CHANNEL_BATTERY= ATM128_ADC_SNGL_ADC7,
};

HplCC1000P.CHP_OUT - IO.PortA6;
HplCC1000P.PALE - IO.PortD4;
HplCC1000P.PCLK - IO.PortD6;
HplCC1000P.PDATA - IO.PortD7;

HplCC1000SpiP.SpiSck - IO.PortB1;
HplCC1000SpiP.SpiMiso - IO.PortB3;
HplCC1000SpiP.SpiMosi - IO.PortB2;
HplCC1000SpiP.OC1C - IO.PortB7;

Regards,
Gerald
-- 
NEU: FreePhone - kostenlos mobil telefonieren!  
Jetzt informieren: http://www.gmx.net/de/go/freephone
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Create a periodic timer with 136 us interval

2011-06-07 Thread Surfman19
Hello,

How can I generate a periodic timer which is fired every 136 us on a Mica2 
mote? There is a Millisec Timer in TinyOS, but 1 Millsec is far away from 136 
us. What could I use?

Regards,
Gerald
-- 
NEU: FreePhone - kostenlos mobil telefonieren!  
Jetzt informieren: http://www.gmx.net/de/go/freephone
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Read ADC Voltage on Mica2

2011-05-18 Thread Surfman19
Hello,

How can i read the ADC6 channel (Voltage Readings) of a mica2 mote? 
I only found a DemoSensor!? 
http://www.tinyos.net/dist-2.0.0/tinyos-2.x/doc/html/tutorial/lesson5.html
What can I use to read the ADC6, how to configure that, are there some sample 
programs?

Thank you.

Regards,
Gerald
-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!   
Jetzt informieren: http://www.gmx.net/de/go/freephone
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] TinyOS related questions

2011-05-12 Thread Surfman19
Hi,
I have some TinyOS related questions!

Whats the difference between:
a.) signal event(...);
b.) atomic signal event(...);

What kind of code is more efficiency and what does the async event here mean?
a.)
async event void Int0.fired() 
{
   
   signal PHY.data_arrived();
}

event void PHY.data_arrived() {
   uint16_t rcv_crc = 0;
   uint16_t calc_crc = 0;

   call PHY.extract(...); /// do memcpy, takes about 1-2ms

   // calc checksum
   rcv_crc = 
   calc_crc = call Crc.crc16();

   // if checksum is correct we signal
   if(rcv_crc == calc_crc)
   {
 atomic signal Radio.receive(...);
   }
   else
   {
 printf(crc wrong\n);
 printfflush();
   }
}

b.)
async event void Int0.fired() 
{
   
   signal PHY.data_arrived();
}

event void PHY.data_arrived() {
   post task_data_arrived();
}

task void task_data_arrived() {
   uint16_t rcv_crc = 0;
   uint16_t calc_crc = 0;

   call PHY.extract(...); /// do memcpy

   // calc checksum
   rcv_crc = 
   calc_crc = call Crc.crc16();

   // if checksum is correct we signal
   if(rcv_crc == calc_crc)
   {
 atomic signal Radio.receive(...);
   }
   else
   {
 printf(crc wrong\n);
 printfflush();
   }
}
-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!   
Jetzt informieren: http://www.gmx.net/de/go/freephone
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Problem with LogRead and LogWrite

2011-04-06 Thread Surfman19
Hello,

Why are there all offsets set to zero?

it prints out:
read_offset1: 0
read_offset2: 0
write_offset1: 0
write_offset2: 0

Gerald

#include Timer.h
#include TestSerial.h
#include printf.h

module TestSerialC {
  uses {
interface SplitControl as Control;
interface Leds;
interface Boot;
interface Receive;
interface AMSend;
interface TimerTMilli as MilliTimer;
interface TimerTMilli as InitTimer;
interface Packet;
interface LogRead;
interface LogWrite;
  }
}
implementation {
  message_t packet;

  typedef nx_struct logentry_t {
nx_uint16_t counter;
  } logentry_t;

  bool m_busy = FALSE;
  logentry_t m_entry;

  bool locked = FALSE;

  storage_cookie_t read_offset1;
  storage_cookie_t read_offset2;
  storage_cookie_t write_offset1;
  storage_cookie_t write_offset2;

  event void Boot.booted() {
call Control.start();

call InitTimer.startOneShot(1000);
  }
  
  event void InitTimer.fired() {
int16_t i = 0;
 
write_offset1 = call LogWrite.currentOffset();
read_offset1 = call LogRead.currentOffset();

// we want to read from the starting point of the first write
call LogRead.seek(call LogWrite.currentOffset());

read_offset2 = call LogRead.currentOffset();

// we write some data in the flash storage
for(i=0; i  1000; i++) {
  if (!m_busy) {
m_busy = TRUE;
m_entry.counter = i;
if (call LogWrite.append(m_entry, sizeof(logentry_t)) != SUCCESS) {
  m_busy = FALSE;
}
  }
}

write_offset2 = call LogWrite.currentOffset();

call MilliTimer.startPeriodic(1000);
  }

  event void MilliTimer.fired() {   
printf(read_offset1: %u\n, read_offset1);
printf(read_offset2: %u\n, read_offset2);
printf(write_offset1: %u\n, write_offset1);
printf(write_offset2: %u\n, write_offset2);
printfflush();

if (call LogRead.read(m_entry, sizeof(logentry_t)) != SUCCESS) {
  // Handle error.
}
  }

  event void LogWrite.appendDone(void* buf, storage_len_t len, 
 bool recordsLost, error_t err) {

m_busy = FALSE;
  }
-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!   
Jetzt informieren: http://www.gmx.net/de/go/freephone
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] LogWrite.erase()

2011-04-06 Thread Surfman19
Hi,

I want to transfer data from tinyos to java. To start the process is send 
rcm-counter  0x13. Why is it only possible to start the process once???
Can LogWrite.erase() only called once?

Regards,
Gerald

#include Timer.h
#include TestSerial.h
#include printf.h

#define NUMBER_LOG_VALUES 500

module TestSerialC {
  uses {
interface SplitControl as Control;
interface Leds;
interface Boot;
interface Receive;
interface AMSend;
interface TimerTMilli as MilliTimer;
interface TimerTMilli as InitTimer;
interface Packet;
interface LogRead;
interface LogWrite;
  }
}
implementation {

  message_t packet;

  bool locked = FALSE;
  uint16_t counter = 0;
  
  bool busy = FALSE;
  bool logBusy = FALSE;
  uint16_t readings = 0;
  uint16_t data = 0;

  event void Boot.booted() {
call Control.start();
  }
  
  task void initLogWrite() {
if (!logBusy)
{
  logBusy = TRUE;

  if(readings == NUMBER_LOG_VALUES)
  {
call LogRead.read(data, sizeof(data));
  }
  else
  //if (readings  NUMBER_LOG_VALUES)
  {
call LogWrite.append(readings, sizeof(readings));
readings++;
  }
}
  }

  event void MilliTimer.fired() {
  }
  event void InitTimer.fired() {
  }

  event message_t* Receive.receive(message_t* bufPtr, 
   void* payload, uint8_t len) {
if (len != sizeof(test_serial_msg_t)) {return bufPtr;}
else {
  test_serial_msg_t* rcm = (test_serial_msg_t*)payload;
  
  // if TestSerial.java is started we clear the flash memory
  if (rcm-counter  0x13) {
busy = FALSE; 
logBusy = FALSE;
call LogWrite.erase();
  }
  // we initialize the flash memory
  //else if (rcm-counter  0x14) {
  //  post initLogWrite();
  //}
  // we read the flash memory
  //else if (rcm-counter  0x15) {
  //  call LogRead.read(data, sizeof(data));
  //}
  return bufPtr;
}
  }

  event void Control.startDone(error_t err) {
if (err == SUCCESS) {
}
  }
  event void Control.stopDone(error_t err) {}

  task void sendTask() {
if (!busy)
  {
test_serial_msg_t* rcm = (test_serial_msg_t*)call 
Packet.getPayload(packet, sizeof(test_serial_msg_t));
if (rcm == NULL) {return;}
if (call Packet.maxPayloadLength()  sizeof(test_serial_msg_t)) {
  return;
}

rcm-counter = data;
if (call AMSend.send(AM_BROADCAST_ADDR, packet, 
sizeof(test_serial_msg_t)) == SUCCESS) {
  busy = TRUE;
}
  }
  }

  event void AMSend.sendDone(message_t* bufPtr, error_t error) {
if(error == SUCCESS) {  
  if (packet == bufPtr) {
busy = FALSE;
call LogRead.read(data, sizeof(data));
  }
}
  }

  event void LogRead.readDone(void* buf, storage_len_t len, error_t err) {
if (err == SUCCESS) {
  if (len == sizeof(data)) {
post sendTask();
  }
}
  }

  event void LogWrite.eraseDone(error_t result) {
post initLogWrite();
  }

  event void LogWrite.appendDone(void* buf, storage_len_t len, 
 bool recordsLost, error_t err) {
if (err == SUCCESS)
  call LogWrite.sync();
  }

  event void LogRead.seekDone(error_t err) {
  }

  event void LogWrite.syncDone(error_t err) {
logBusy = FALSE;
post initLogWrite();
  }
}
-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] TinyOS questions

2010-08-23 Thread Surfman19
Hello,

After reading a TinyOS tutorial I have 4 remaining questions:

1.) Why do you need the = operator for wiring? 
Does the configuration as well as the module provide and use interfaces?
Why is the provides interface Leds; outside of the implementation?

configuration LedsC {
   provides interface Leds;
}
implementation {
   components LedsP, PlatformLedsC;
   Leds = LedsP.Leds;
   LedsP.Init - PlatformLedsC.Init;
   LedsP.Led0 - PlatformLedsC.Led0;
   LedsP.Led1 - PlatformLedsC.Led1;
   LedsP.Led2 - PlatformLedsC.Led2;
}

2.) What is auto-wiring?

3.) How could you send a multihop message from one sender to one receiver?
As I see ActiveMessageC uses single hop?
I saw multi-hop networking uses collection, dissemination!
But in collection multiple motes send to a server in a multihop fashion.
Could you just define a P2P connection using multihop?  

4.) Commands and events are synchronous by default? 
The execution of an event can't be interrupted by a task or another event 
because they are sync 
by default? If the commands or events as aync, they can be interrupted by a 
task?


bye
-- 
GMX.at - Österreichs FreeMail-Dienst mit über 2 Mio Mitgliedern
E-Mail, SMS  mehr! Kostenlos: http://portal.gmx.net/de/go/atfreemail
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] SBT80 Multi-Modality Sensor Board for TelosB

2010-08-22 Thread Surfman19
Hello,

I have a question to the SBT80 Multi-Modality Sensor Board for TelosB wireless 
motes:
http://www.easysen.com/support/SBT80v2/DatasheetSBT80v2.pdf
here the source code:
http://www.easysen.com/support/SBT80v2/

The acceleration sensors (X and Y axis) have an analog outputs and are 
connected to ADC6_PORT and ADC7_PORT of the telosb? does the telosb have such a 
lot adc channels?

bye Gerald
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] tinyos - sensor readings

2010-08-17 Thread Surfman19
Hi,

i have 2 questions:
1.)
how can you read the acceleration of the accelerometer on the telosb sensor 
board? how do you read the sensor data?

i assume that there is only one sensor board for the telosb!? 
http://www.easysen.com/SBT80.htm

2.)
when i run the oscilloscope application the light sensor reading is always 
around 4000. i changed the lightning conditions but the sensor reading doesnt 
change! any idea why?

screen:
http://www.upload-pictures.de/bild.php/806,osziQUB1L.png

bye
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Read RSSI

2010-08-01 Thread Surfman19
hi,

how can i read the rssi value on a telosb mote?
can i extend the demo app RadioCountToLeds to do that, which interface will i 
need to use and what function call?

bye
-- 
GMX.at - Österreichs FreeMail-Dienst mit über 2 Mio Mitgliedern
E-Mail, SMS  mehr! Kostenlos: http://portal.gmx.net/de/go/atfreemail
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] RadioSenseToLeds fails

2010-07-26 Thread Surfman19
hi,

i tried to build the app RadioSenseToLeds! 
but it fails;( 
could someone tell me what is causing the errors? 
how can i fix it?

r...@xubuntos-tinyos:/opt/tinyos-2.1.0/apps/RadioSenseToLeds# make telosb
mkdir -p build/telosb
javac RadioSenseMsg.java
/opt/tinyos-2.1.0/support/sdk/java/net/tinyos/message/Message.java:84: cannot 
find symbol
symbol  : class SerialPacket
location: class net.tinyos.message.Message
  private SerialPacket serialPacket;
  ^
/opt/tinyos-2.1.0/support/sdk/java/net/tinyos/message/Message.java:676: cannot 
find symbol
symbol  : class SerialPacket
location: class net.tinyos.message.Message
  public SerialPacket getSerialPacket() {
 ^
/opt/tinyos-2.1.0/support/sdk/java/net/tinyos/message/Message.java:684: cannot 
find symbol
symbol  : class SerialPacket
location: class net.tinyos.message.Message
  protected void setSerialPacket(SerialPacket mySerialPacket) {
 ^
3 errors
make: *** [RadioSenseMsg.class] Error 1
r...@xubuntos-tinyos:/opt/tinyos-2.1.0/apps/RadioSenseToLeds# 
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Tossim

2010-07-24 Thread Surfman19
hello,

i try to activate the debug messages (0: LEDS: Yellow off. 0: LEDS: Green off. 
0: LEDS: Red off.) to see the status of the LEDs as described in the following 
tutorial:
http://www.tinyos.net/tinyos-1.x/doc/tutorial/lesson5.html

i used the command:
export DBG=am,led

but it didnt work for tinyos2.1! could someone tell me what to do?
export DBG=am,led
make micaz sim
what to do after that?

i use the apps/Blink example!

bye
-- 
GMX.at - Österreichs FreeMail-Dienst mit über 2 Mio Mitgliedern
E-Mail, SMS  mehr! Kostenlos: http://portal.gmx.net/de/go/atfreemail
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] simulate Blink application using TOSSIM

2010-07-21 Thread Surfman19
Hello,

I want to simulate the demo application in apps/Blink. I saw that some debug 
messages such as dbg and the led2Toggle are used...how can i see/display all 
these outputs?
event void Timer2.fired()
{ 
dbg(BlinkC, Timer 2 fired @ %s.\n, sim_time_string());
call Leds.led2Toggle();
}

I called the command:
make micaz sim

it created a TOSSIM.py file. In the documentation it says i need to enter all 
the the following commands:
from TOSSIM import *
import sys

t = Tossim([])
r = t.radio()


Is there a simpler way to execute the Blink application using TOSSIM?

Bye Gerald
-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help