[Tinyos-help] problems with programming base station (timer problem)
Hi all I was wondering if someone can help us regarding this code. What we need to do is to program the base station to send three anchor packets after the timer get fired (After 30 seconds). The base station should wait 30 sec and then sends three packets but what happens is the base station sends packets to UART in the first 30 seconds without receiving any packets from the network. Attached please have a look to the code: module InitialBcastM { provides { interface StdControl; } uses { interface Timer; interface TOS_MsgOutput; } } implementation { AnchorXY AnchorPacket; int count; command result_t StdControl.init() { count = 0; AnchorPacket.X = GLOBAL_X; AnchorPacket.Y = GLOBAL_Y; AnchorPacket.hopCount = 1; atomic { AnchorPacket.src = TOS_LOCAL_ADDRESS; } return SUCCESS; } command result_t StdControl.start() { return call Timer.start(TIMER_REPEAT,500); } command result_t StdControl.stop() { return call Timer.stop(); } event result_t Timer.fired() { TOS_Msg msg; AnchorXY *ptr = (AnchorXY *)(msg.data); count++; if(count == 3) call StdControl.stop(); *ptr = AnchorPacket; call TOS_MsgOutput.output(TOS_BCAST_ADDR, sizeof(AnchorXY), &msg); } event result_t TOS_MsgOutput.outputComplete(bool success) { return success; } } And then another part of the code which asks base station not to do anything in the first 30 sec: module DVHopStageIM { provides { interface StdControl; } uses { interface StdControl as IBControl; interface StdControl as PRControl; interface StdControl as RPControl; interface StdControl as StageIIControl; interface Timer; interface Leds; interface TOS_MsgOutput; } } implementation { NodeInfo *ptr; TOS_Msg msg; AnchorXY *m; command result_t StdControl.init() { dbg(DBG_TEMP, "Stage I init()"); atomic { initialize(&headptr); } return rcombine4(call IBControl.init(), call PRControl.init(), call RPControl.init(), call StageIIControl.init()); } command result_t StdControl.start() { dbg(DBG_TEMP, "Stage I start()"); return rcombine4(call IBControl.start(), call PRControl.start(), call RPControl.start(), call Timer.start(TIMER_ONE_SHOT,3)); } command result_t StdControl.stop() { dbg(DBG_TEMP, "StageI stop()"); return rcombine4(call IBControl.stop(), call PRControl.stop(), call RPControl.stop(), call StageIIControl.stop()); } task void headToUART() { atomic { ptr = headptr; } if(ptr) { m = (AnchorXY*)(msg.data); *m = ptr->packet; call TOS_MsgOutput.output(TOS_UART_ADDR, sizeof(AnchorXY), &msg); } } event result_t Timer.fired() { call Leds.greenToggle(); post headToUART(); dbg(DBG_TEMP, "This is the end of stage I"); return call StageIIControl.start();; } event result_t TOS_MsgOutput.outputComplete(bool success) { if(success) ptr = ptr->next; if(ptr) { m = (AnchorXY*)(msg.data); *m = ptr->packet; call TOS_MsgOutput.output(TOS_UART_ADDR, sizeof(AnchorXY), &msg); } } } Could someone please help us because this code is working fine with the nodes of one of my friends who is using mica2 motes and I am using micaz motes. We tried to figure out what is the problem but we were not successful. Thanks in advance ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] FramerM.nc & packetizer.java
hi all i am trying to modify surge-reliable application in order to be able to receive RSSI values in multi-hop applications. i have searched the help list but i couldnt find enough help regarding the topic. what i need is first to modify the receiver part to measure RSSI and then add this value to the packet that wants to be forwarded so i need new structure for the packets which is going to be sent, i guess. i have read the codes in frameM.nc and packetizer.java that i guess relate to capsulated the structure of the packet. could someone help me how to change the structure of the packet to increase the payload size and add the RSSI value to the payload and also how to set the receiver to measure RSSI. I have seen that it is possible to hack TOSBaseM.nc but is it usefull for Surge-reliable application also? any help will be appreciated. best esmaeil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] node localization using RSSI
Hi all I am doing a project which I need to localize the nodes (Micaz motes) using RSSI. How can I define some nodes as beacons (the nodes which they know their position) in such a way that mobile nodes communicate with them and also with the gateway. Is there any application similar or any code? Thanks in advance Esmaeil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] help needed, problem with upgrading tinyos
Hi all I have tried to upgrade my TinyOS environment from TinyOS 1.1.0 tinyos1.1.10Jan2005...) to CVS tinyos1.1.15DEC2005... but I have got problems. What I have done was 1) Upgrading cygwin and installing all the new packages 2) Installing CVS snapshot in the rpm directory. Now that I want to program the motes (Micaz) under directory XSensorMTS300, I can't compile the program because the error happens as follows: Component voltage not found! Expected component 'voltage', but got component 'HPLUARTOM' I have also downloaded the file HPL0USART0M.nc and I copied in the msp430 directory. Could someone please say what I am doing wrong? Any help will be appreciated. Best Esmaeil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] help with CntToLedsAndRfm
Hi I have programmed the motes with CntToLedsAndRfm and RfmToLeds yesterday and everything was ok, but today I tried to do the same to simulate the network using TOSSIM but I receive the error as below when I try to program the motes in CntToLedsAndRfm: CntToLedsAndRfm.nc:43: cannot find 'StdControl' CntToLedsAndRfm.nc:47: cannot find 'Timer' CntToLedsAndRfm.nc:48: cannot find 'IntOutput' CntToLedsAndRfm.nc:49: cannot find 'IntOutput' Make: *** [exe0] Error1 What I have done wrong? Any help will be appreciated. Esmaeil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] error in XSensorMTS300
Hi all I am trying to program the motes with xsensormts300 but after running xlisten and when I try to aggregate the data, I receive the following error: Error: no packet handler for tos type 0x03 Error: no packet handler for tos type 0x01 ... ... And so on, Any solution will be appreciated. Esmaeil ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] RE:Why magnetometer readings do not change
Hi The main problem of the magnetometer (i believe you are using HMC1002) is the saturation. They easily saturate by magnetic fields. In the datasheet, you can find different SET/RESET circuits which u can design to solve the saturation problem. ___ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help