[Tinyos-help] Cannot turn off the serial port (MicaZ - T2.0.2.2)

2008-09-25 Thread daniel widyanto
Hi all, Is there anybody that has the same experience with me ? After the UART in Micaz is turned off, it cannot be turned on again. Even though the SplitControl for start and stop returns SUCCESS, I cannot send anything to the UART. Here's the sample of my code: TosUartControlP.nc

[Tinyos-help] Config interface for MCU internal EEPROM

2008-04-07 Thread daniel widyanto
Hi all, Can I have suggestions about the interface that I should implement for MCU's internal EEPROM ? I'm using micaz compatible mote, and I want to store the mote's configuration (sampling time, offset, etc) inside MCU's EEPROM (because ATMega128 has 4096 bytes EEPROM, which I think it's more

[Tinyos-help] IRIS toolchain in SLED 10

2008-04-07 Thread daniel widyanto
, daniel widyanto wrote: Hi Janos, Thanks a lot. You've just saved me from boring weekend job --sorry Kevin ;-) Cheers, -daniel On Thu, 2008-04-03 at 09:29 -0500, Janos Sallai wrote: Daniel, You might want to take a look at the toolchain for the IRIS mote (binutils 2.17, gcc 4.1.2

Re: [Tinyos-help] TinyOS comparison with others...

2008-04-07 Thread daniel widyanto
Hi, The criteria for choosing the RTOS is depend on your requirement. In general, TinyOS is the correct choice if: - You need cheap device with radio, powered by 2-AA battery 1500mA each, and survives 6-months or even years without battery replacement. - You need to sense physical value over

Re: [Tinyos-help] interface parameter as a specification element.

2008-04-07 Thread daniel widyanto
Hi, You should view parameterized interface as array of interfaces. Hence: -- module A { uses interface SendMsg[uint8_t channel]; } -- should be viewed as: -- module A { uses interface SendMsg as SendMsg1; uses interface SendMsg as SendMsg2; uses

Re: [Tinyos-help] interface parameter as a specification element.

2008-04-07 Thread daniel widyanto
Hi Jung, My advice is to use individual interface, especially for small number of interfaces. You'll reduce bug, and its easier to read. But for the sake of learning parameterized interface in nesC, here's the modified Blink application (taken from TOS1/apps/Blink). ---

[Tinyos-help] T2 patch for avr-gcc / avr-libc

2008-04-03 Thread daniel widyanto
Hi all, I'm having a little bit problem with the current T2's avr-gcc / avr-libc package. I'm using tiny25 to build non-tinyos device, and the tiny25 is not supported in the current tinyos' avr-gcc / avr-libc package (avr-gcc 3.4.4 / avr-libc 1.2.3) I understand that most of tinyos developers

RE: [Tinyos-help] T2 patch for avr-gcc / avr-libc

2008-04-03 Thread daniel widyanto
Hi Janos, Thanks a lot. You've just saved me from boring weekend job --sorry Kevin ;-) Cheers, -daniel On Thu, 2008-04-03 at 09:29 -0500, Janos Sallai wrote: Daniel, You might want to take a look at the toolchain for the IRIS mote (binutils 2.17, gcc 4.1.2, avr-libc 1.4.6). It does have

Re: [Tinyos-help] Very strange problem!

2008-02-10 Thread daniel widyanto
If I'm not mistaken the type's definition (int, long int, etc) in NesC is following the AVR-GCC standard. Thus, AVR-GCC refers to GCC standards (long int = 8 bytes, int = 4 bytes). That's why it's suggested to use uint8_t, uint16_t, etc. Please correct me if I'm wrong. -daniel On Sun,

Re: [Tinyos-help] How to make tinyos application under ecclipse

2007-11-26 Thread daniel widyanto
Hi, TinyOS Makefile needs these environment variables to be set : TOSROOT, TOSDIR, CLASSPATH, and MAKERULES. I think your cygwin environment has these env variables (you can check it using export command), but your exec command doesn't have (when you exec the bash, it will run bash with empty

Re: [Tinyos-help] about startxwin.bat

2007-11-26 Thread daniel widyanto
What's the correlation between X emulation and TinyOS anyway ?? You don't need X-Windows to run TinyOS applications. The java swing/awt will handle it for you. Just install the correct JRE and cygwin. Refer to this page (http://www.tinyos.net/tinyos-2.x/doc/html/install-tinyos.html) for the

Re: [Tinyos-help] It's about the Timer!

2007-11-25 Thread daniel widyanto
Hi, Just suggestion, I think when you call Timer1.start( TIMER_REPEAT, period_Timer1 ) before Timer1.fired() called, the Timer1 counter value will be reset back to period_Timer1 (I'm not very sure about this, take a look at the TimerM implementation in your TinyOS source code). Anyway, just to

Re: [Tinyos-help] It's about the Timer!

2007-11-25 Thread daniel widyanto
Hi all, The Send.sendDone() is called after the MCU successfully write the CC2420's FIFO. It won't wait for message's ACK from other node(s). This is my trace on T1.1.15 : GenericComm.SendMsg[id]-AMStandard.SendMsg- task void sendTask()-RadioSend.send(buf)- RadioCRCPacket.Send-CRCPacket.Send :

Re: [Tinyos-help] Dangling pointer in SF (C version)

2007-10-24 Thread Daniel Widyanto
Hi all, Sorry, my mistake. I didn't realize the :typedef struct serial_source *serial_source; in serialsource.h And thanks for the x = malloc(sizeof *x) tip. Regards, -daniel Original Message From: David Gay [EMAIL PROTECTED] Sent: Thursday, October 25, 2007 12:32 AM

[Tinyos-help] Dangling pointer in SF (C version)

2007-10-23 Thread Daniel Widyanto
Hi all, I'm currently debugging strange error in serial forwarder (c version, TinyOS 2.0.1), and I found this : // serialsource.c:273: serial_source src = malloc(sizeof *src); if (src) { memset(src, 0, sizeof *src); src-fd = fd; src-non_blocking = non_blocking;

re: [Tinyos-help] problems with yamp

2007-10-01 Thread Daniel Widyanto
Hi, `ncc` and `tos-ident-flags` is installed in /usr/bin by default (not sure whether they put it in the same place for Cygwin or not). Check where these two programs lie on your system, and make sure that their path are included. Thus, I think if you open cygwin shell, it will run .bashrc in

Re: [Tinyos-help] C and nesC problems

2007-09-25 Thread Daniel Widyanto
Hi Kenneth, I am also using T2's serial-forwarder for T1 motes. There are several application in my company that's still using old T1.1.15. As far as I know, you just need to modify the Serial.h to match T1 packet. - diff -u3

[Tinyos-help] Nesdoc for user application

2007-09-25 Thread Daniel Widyanto
Hi all, I want to use nesdoc to document my application. According to the nesdoc script, the nesdoc should not be used for user application. So, are there any tricks to make it work for user application ? Or should I use doxygen instead ? I've tried doxygen for nesc, but it didn't work as

re: [Tinyos-help] C and nesC problems

2007-09-23 Thread Daniel Widyanto
Hi, Under TinyOS-2.x tree, there's a directory called : support/sdk/c. Compile the source using : make, the result is libmote.a to be linked to your C-program. To send the command to serial forwarder : see the example in sfsend.c. Basically, what you need to do is : 1) Open sf channel using

re: [Tinyos-help] Motelist prob.

2007-09-20 Thread Daniel Widyanto
Hi, java.io.IOException: error=2, No such file or directory -- Check whether you have motelist or not : bash# whereis motelist Replace MOTELISTCMDL with the correct path of motelist : public static final String MOTELISTCMDL = /usr/bin/motelist -c; The name of the script is motelist. The

[Tinyos-help] Sync node's sleep/wakeup interval

2007-09-17 Thread Daniel Widyanto
Hi all, I'm searching for algorithm to sync nodes' sleep/wakeup interval. I've found this one : http://www.polastre.com/papers/sensys05-sp.pdf, which is the base for Boomerang's SP protocol. I'm wondering if there's similar algorithm in TinyOS 2.x ? Thanks a lot. Regards, -daniel

[Tinyos-help] 'static ' keyword in generic module

2007-09-14 Thread Daniel Widyanto
Hi all, I want to know whether 'static' keyword inside the generic module behaves similar to Java's static ? So, if I have two instance of the same generic module, can they refer to the same static variable ? Or they will have their own copy ? Thank you Regards, -daniel

re: [Tinyos-help] How send a float number in message_t struct

2007-09-03 Thread Daniel Widyanto
Hi, Cast your double/float variables into nx_uint16_t/nx_uint32_t Then re-cast it again to double/float when you receive it (actually it's not re-cast, but read the integer value using double/float format. Something that you can done by scanf(%f,value) ). Regards, -daniel Original

re: [Tinyos-help] Time-delay between Matlab and Mica2dot

2007-09-03 Thread Daniel Widyanto
Hi, I'm not sure whether TinyOS really suitable for your application. The WSN in TinyOS is used to monitoring vast area, long period (1min - 1day/sampling), and long term (6 months until years without replacing the battery). 200 ms probably is very fast (though it's not the fastest one).

RE: [Tinyos-help] The power consumed

2007-08-28 Thread Daniel Widyanto
Hi, I used 2 different R (1ohm and 25ohm) with large delay between sending/receiving packets (around 30s). Since there are spikes (even in the sleep mode), I use oscilloscope's average value. Thus, to get the whole current consumption, I measured the sleeping current first (using 25ohm).

re: [Tinyos-help] unsuccesful attempt at mesh networking (MultihopOscillator)

2007-08-28 Thread Daniel Widyanto
Hi, What version of TinyOS that you use ? I've done the same thing in T2.0.1, and it worked fine. Here's how I test it : 1) Put node 0 and node 2 out of range 2) Put node 1 in the middle (in range for node 0 and node 2) 3) Test multihop by turn on/off node 1 The problem with your test method

[Tinyos-help] TinyOS 1.1.15 - Uncontrollable timer behaviour

2007-08-15 Thread Daniel Widyanto
Hi all, I've just spent the day to debug this weird T1.1.15 behaviour. I set up a timer to shoot every 30s using TimerC. The first initial shot is OK (shot within 30s), the rest of the shot is fired in 0.5s. If I set the timer to shot in 15s. The first initial shot is 15s, but the rest of

re: [Tinyos-help] How to stop or disable radio listening?

2007-08-12 Thread Daniel Widyanto
Hi, Stop the radio. module { interface SplitControl as RadioControl; . } implementation { task stopRadio() { call RadioControl.stop(); } event void RadioControl.stopDone(error_t error) { // Radio is stopped } } Regards, -daniel Original

Re: [Tinyos-help] Again!!!! Low-power CC2420 multihop in TinyOS2.x question????

2007-08-05 Thread Daniel Widyanto
Dear Ravi, I've also done some test for CTP currrent consumption using micaz. I have the same result as you are. It took around 30 min for a node to join a network, and the minimum current consumption is around 5-6mA (not shown in my graph). My test result (along with the firmware that I

re: [Tinyos-help] Quadrature encoder

2007-07-24 Thread Daniel Widyanto
Hi, Try this : in moduleC : module BlablaC { uses interface Boot; uses interface GeneralIO as DigitalInputPin; // etc.. } implementation { event void Boot.booted() { DigitalIOPin.makeInput(); // DDRx = ~(1 x) DigitalIOPin.set(); // PORTx |= (1 x) } task void

re: [Tinyos-help] Can I use float or double type in message when I want to use mig ?

2007-07-22 Thread Daniel Widyanto
Hi, I'm not sure about your problem. But I think you should check the TOSH_DATA_LENGTH to make sure that your data is within the limit of the mote's message. Also, have you change the data structure inside your mote's firmware when you change the HelloMsg struct ? Regards, -daniel

[Tinyos-help] mcombine() in McuSleepC.nc

2007-07-18 Thread Daniel Widyanto
Hi all, I have a bit questions about mcombine() in McuSleepC.nc . tos/chips/atm128/McuSleepC.nc:100 : powerState = mcombine(getPowerState(), call McuPowerOverride.lowestState()); tos/chips/atm128/atm128hardware.h:132 mcu_power_t mcombine(mcu_power_t m1, mcu_power_t m2) { return (m1 m2)? m1:

[Tinyos-help] T2 task post behaviour

2007-07-16 Thread Daniel Widyanto
Hi all, I have questions about task posting in T2. Does it have a counter of how many it was posted ? Example : event void Command.changed() { post ProcessCommand(); } If Command.changed() is called twice, will ProcessCommand() task be called twice ? TIA Regards, -daniel

re: [Tinyos-help] Led Blinking

2007-07-13 Thread Daniel Widyanto
Hi, Use one-shot timer to do it. Eg : uint8_t u8_variableVal; StdControl.start() { call Timer.startOneShot(1000); // 1s delay for each LED } event Timer.fired() { call Led.led0Toggle(); if (u8_variableVal-- 0) call Timer.startOneShot(1000); } Regards, -daniel Original

re: [Tinyos-help] toscomm JNI library not found (when it's clearly there)

2007-07-13 Thread Daniel Widyanto
Hi, There's a script called tos-locate-jre in /usr/bin. Try to run it using : #tos-locate-jre --jni It should return : $yourjavahome/jre/lib/i386 Otherwise you have to modify the script to return that value. I'm running Ubuntu, and I've modified that script (but I forgot which line). Regards,

re: [Tinyos-help] Listen Tool Problem

2007-07-13 Thread Daniel Widyanto
Hi, I think there's something wrong with your hardware (or your PC's serial port). The first 3-bytes of the serial AM package should be : 0x7e 0x45 0x00 Then it'll be followed by the data from serial_header_t (in tos\lib\serial\Serial.h) : typedef nx_struct serial_header { nx_am_addr_t

re: [Tinyos-help] modification of tinyos for other devices not supported yet

2007-07-13 Thread Daniel Widyanto
Refer to Tutorial Lesson 6: Boot Sequence, Lesson 10: Platforms, Lesson 13: TinyOS Toolchain Regards, -daniel Original Message From: [EMAIL PROTECTED] Sent: Friday, July 13, 2007 3:03 PM To: tinyos-help@Millennium.Berkeley.EDU Subject: [Tinyos-help] modification of

[Tinyos-help] Delay needed for dissemination's packet

2007-07-12 Thread Daniel Widyanto
Hi all, I'm building node-to-node multihop network using dissemination. Like the TEP118 sec 5 suggested, I'm adding my own predicate to make sure that only a certain node can receive the command. My problem is that whenever I send two or more commands to the different nodes too fast, one of

re: [Tinyos-help] Listen Tool Problem

2007-07-11 Thread Daniel Widyanto
Hi Geetha, I think it's because your PC's is not synchronize with the mote. It happens a lot for me. Try to turn off the BaseStation (PC-mote bridge) mote first, while the other motes keep sending the data. I think after few times on-offing the BaseStation, you'll get something in your

[Tinyos-help] CTP Data Frame take the message_t data ?

2007-07-10 Thread Daniel Widyanto
Hi all, I just want to ask about the package frame. Based on TEP111 about message_t, the message_t's data length is defined by TOSH_DATA_LENGTH. Is the CTP's data frame (in TEP123 section 4) taking message_t's data field ? Or is the message_t is inside the CTP's data field ? Just a bit

re: [Tinyos-help] AMSend, T2 tutorial 3, KR C, nesC language questions

2007-07-09 Thread Daniel Widyanto
Hi, getPayload() will return (void *), which means that it will point to array of memories. By casting it into structure pointer, it'll be easier to access the field inside the structure. Here's a little illustration : (void *) AMSend.getPayload(pkt) = 0x00 0x01 0x00 0x05 (BlinkToRadioMsg*)

[Tinyos-help] Has anyone ever tried the EasyCollection in Tutorial 12 ?

2007-07-06 Thread Daniel Widyanto
Hi All, I'm newbie in TinyOS, and currently learning it by doing the TinyOS 2.x tutorial. I have a problem with the EasyCollection example in lesson 12 of the tutorial. All of the nodes can send the package, but the base node (TOS_NODE_ID == 1) cannot display the Leds.led1Toggle(). Has

re: [Tinyos-help] [Easy Dissemination]

2007-07-06 Thread Daniel Widyanto
Hi, Looks like we're on the same page. The EasyDissemination in the tutorial lesson 12 is broken. Use the http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg12829.html version. I have tried the EasyDissemination, and it was perfect. It can find the node and hopping into it in