Re: [Tinyos-help] latest CVS/GIT ?
Vikram, Look at the sourceforge page for tinyos. It has instructions on how to check out the repository. http://sourceforge.net/scm/?type=cvsgroup_id=28656 -Paul On 1/23/2010 5:12 AM, Vikram vik76 wrote: Hello, How do I get the latest CVS/GIT? I am presently running tinyos2.1. Thanks Vikram ___ 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] Micaz Data rate
Yusnaidi, You may have misunderstood, nothing is transmitted by the mote unless the program calls the appropriate method (AMSenderC.send() in most cases). If you make a timer with Timer.startPeriodic(1000) and do nothing inside the Timer.fired() event, nothing will be sent over the radio. The maximum datarate listed as 250 kbps is the theoretical maximum throughput that the radio can support. This means in a perfect world, if the radio was operating at maximum efficiency, it could transmit 250 kb over the air, and another listening mote could receive all 250 kb. Due to many reasons (manchester encoding, preambles, ACKS, CCA, etc) this value is never achievable. Manchester encoding is the real slowdown here, as it halves your datarate. I don't have any micaZ hardware, but for example, the maximum data rate for the mica2 motes is 38.4 kbps. With some tweaking to the maximum packet size, I have been able to achieve ~14kbps at the application level in ideal RF environments. This is less than 1/2 the stated data rate on the datasheet. Hope this clears things up a bit. -Paul On 1/21/2010 4:25 PM, YUSNAIDI MD YUSOF wrote: Hi All, I came across the MicaZ datasheet and found that the data rate for MicaZ is 250 kbps. Thus, it came into my thought, if I set the Timer as Timer.startPeriodic(1000) which is to fire every 1 second, does that mean every 1 second there is amount of 250 kilobit data sent? A simple explanation would greatly help me understand the concept. thanks Yusnaidi ___ 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] Tasks dilemma
Ruben, There is no magic rule or number that will give good results in all cases. It is totally dependent on your own application, and it's timing requirements. Your best bet is to actually do some profiling on your heavy operation and determine how long it actually takes on your specific hardware. If for example you have timers that perform important operations every 2 seconds(that cannot be delayed/skipped), you would probably want to break your heavy operation into chunks significantly less than 2 seconds. You can also do some profiling after implementing your heavy operation, and see how often you miss deadlines in your application. Knowing this can help you tweak how you break it up into sub-tasks. Hope this helps, -Paul Ruben Rios wrote: Hello everyone, I have been reading around about the problem of having computationally heavy operations and decompossing such operations into lighter tasks. But my question is, when should I do this? I mean, is there a rule of thumb (such as loops over 5 repetitions) to know when should I use tasks ??? Thanks ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] NesC data types
Ruben, 1) Is easily solved by replacing void with your own custom enum (127biterror_t) or something equivalent, and returning that whenever you perform an operation. It should be fairly trivial to check for error cases like overflow, divide by 0, etc. in software and return the appropriate code that you define (e.g. EOVERFLOW). Normally on the microprocessor, there is a flag that is set when an arithmetic operation causes an overflow, but taking advantage of that forces you to specialize your implementation for specific hardware, making it less portable 2) Most likely, you should implement the most common operations that you think will need in the near future. You will probably want addition/subtraction, multiplication/division, negation(if you plan on supporting signed numbers) and possibly some bit-wise operations if you think they are valuable(bitwise AND,OR,XOR). These should probably get you 95% of your use cases unless you are needing to do something unusual with the 128 bit number. To my knowledge, there is no built-in way of handling new data types as there is no way the compiler could determine how the basic operations should be performed. The compiler couldn't determine if you wanted a 128 bit long integer VS a 4x4 matrix of 8-bit number multiplication for example. Hope this helps, -Paul On 1/20/2010 10:16 AM, Ruben Rios del Pozo wrote: Thank you Arik for your quick answer :-), But basically you will still have to write a function. Although I don't see a problem in that: void AddTwo128BitNumbers(VeryBig first, VeryBig second, VeryBig *result); Either I see a problem in writing such a function at first but if I look at it a little bit more in detail, there are a few things that make me feel unconfortable: 1.- Dealing with overflows and that kind of stuff 2.- Now is addition but maybe tomorrow I need a division or any other arithmetic operation That's why I was wondering if there was a built-in way of handling this. Once more, thank you! ___ 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] Can not display data in mote-PC serial communication
Jennifer, There are two main ways you can decode the packet. 1) At the mote by pulling out the data and pushing it to the serial port using printf, and the net.tinyos.tools.PrintfClient tool. 2) At the computer, decode the raw packet after receiving it using the SerialForwarder/net.tinyos.tools.Listen tool. Each one has it's own advantages/disadvantages. It sounds like you are trying to do #1. If you using the BaseStation code as a base for you program, make sure you remove any code that forwards messages received over the air to the serial port. In your receive event on the mote, all you have to do is add something like this: printf(Counter Value: %u\n, cval); printfflush(); Where cval is your desired uint16 value. It is important to flush the printf buffer frequently because it will not automatically start flushing the buffer until it is 1/2 - 2/3 full(which can make debugging difficult) . I normally manually flush the printf buffer every time I make a call to printf so I see the output immediately on the console. -Paul On 1/20/2010 3:56 PM, Jennifer Pink wrote: Hi, Hi, In fact, i'm talking about the standard message buffer message_t . you know that the values of the counter represent the data filed so, my question is how to recover this data and display it with printf ? this is the structure of the message layout typedef nx_struct test_serial_msg { nx_uint16_t counter; } test_serial_msg_t; thanks in advance Jennifer From: sapoj...@gmail.com Date: Wed, 20 Jan 2010 21:00:41 +0200 Subject: Re: [Tinyos-help] Can not display data in mote-PC serial communication To: asma_...@live.fr CC: tinyos-help@millennium.berkeley.edu Your explanation is a bit foggy. Where exactly the problem is? After which step? What does work?. Arik On Wed, Jan 20, 2010 at 17:41, Jennifer Pink asma_...@live.fr mailto:asma_...@live.fr wrote: Hi all, I'm using tinyos-2.x on windows Xp. I tryed to follow the tutorial mote-PC serial communication and serial forwarder and every thing was ok. Now i want to display data from mote on my PC. when executed the TinyOS printf library in http://docs.tinyos.net/index.php/The_TinyOS_printf_Library it works very well but i can not integrate it in the mote Pc serial communication to display JUST the data that i sent. does any one know how to do that ? i need your help please. Regards, Jennifer Avec Internet Explorer, surfez en toute discrétion sur internet Cliquez ici ! http://clk.atdmt.com/FRM/go/182932252/direct/01/ ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto:Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- Best Regards, Arik Sapojnik sapoj...@gmail.com mailto:sapoj...@gmail.com Discute avec tes amis partout, grâce à Messenger sur ton mobile. Cliquez ici ! http://www.messengersurvotremobile.com/ ___ 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] Change default transmission power RF230 (IRIS MOTE)
Abhijeet, I've looked at the RF230 manual, and 0xF is the lowest power setting. If this transmission range is not low enough, then the only thing I can think of that you can do is attenuate the signal at the antenna. You could try either covering the antenna in tin foil, or removing the antenna altogether. -Paul Abhijeet Singh wrote: Hello, i was able to make it work. There was a change in RF230LayerP.nc / RF230DriverLayerP.nc, after which the problem was resolved. http://mail.millennium.berkeley.edu/pipermail/tinyos-2-commits/2009-March/008561.html The transmission power range for RF230 is (0-15) or (0x0 to 0xF) according to the RF230 manual. the minimum power does not serve my application. is it possible to reduce it further? Abhijeet *From:* Abhijeet Singh abhijeet...@yahoo.co.in *To:* tinyos-help@millennium.berkeley.edu *Sent:* Thu, 14 January, 2010 2:43:30 PM *Subject:* [Tinyos-help] Change default transmission power RF230 (IRIS MOTE) Hello, I have gone through the mailing archive and read about changing the TX power for RX230 radio. There seems to be two ways. My application requires a reduced default TX power for the RF230 radio. I do not want to change it on a per packet basis. adding PFLAGS+=-DRF230_DEF_RFPOWER=15 to my Makefile, does not work. I went ahead and changed the RF230_DEF_RFPOWER value to 15 in HplRF230.h, which also does not work. I am using the BlinkToRadio application to verify if the transmission power is getting reduced. Changing the default power on my Micaz mote (CC2420 radio) worked and i could confirm it using the BlinkToRadio application. any suggestions what i am doing wrong? Thanks in advance Abhijeet The INTERNET now has a personality. YOURS! See your Yahoo! Homepage http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/. The INTERNET now has a personality. YOURS! See your Yahoo! Homepage http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/. ___ 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] Do events preempt other events?
Mido, In general, there is no preemption of any kind in vanilla tinyos. There are interrupts which can disrupt the normal execution of a program, these are usually denoted by the async keyword. There is only a single thread of execution so if one event or task takes a very long time, it will delay other tasks. If you want to execute a very long computation (without backlogging events) it would be best to split it up into many different parts and execute each one as a task. That way the task is executed as soon as processor becomes idle. You may want to reference http://docs.tinyos.net/index.php/Modules_and_the_TinyOS_Execution_Model for more details. There have been some attempts at preemption: http://www.tinyos.net/scoop/story/2007/7/9/10921/69539 and TOSTHREADS are among them if preemption is required for your purposes. -Paul On 1/2/2010 12:12 PM, Mido wrote: Hi, I'd always assumed that events can preempt events. For example, in the below code, the event AMSend.sendDone should preempt Timer1.fired (as Timer1.fired runs for a long time). However, this is not happening. Things do not change when I move the code inside Timer1.fired to a task, and post this task from Timer1.fired. So, do events preempt other events? One more question: Section 1.2.1 of the TinyOS programming book (2nd edition), mentions Low-level interrupt code. How can I find the interrupt code that is related certain events such as Timer.fired, AMSend.sendDone, and Sensor.readDone. Thanks. event void Boot.booted() {call AMControl.start(); } event void AMControl.startDone(error_t err) {if (err == SUCCESS) {call Timer0.startPeriodic(900); call Timer1.startPeriodic(1000); } else {call AMControl.start();} } event void AMControl.stopDone(error_t err) { } event void Timer0.fired() { if (!busy) { BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)(call Packet.getPayload(pkt, NULL)); btrpkt-nodeid = TOS_NODE_ID; btrpkt-counter = counter; if (call AMSend.send(AM_BROADCAST_ADDR,pkt, sizeof(BlinkToRadioMsg)) == SUCCESS) {busy = TRUE;} } } event void AMSend.sendDone(message_t* msg, error_t error) { if (pkt == msg) {busy = FALSE;}} event void Sensor.readDone(error_t result, uint16_t data) {} event void Timer1.fired() { t=269;p=40; for (t=0;t100;t++){for (i=0;i1;i++){n+=p;n=0;n*=p+5;}}call Leds.led0Toggle(); } ___ 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] MICAz radio: CC2420 or MPR2400?
Vikram, The micaz uses the CC2420 radio (the tmote sky also has the cc2420). In general, I wouldn't be surprised that different hardware sees different transmission ranges, even for identical radio hardware. There are probably a dozen different reasons why the devices have different transmission ranges. After looking at the datasheets for both, the most apparent difference is the inclusion of an internal antenna for the tmote sky versus an external antenna in the micaz. There are other reasons that even the same hardware but different transmission radii, for example if the impedance matching network is not created correctly, then there will be a large VSWR (Voltage standing wave ratio). Basically, a large portion of the transmitted signal is reflected as it propagates from the radio to the antenna, reducing the signal strength. It may very well be the case that the antenna radiation patterns are also very different. Even changing the orientation of the identical devices can result in drastically different results for the same hardware. So it's hard to say for certain what the actual cause is. -Paul On 12/30/2009 5:37 AM, Vikram vik76 wrote: Hello, I would like to know what is the radio that is used by the MICAz motes? Is it CC2420 or MPR2400 ? and what are the differences between them? I want to set the transmission power to a very low value. I used CC2420_DEF_RFPOWER for values 1 and 2. I was surprised to see that for the value of 1 the transmission range is about 7-10 cms. Whereas for the tmote sky for the value of 1, it is about 20-30 cms. Thanks Vikram ___ 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] Sending multiple messages in one shot
Vikram, In general, each instance of the AMSenderC component only supports a queue of 1 message. So just calling send() twice will likely result in some failure. I haven't actually tried this myself (nor have easy access to the code right now), so i don't know if the 2nd send will return an error or what the exact end result would be. One way to send two messages is to queue up the first message in the sendDone() event that is called after the first send() call. You must be careful to make sure that the sendDone event is for the first message you sent. There are queue data structures available in tinyos 2.x so if you wanted to create your own component, you may want to start from there. It is also likely that someone else has implemented this feature (for certain protocols I'm sure it's been implemented, but I don't know of any generic component that has been built. You may want to check out the contrib directories in the cvs checkout. Another option is to look at your platform-specific implementation of AMSenderC and see how it manages its queue. With some minor modifications, you could create your own component that supports an arbitrary queue size. -Paul On 12/29/2009 12:57 AM, Vikram vik76 wrote: Hello, How do I send multiple messages ( say two messages) one after the other? The send statements in my code are one after the other. Is there any queuing in tinyos which will take care of this automatically? Because, when the second message is sent, the first message may still be using the radio. Thanks Regards Vikram ___ 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] Help required: conversion of AT commands to nesC
Sandhya, I've done some similar work with embedded systems interfacing with GSM modems using RS-232(serial) connections. Basically what I had to do was create my own interface to the GSM modem using AT commands. The micaz platform has an RS-232 connection (the connection is usually obtained by using a mib510/mib520 gateway) which you can use to send AT commands to the GSM modem. One of the first things you will need to do is create your own component for TX/RX plain text (ASCII) over the serial port. The issue is that by default, tinyos sends/receives ActiveMessage Packets over the serial port, just as if it had sent/received that message over the wireless link. You will need to change this so that you use ASCII over the serial. Once you do this, it's simply a matter of creating the required interface that will properly initialize the GSM modem, open TCP/UDP sockets, and sending information over the serial port using at commands(ie: ATD, AT+REBOOT, etc.) Whatever GSM modem you decide to use, it should have a user manual defining all of the AT commands it supports. Several important commands to look for that will make your life easier: Echo -- when this is disabled, the serial port will no longer echo AT commands sent by the mote(enabling this when using hyperterminal/gtxterm makes your life easier, but when programatically sending commands, you don't need this as it makes parsing the mote's RX serial information that much harder), verbose -- This command may/may not be available, it will simplify the result of the AT command. Normally when you execute an AT command you might get a response back like OK or OK\r\nip address: xxx.xxx.xxx.xx with verbose set to the lowest setting, most results are shortened to an integer value, which makes parsing command/responses easier. Certain commands have timing constraints. For example if you have opened a TCP socket, any serial output is redirected over the TCP socket. If you need to temporarily pause the connection and run another AT command. For my GSM modem, the key command was +++. A good GSM modem user guide should have this information documented, however. Good luck with your endeavor, -Paul On 12/29/2009 4:21 AM, Sandhya Sourirajan wrote: Dear Sir/ Madam, I am Sandhya Sourirajan doing my final year, B.E- EEE in Coimbatore Institute of Technology. I am currently doing a project involving Wireless Sensor Networks using the Crossbow's micaz motes for building an intrusion detection system. I checked out the Wireless Sensor Networks REsearch group website and learnt about the developments in this field by sending messages through GSM modules. However no infomation on furnished on interfacing the GSm modules with motes and the conversion of the AT command set to nesC. We would be using GSM modules in our project and the gateway is connected to the GSM module using a suitable connector. The AT commands for the GSM modules have to be written in nesC.As we are naïve to TinyOS and nesC, we have very little idea about the conversion of the AT commands to nesC. Could you please tell us about the feasibility of converting the AT command set to nesC, to send the sensor data from one remote location through GSM modules. Looking forward for your reply. Thanks in advance. -- Regards, Sandhya ___ 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] Transmitter problem in Micaz
Mohammad, Yes, I believe the problem is with the actual connector that is MMCX adapter soldered to the board, i've had problems with them coming completely off the board and taking the PCB lines with them. I would first try re-soldering that piece first. If this doesn't work, then an alternative solution would be to use the through-hole connectors for the antenna. It should be located near the MMCX connector. Using the through-hole connectors may be a little bit tricky since the antennas have an MMCX connector attached to the end. You may want to try making a very simple dipole(you won't get as good of a performance as the actual antenna because of impedance mis-matching) using a wire of the appropriate length, or you can use one of the female MMCX connectors to interface with the through-hole connector and the existing antenna. Let me know what happens, -Paul On 12/22/2009 10:23 PM, Mohammad S. Hashemian wrote: Thanks Paul, you're right, most likely the problem is with the antenna. But the point is that as you know for Micaz, the antenna is a 2.4 ghz pcb antenna! how can I re-solder it? by now I've cut the antenna of one of the motes totally and re-soldered it, but it didn't work and also I resolder another mote (without cutting the antenna first, just by adding more solder to it board), but it didn't work either! any suggestions how can I do it? And also do you think if the problem is with the connection between MMCX female part and board or the female part itself is damaged? (the antenna should be fine, I tested it by changing a new mote's antenna with a damaged one, and it still was working fine)! thanks again for your help, Mohammad 2009/12/22 Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com Mohammad, One thing you may want to check out is the antenna connection to the micaz board. The board-mounted connector can be pretty fragile and can be easily broken off if the antenna catches on anything, or you attempt to remove the antenna by pulling at an angle. What I would do is try to re-solder the antenna one one of the boards that are malfunctioning and see what happens. 10cm is about the range I've seen micaz/mica2 nodes work w/out an antenna connected at all, so the antenna is likely the cause of this problem. Hopefully re-soldering the connections fixes this and you don't have to buy new boards, -Paul On 12/22/2009 4:53 PM, Mohammad S. Hashemian wrote: Hi All We have run a project using micaz modules. In this project there are 8 nodes which are fixed in a certain locations and 40 nodes which are carried by different people (some of these motes are in XBow boxes and some other are just in small pouches). There are 3 motes which are used as base stations through the environment. The problem we have now is that the transmitter of the mobile motes gets damaged after a while. For example we pick a new mote out of the pack, program it, and give it to one of the people, after a while (sometimes even after 3 days!!!) the transmitter (either sender or receiver) stops working. I realize the transmitter of a mote has stopped working when I don't receive any signal from it for a couple of days. In this case I test the mote with CountSend and CountReceive (shipped with XBow MoteWorks) against another new mote. Usually the result is that either the sender part or receiver part of the mote has become so weak that the packet can be transferred only if the motes are less than 10 cm away!!! further than that the packet either can not be sent or be received. I've called the company regarding this issue and they told me if the mote doesn't work with CountSend and CountReceive, you should send them back here for diagnosis and because by now they are out of warranty, it costs 100$ per each for diagnosis (The motes have been bought more than a year ago, but they haven't been used at all). On possibility was that the motes that we got have been produced using a bad batch in the manufacture for transmitter, and that's why they keep dying in work. But it's not very likely because the problem is just exist with the mobile ones, not with the base stations or with the fixed motes. Also the currently used motes have been purchased in two separate orders, and probably two separate manufacturing series. The other possibility is that they die because of the static electricity (people are supposed to change the mote's battery every couple of days). Can it be a reason? But this even happens for the mobile motes with XBow boxes which they look safe for this. and if it's the reason, why just the transmitter gets damaged and no other part in the mote? By now we have lost more than 30 micaz motes this way and if it wants to continue we will much more. Does anyone has any
Re: [Tinyos-help] can not run Tinyviz with Tinyos 2.1
Rachel, As you suspected, TinyViz is not supported for tinyos 2.x. You will need to use tinyos 1.x if you want to use TinyViz. -Paul On 12/23/2009 6:47 AM, Rachel Bernard wrote: Hi all, /I am using tinyos 2.1 on winXp with cygwin/ /I want to use TinyViz for stimulating the sensors./ //In the//directory /opt/tinyos-2.1.0/support/sdk/java/net/tinyos/sim/, there is// /only 3 files, Makefile, package.html and Linklayer. There is no //SimDriver.jar file to install tinyviz. I tried the instructions on lesson 5/ /but cygwin indicated that tinyviz and build are commands not found !!!/ //Can anyone suggest me some solution to//run TinyViz?/ / / /or is it true that tinyviz does not work with tinyos 2.x ???/ /i really need your help/ /regards,/ / / /Rachel Bernard// / / Gratuit : Hotmail plus rapide avec Internet Explorer 8 ! Cliquez ici ! http://www.microsoft.com/france/windows/products/winfamily/ie/ie8/msn/default.aspx ___ 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] Transmitter problem in Micaz
Mohammad, One thing you may want to check out is the antenna connection to the micaz board. The board-mounted connector can be pretty fragile and can be easily broken off if the antenna catches on anything, or you attempt to remove the antenna by pulling at an angle. What I would do is try to re-solder the antenna one one of the boards that are malfunctioning and see what happens. 10cm is about the range I've seen micaz/mica2 nodes work w/out an antenna connected at all, so the antenna is likely the cause of this problem. Hopefully re-soldering the connections fixes this and you don't have to buy new boards, -Paul On 12/22/2009 4:53 PM, Mohammad S. Hashemian wrote: Hi All We have run a project using micaz modules. In this project there are 8 nodes which are fixed in a certain locations and 40 nodes which are carried by different people (some of these motes are in XBow boxes and some other are just in small pouches). There are 3 motes which are used as base stations through the environment. The problem we have now is that the transmitter of the mobile motes gets damaged after a while. For example we pick a new mote out of the pack, program it, and give it to one of the people, after a while (sometimes even after 3 days!!!) the transmitter (either sender or receiver) stops working. I realize the transmitter of a mote has stopped working when I don't receive any signal from it for a couple of days. In this case I test the mote with CountSend and CountReceive (shipped with XBow MoteWorks) against another new mote. Usually the result is that either the sender part or receiver part of the mote has become so weak that the packet can be transferred only if the motes are less than 10 cm away!!! further than that the packet either can not be sent or be received. I've called the company regarding this issue and they told me if the mote doesn't work with CountSend and CountReceive, you should send them back here for diagnosis and because by now they are out of warranty, it costs 100$ per each for diagnosis (The motes have been bought more than a year ago, but they haven't been used at all). On possibility was that the motes that we got have been produced using a bad batch in the manufacture for transmitter, and that's why they keep dying in work. But it's not very likely because the problem is just exist with the mobile ones, not with the base stations or with the fixed motes. Also the currently used motes have been purchased in two separate orders, and probably two separate manufacturing series. The other possibility is that they die because of the static electricity (people are supposed to change the mote's battery every couple of days). Can it be a reason? But this even happens for the mobile motes with XBow boxes which they look safe for this. and if it's the reason, why just the transmitter gets damaged and no other part in the mote? By now we have lost more than 30 micaz motes this way and if it wants to continue we will much more. Does anyone has any idea what can be the reason and how we can stop it? Any idea is highly appreciated. Thanks, -- Mohammad S. Hashemian Research Scholar/DISCUS Lab Department of Computer Science 254.2 Thorvaldson Building University of Saskatchewan (306)966-1947 ___ 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] tossim link gain value
Viktor, You should look up some resources on free space loss/propagation models. They will give you a starting place on modeling gain or in reality, attenuation as a result of distance. The basic calculations will be something like this: Gain(dB) = TX Antenna/Power Gain(dB) + DistanceLoss(in dB, should be negative) +RX Antenna Gain(dB). In an ideal world, antennas are isotropic(perfect omnidirectional antennas), so they would contribute negligible to the calculation.(note: ideal_world != world_we_live_in). Therefore TX Antenna/Power Gain will only be determined by what transmission power level you select, and RX Antenna Gain would be be 0 dB. Then DistanceLoss is the only real unknown and you can use the formulas found for a Free Space Loss Propagation model. The TOSSIM gain is simply TX Power(which is selected by you) + DistanceLoss. Hope this helps, -Paul Viktor Zsoldos wrote: Hi, http://docs.tinyos.net/index.php/TOSSIM#Configuring_a_Network says *|add(src, dest, gain)|*: Add a link from /src/ to /dest/ with /gain/. When /src/ transmits, /dest/ will receive a packet attenuated by the /gain/ value. How can I decide/calculate the normal, common gain values? For example for micaz datasheet says the TX power is -24dB - 0dB, the receive power is -94dB. Let's say the distance between 2 nodes is 20 meters, no obstacles, or heavy noises. What is the method? Thanks! Viktor ___ 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] MTS400 sensor board
Faisal, When possible, please search the archives of the mailing list before posting a question. It is very likely that someone has already asked that question and gotten a response back. See http://old.nabble.com/Fwd:-Need-Help-With-TInyos2.0-in-MTS400-Sensorboard-td23702024.html for more details about your question. -Paul Faisal Aslam wrote: Hi, In the directory (http://tinyos.cvs.sourceforge.net/viewvc/tinyos/tinyos-2.x/tos/sensorboards/) there are no sensorboard for MTS400? Can someone please tell that what location is its implementation? ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Disable / Enable Transmit module periodically
Vikram, I did a brief search through the nesdoc, and I don't believe this is currently implemented (being able to temporarily disable transmissions and re-enable them for any module interfacing with the radio). If you wanted this functionality, you would need to implement it yourself. -Paul Vikram vik76 wrote: Hello, How do I Disable / Enable Transmit module periodically for Telosb / MicaZ motes? Thanks and regards Vikram ___ 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] TestSerial Problem on Mac OS X
Isa, There can be many reasons why a mote doesn't receive a packet. Some information about your setup would help us in debugging your problem. What motes are you using, where the motes are located, etc, would be helpful in trying to figure out why the nodes aren't able to communicate. For example, if you are using 900 MHz mica2 motes with mib520 gateways, then it's likely that you forgot to tune the radio to a supported frequency as by default, tinyos tunes the radio to a 433 MHz frequency. -Paul Isabelle Hang wrote: Hi, first, I want to thank for the great tutorial Installing tinyos-2.x on Mac OS X. It was really helpful! I just have a problem with the output of the java application TestSerial. I got serial@/dev/tty.usbserial-XBQ0V814A:57600: resynchronising Sending packet 0 Sending packet 1 Sending packet 2 So, the received packets are obviously lost or non existent. After reading previous postings, I checked the on/off switch and it is OFF. Can anybody help me to find the problem? Thanks, Isa ___ 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] TestSerial Problem on Mac OS X
Isa, Do you only have one micaz mote flashed and running? If so, then it's not surprising that you are not receiving any messages like the tutorial displays. You must have another micaz mote running the same program before you will see the received ... lines using TestSerial. That line denotes that the mote successfully decoded a message sent over the air. -Paul Isabelle Hang wrote: Hi, sorry, here are the details of my setup: I have a 7,37MHz micaz mote on a mib510 gateway connected via usb to an Apple Computer (Mac OS X 10.4.11). The Blink application is running well, but the java application TestSerial (as mentioned in the tutorial) does not work as it should. Thanks a lot, Isa --- Isa, There can be many reasons why a mote doesn't receive a packet. Some information about your setup would help us in debugging your problem. What motes are you using, where the motes are located, etc, would be helpful in trying to figure out why the nodes aren't able to communicate. For example, if you are using 900 MHz mica2 motes with mib520 gateways, then it's likely that you forgot to tune the radio to a supported frequency as by default, tinyos tunes the radio to a 433 MHz frequency. -Paul Isabelle Hang wrote: Hi, first, I want to thank for the great tutorial Installing tinyos-2.x on Mac OS X. It was really helpful! I just have a problem with the output of the java application TestSerial. I got serial@/dev/tty.usbserial-XBQ0V814A:57600: resynchronising Sending packet 0 Sending packet 1 Sending packet 2 So, the received packets are obviously lost or non existent. After reading previous postings, I checked the on/off switch and it is OFF. Can anybody help me to find the problem? Thanks, Isa ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-he lp ___ 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] Multi Threading in TinyOS 2.x
Vikram, Look at TOSTHREADS: http://docs.tinyos.net/index.php/TOSThreads_Tutorial It provides some very basic multithreaded features to tinyos. -Paul On 12/13/2009 4:20 AM, Vikram vik76 wrote: Hello, I would like to know whether we can develop multi-threaded programs using nesC and run them on motes with tinyos 2.x. Thanks Vikram ___ 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] why mica2 radio range is just 9 meters in outdoor environment?
Zhao, My first thought, from running my own experiments is that it has something to do with the transmission power. 9 m is about what I would see with the mica2 in 900 MHz(it uses the same hardware as 433 MHz, but a couple capacitor values are different) when i set the transmission power to 0x02 (which by the data sheet should be -20 dBm). However, there can be many reasons why the transmission range is short. Are there any obstructions between the two motes? Are you using the 433 MHz antennas (they should be somewhere around 17 cm long, I don't remember off-hand, but the 900 MHz whip antennas are approximately 8 cm long)? Are the antennas oriented vertically on both motes? Are you aware of any other devices operating in the 433 MHz frequency range? If the the motes are battery powered, are they running low? How are you setting the frequency, are you manually tuning or using a preset? (If you are manually tuning, i recommend using one of the 433 presets for control purposes) A couple of things I would recommend you try: 1) Try using the default power level (0x80) - hex, not decimal and see what range you achieve. When chaning the power level, make sure you only use values listed on the CC1000 data sheet, otherwise you might get unexpected results. i.e. Going from 0x0F to 0x10, you will actually see a decrease in transmission power. 2) Try a different pair of motes, it is possible that one or both of the motes you used have hardware problems. The antenna connector might not be fully soldered on, etc. 3) Try the experiment in another location Hope this helps, -Paul On 12/10/2009 6:08 AM, Zhao Stephen wrote: Dear all I just test the rf coverage of mica2 in outdoor. two mica2 nodes are used, one is transmitter and the other is receiver. But the maximum range is around 9 meters, beyond that the receiver has no response. It is normal? In my setting, mica2 use 434Mhz and CC1000ControlM.SetRFPower(255). Why? Thanks ___ 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] why mica2 radio range is just 9 meters in outdoor environment?
Hex or decimal doesn't matter, it's the same in the end, but since the CC1000 datasheet specifies the TX power in hex, I always refer to it in hex, that way there is less likelihood of an error occurring during conversion. The RF Power only matters for transmissions, it will have no effect when the radio is in RX mode. -Paul On 12/10/2009 10:28 AM, Zhao Stephen wrote: Dear Paul, Many thanks for your help. Do you mean to set hex digits in SetRFPower()? It is interesting, do you think it can not recognize decimal digits? I should use SetRFPower(0xFF) on both receiver and transmitter? Maybe it is no use for receiver. Best Zhao 2009/12/9 Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com Zhao, My first thought, from running my own experiments is that it has something to do with the transmission power. 9 m is about what I would see with the mica2 in 900 MHz(it uses the same hardware as 433 MHz, but a couple capacitor values are different) when i set the transmission power to 0x02 (which by the data sheet should be -20 dBm). However, there can be many reasons why the transmission range is short. Are there any obstructions between the two motes? Are you using the 433 MHz antennas (they should be somewhere around 17 cm long, I don't remember off-hand, but the 900 MHz whip antennas are approximately 8 cm long)? Are the antennas oriented vertically on both motes? Are you aware of any other devices operating in the 433 MHz frequency range? If the the motes are battery powered, are they running low? How are you setting the frequency, are you manually tuning or using a preset? (If you are manually tuning, i recommend using one of the 433 presets for control purposes) A couple of things I would recommend you try: 1) Try using the default power level (0x80) - hex, not decimal and see what range you achieve. When chaning the power level, make sure you only use values listed on the CC1000 data sheet, otherwise you might get unexpected results. i.e. Going from 0x0F to 0x10, you will actually see a decrease in transmission power. 2) Try a different pair of motes, it is possible that one or both of the motes you used have hardware problems. The antenna connector might not be fully soldered on, etc. 3) Try the experiment in another location Hope this helps, -Paul On 12/10/2009 6:08 AM, Zhao Stephen wrote: Dear all I just test the rf coverage of mica2 in outdoor. two mica2 nodes are used, one is transmitter and the other is receiver. But the maximum range is around 9 meters, beyond that the receiver has no response. It is normal? In my setting, mica2 use 434Mhz and CC1000ControlM.SetRFPower(255). Why? Thanks ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto: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 mailto: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] MAC acknowledgments
Wenjie, I believe you are correct. I probably should have verified this by looking at the code before making the statement. I had previously read through that code, and gotten the idea that sendDone(SUCCESS) was only signaled after an ack is received, but i guess i missed that case. It does signal sendDone(SUCCESS) when it receives an expected ack as originally thought in the function CC2420Receive.receive() in CC2420TransmitP. Whether the current implementation is the desired behavior is another question altogether. -Paul Wenjie Zeng wrote: Paul: I found statement not entirely true in T-2.1. Once the sender receives an ack for this packet(with the ACK field set), only then will the sendDone function be called. In /CC2420TransmitP/, /S_ACK_WAIT /is the state for waiting for a pending ACK. However, after the back off timer fires in /BackoffTimer.fired()/, it still fires a /signalDone(SUCCESS)/ even if the system state is still in /S_ACK_WAIT/, i.e. even if Receive.receive has not received an ACK and set msg_metadata-ack to TRUE. I traced the sendDone event upward through the stack and found out that none of the upper level components actually checks the /PacketAcknowledgements.wasAcked()/ flag before they sends a sendDone() to the upper level. As a result, I think for the 2.1 implementation, the CC2420 stack will fire a sendDone with SUCCESS either earlier if a ACK is received or later until the BackoffTimer fires. So, the only way to really make sure if a packet has been is to check /PacketAcknowledgements.wasAcked()/. However, I'm not 100% sure about this. Can someone confirm on this? Vikram, It's probably best to look at the code yourself to determine if your platform turns on acks by default or not. In general it is radio hardware specific, for example the CC1000 doesn't perform MAC level acks. Other hardware such as the CC2420 have mac acks enabled by default for unicast packets and disabled on broadcast packets. As for your first question, normally acks are only enabled for unicast packets.(If they were enabled for broadcast packets, all the acks from multiple receiving nodes would likely collide) For your second question the requestAck() function sets a field in the packet header that indicates the sender requests an ack for this packet. In general only when the intended node receives a packet with this field set, will it send an ACK. Once the sender receives an ack for this packet(with the ACK field set), only then will the sendDone function be called. -Paul On Mon, Dec 7, 2009 at 9:53 PM, Vikram vik76 vik76 at sify.com https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help wrote: Hello, I would like to understand better the working of acknowledgments in tinyos. First, Is MAC level acknowledgment implemented by default? for Unicast or Broadcast? I also used the PacketAcknowledgements interface. When I use call PacketAcknowledgements.requestAck(pkt) does it explicitly request the receivers to send an acknowledgement, or it just captures the acknowledgement that is sent by default by the receiver to the sender? Thanks Vikram Best regards, -- Wenjie Zeng ___ 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] MAC acknowledgments
Vikram, It's probably best to look at the code yourself to determine if your platform turns on acks by default or not. In general it is radio hardware specific, for example the CC1000 doesn't perform MAC level acks. Other hardware such as the CC2420 have mac acks enabled by default for unicast packets and disabled on broadcast packets. As for your first question, normally acks are only enabled for unicast packets.(If they were enabled for broadcast packets, all the acks from multiple receiving nodes would likely collide) For your second question the requestAck() function sets a field in the packet header that indicates the sender requests an ack for this packet. In general only when the intended node receives a packet with this field set, will it send an ACK. Once the sender receives an ack for this packet(with the ACK field set), only then will the sendDone function be called. -Paul On Mon, Dec 7, 2009 at 9:53 PM, Vikram vik76 vi...@sify.com wrote: Hello, I would like to understand better the working of acknowledgments in tinyos. First, Is MAC level acknowledgment implemented by default? for Unicast or Broadcast? I also used the PacketAcknowledgements interface. When I use call PacketAcknowledgements.requestAck(pkt) does it explicitly request the receivers to send an acknowledgement, or it just captures the acknowledgement that is sent by default by the receiver to the sender? Thanks Vikram ___ 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] RSSI in Aplication with TOSSIM
Ricardo, I've tried doing this before, and I was able to read *something* in the rssi field in the packet's metadata. However, it seemed to be off by several factors of 10 from expected values. I never looked into it further. The best thing you can do is probably enable some of the debug messages, I believe it prints at what signal strength a tossim packet was received at. You'll need to look at the code to determine the exact debug channel used for that however. -Paul On Tue, Dec 8, 2009 at 6:43 AM, Ricardo . ricardo.mas...@gmail.com wrote: Hello everyone, I know the TOSSIM can estimate the RSSI of received messages. What I can not find is how to pass the reading for the application. Basically my application needs to know the RSSI with a message has been received, it is possible do this with TOSSIM? Thanks in advance, -- Ricardo ___ 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] Improve RF listening range
Zhao, Your best bet is to look at the datasheet for the radio chip your hardware is using, and see if there are any settings for increasing sensitivity. In general though, I don't think you will be able to find anything that would significantly increase listening range. (I'm not a hardware, so please forgive me for the somewhat coarse description of how the RX works) Basically, when a radio is in the RX mode, it is first amplified by a Low Noise Amplifier(LNA). The LNA tries to boost the signal as much as possible without adding much additional noise. Once past the LNA, it goes through a demodulator. The demodulator converts the analog RF signal into a digital signal. There is some automatic gain control in the demodulator to boost the RF signal, but it is automatically set during the preamble. One major limiter of the listening range is the quality of the LNA. If the LNA boosts the signal significantly without adding much noise, then sensitivity of the device is high. However, the LNA can only boost the signal so much and during amplification, interference/noise is boosted as well. If the Signal to Noise Ratio (SNR) is very low, then the demodulator will be unable to detect the preamble in the presence of background noise, and will fail to begin decoding a transmission. Short answer: There probably is not a way to significantly improve the listening range of the RF receiver. -Paul Zhao Stephen wrote: Dear, As we know, setrfpower can modify RF transmission power. I am wondering if there is way to improve listening range of RF receiver? Thanks. ___ 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] Simulation.
Assuming you already have a tinyos 2.x distribution, then you already have TOSSIM installed. Follow the guide on the wiki: http://docs.tinyos.net/index.php/TOSSIM to set up a simulation using TOSSIM. Note that TOSSIM's support for hardware simulation (set transmission power level, ADC conversions, etc) is very limited/non-existant, so don't expect to be able to use your existing code as-is if you interact with your mote's hardware in any way. -Paul MALINI MANOHARAN wrote: Hi all, I am working with MicaZ motes. Is there any simulator other than TOSSIM for WSNs? I tried to download TOSSIM but the link was broken. Also specify the path where i have to save the downloaded simulator. Please help. I want it for my project. Thanks in advance. ___ 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] Exact Data Rate and Time to transmit on Tmotes
Somnath, There aren't really straightforward answers to your questions because they both are non-deterministic to a degree. For the first question: What data rate are you talking about? The raw number of bits(including headers/footers?) that can be successfully delivered over the air using the hardware or the number of payload bits that you can deliver? The CC2420 can support variable length payload sizes. Are you talking about the default payload size, or can modifications be made to increase it? Are there more than 1 transmitter operating on the particular channel? Is there interference from other wireless devices (baby monitors, WiFi, Bluetooth, etc)? Are the transmissions broadcast (no ack) or unicast (acks)? All of these effect the data rate. If you have the hardware, you can just run a few simple tests to get some anecdotal results, but they won't be able to fully describe every possibility mentioned. The second question also needs to be qualified. If you are using the AMSenderC, it provides fair queuing between all concurrent instances of AMSenderC. Are there any other instances of AMSenderC competing for access to the radio? How often are interrupts occurring (timer interrupts, adc done interrupts, etc)? These can significantly bog down an attempt to use the radio. How many times does the sender have to back-off because it detects that the medium is busy? As you can see there are many different variables that can impact the answers to both of your questions. Aside from some anecdotal results, I doubt anyone will be able to provide you better data than what you could achieve by experimentally determining these answers yourself using your own hardware/RF environment. Sorry I couldn't be more helpful, but the short answer is it's hard to calculate these for any generic situation, and you will get more accurate results if you test these yourself using your own hardware/software and RF environment -Paul Somnath Mitra wrote: Hello , I need the exact data rate number that is achievable on a tmote (I do not mean CC2420 data rate - which is 250 kbps). I mean the data rate that is achievable taking into account the MAC layer. I would also like to know the time to transmit [probably a formula] a packet of n bytes, from the point an application calls SendMsg.send() on the sender mote to the point where the message is received by the application layer on the receiver mote. The motes are Tmotes running TinyOS 1.15 and the Boomerang TinyOS stack from MoteIV. Thanks, Somnath ___ 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] RssiDemo for Micaz offset required ?
Akankshu, I would look at the source: apps/tutorials/RssiDemo/RssiBase, and in the java program It will tell you exactly what, if any manipulation is being performed to the value. -Paul Akankshu Dhawan wrote: Hi All I have tested the RssiDemo for Micaz motes and once the distance between the motes goes beyond 10 mts the values I get are around -45 . Now I know I should be subtracting 45.5 from this to get the dbm values. So basically I am getting around -90 dBm. I want to know is this correct ? Or is the RssiDemo giving me values in dBm itself (I read this in one of the posts on the forum)? Please confirm Thanks Akankshu -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ 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] Size of array
David, Thats the problem with using pointers to arrays. The only time you know the size of the array (unless it is a c-style string) is when you create the original array. If you want to know the size of an array, you need to either pass that value into the function, or denote the end of the array by assigning the last element to a specific value. Remember that in c, you can access memory locations outside of an array, there is no memory protection or bounds protection. If you declare int array[10] and then say array[10] = 5, you have just corrupted your memory system. In tinyos there is no memory protection, and it's very easy to overwrite kernel or other memory. (there are no segmentation faults). -Paul David Rodenas Herráiz wrote: Hi all How can I get the number of elements of an array? For example, if you have a pointer to an array of 200 elements, get this number. You can't do this with sizeof. I've also tried with sizeof(array)/sizeof(array[0]) but I don't get what I want. Regards David 49 habitantes, 49 expertos en Windows 7. Así es Sietes, ¡Visítalo! http://www.sietesunpueblodeexpertos.com/ ___ 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] Changing Radio Frequency Range.
Ruben, The datasheet isn't going to provide transmission ranges, but you can get a good estimate of the transmission range by looking at the transmission power in dBm. Lets say you experimentally determine that transmitting at power value 3 gives you a 5m transmission range. According to the datasheet, this is -25 dBm (note what the datasheet reports and actual values may vary significantly, especially at very low/high power values). What would the transmission range be at power level 7 (-15 dBm)? Remember that you can estimate signal attenuation due to distance by doubling the distance for every 6 dB of gain the signal experiences (or half the distance for every 6 dB loss). 10 dB / 6 dB = 1.67 (1.67 doubles of 5m, 2^1.67 ~= 3.17 and 5m * 3.17 ~= 15.9 m. If your transmission range for a -25 dBm signal is 5m then your transmission distance should be somewhere around 16m for a -15 dBm signal. Of course this has no consideration for multipath effects, or other obstructions. Another key assumption is that the antenna is isotropic (radiates equally in all directions), meaning that no matter how the antenna is oriented, the transmission range will be the same. This is not true, and rotating the antenna even a few degrees on any axis can result in significantly different RSS values seen at the receiver. If you have more questions about this, look at some of the resources on Free Space Loss or Free Space Propagation models. Hope this helps, -Paul Rubén Ríos del Pozo wrote: Hi Paul Vijay, I am also interested in transmission power levels and transmission range so I have been taking a look at the section Paul refers in the CC2420 datasheet. However, I cannot see much interesting information regarding transmission range. I am quite interested on these issues for indoor tracking so I need short range communications. Do any of you have any experimental data to share with me? Actually, I was quite surprised with Vijay's mail concerning radio ranges with DCC2420_DEF_RFPOWER values of 1 and 2. Thanks in advance, Ruben Paul Johnson escribió: Vijay, Please reference the CC2420 datasheet under the section Output Power Programming for more details on the programmable transmission power levels. Unfortunately, I doubt you will be able to find a transmission power level that will precisely fit your needs. The CC2420 is not going to be able to provide the transmission power level granularity that you are wanting. Each time you quadruple the transmission power(6 dB power difference), you are doubling your transmission range. The listed figures on the datasheet show the minimum power levels: 3, 7 and 11 gives -25 dbm, -15 dbm and -10 dbm respectively. You cannot rely on the fact that values 4,5,6, etc increase the transmission power linearly (or guarentee that the transmission power increases and doesn't decrease). I have done some tests on the mica2 platform which uses the CC1000 radio chip and found that going from transmission power level 0xF to 0x10, I actually saw a decrease in transmission power level. -Paul vijay sankar wrote: I am using the telos motes and tinyos1.x. I want the radio frequency range to be within 200 to 400 cm. I tried this CFLAGS+=-DCC2420_DEF_RFPOWER=1 with different values. But for a value of 1 radio range is around 15-30 cm and for a value of 2 it is around 50 cm and for a value of 3 it is going beyond 5mt. Can any one please let me know if I could set radio frequency range around 200cm. Thanks, Vijay. ___ 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 ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Need help with Maths Library
Kartik, In your local makefile add something similar to this: CFLAGS+=-lm CFLAGS is a variable that make stores and passes to ncc when it compiles. That should do it for you. Cheers, -Paul Kartik Siddhabathula wrote: Hi All, I need help with the maths library. In the tutorial, it says to pass -lm option to ncc. How am I supposed to do that? make telosb -lm doesn't work nor the various combinations. Please help, Kartik ___ 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] Changing Radio Frequency Range.
Vijay, Please reference the CC2420 datasheet under the section Output Power Programming for more details on the programmable transmission power levels. Unfortunately, I doubt you will be able to find a transmission power level that will precisely fit your needs. The CC2420 is not going to be able to provide the transmission power level granularity that you are wanting. Each time you quadruple the transmission power(6 dB power difference), you are doubling your transmission range. The listed figures on the datasheet show the minimum power levels: 3, 7 and 11 gives -25 dbm, -15 dbm and -10 dbm respectively. You cannot rely on the fact that values 4,5,6, etc increase the transmission power linearly (or guarentee that the transmission power increases and doesn't decrease). I have done some tests on the mica2 platform which uses the CC1000 radio chip and found that going from transmission power level 0xF to 0x10, I actually saw a decrease in transmission power level. -Paul vijay sankar wrote: I am using the telos motes and tinyos1.x. I want the radio frequency range to be within 200 to 400 cm. I tried this CFLAGS+=-DCC2420_DEF_RFPOWER=1 with different values. But for a value of 1 radio range is around 15-30 cm and for a value of 2 it is around 50 cm and for a value of 3 it is going beyond 5mt. Can any one please let me know if I could set radio frequency range around 200cm. Thanks, Vijay. ___ 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] unique sequence number help
NodeID can be any value that is guaranteed to be unique across all nodes. The most convenient (to set/read) is most likely TOS_NODE_ID, but there may be other values available depending on your hardware platform. Depending on your platform, you may/may not have this SerialID feature. For example, the DS2411 chip is used on some of the tmote brand motes for this purpose. -Paul Ricardo . wrote: Thanks for your response. What do you mean by NodeID, is obtained by TOS_NODE_ID, right? My problem is that I can not change this value efficiently. Worse, it is not desirable for my application to be dependent on this number that is set manually. So my idea was to have a unique number that is not manually modified. I have read here on the mailling-list that I can obtain the EUI, the unique 8bits of ZigBee module through the interface S2411, or the 64bit unique identifier through interface SerialId. The problem is that I do not find any of this interfaces in my TinyOS Souce Tree (I'm using TinyOS-2.0.2-2). I could not know why these interfaces are not available, or if have been renamed. I'm stuck in this problem, any ideas are welcome! On Sat, Nov 28, 2009 at 2:53 AM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Ricardo, It's very easy to have a unique sequence number. Just similar to what you suggested, you can combine the node's ID with the local sequence number. However, I wouldn't suggest adding the two numbers together. If you do, then you lose the uniqueness of the sequence number. Instead keep them as separate fields in the packet. The sequence number is now K,NodeID, assuming a node doesn't re-use a K value, it will be globally unique because no two nodes should have the same NodeID. Having globally unique sequence numbers is easy, totally ordering each sequence number is another matter. -Paul Ricardo . wrote: Please, anyone? Any suggestions will be welcome Hello everyone, I wonder if there is any way to send a message with a sequence number that is guaranteed to be unique across the network. For example, MacAddress + K, where K is a counter that is incremented each time that a message is sent. My mote has a RF230 radio. This is possible, or something that has a similar behavior? Thanks in advance, -- Ricardo ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto: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 ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] unique sequence number help
I'm not aware of this ICstick mote, nor of it's available hardware. In general, there is no Zigbee chip. Most motes that are compatible with tinyos have a microcontroller, radio, and built-in Analog to digital converter(ADC) for taking sensor readings. Some have an additional chip that has a unique ID permanently burned onto the chip(like the IMote series), some do not (mica2/micaz series). Most tinyos supported motes are not 100% compatible with the zigbee standards. If you need a device that is compliant with those standards, then you may want to take a look at the zigbee alliance homepage (http://www.zigbee.org/). It's easy to ensure that the TOS_NODE_ID is unique if you control the programming of each node. If you are not, and multiple people are independently programming the motes, then you cannot ensure uniqueness using TOS_NODE_ID. If your hardware does have the this SerialID chip, but software doesn't exist to read it, then you could write the hardware level instructions to fetch that value. If the hardware lacks that chip, then maybe you need to consider using different hardware that will suit your needs better if having unique IDs is crucial to the operation of your programs. Other than this, I do not think I can provide much more help in regards to this matter. Thanks, -Paul Ricardo . wrote: I am working with a ICstick Mote, but you're saying that depends on the chip, the ZigBee chip? Sorry, I did not understand... the NodeID not initialized with the value that the user wants, for example given in the Makefile? How is it guaranteed to be unique across the network? On Sun, Nov 29, 2009 at 6:54 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: NodeID can be any value that is guaranteed to be unique across all nodes. The most convenient (to set/read) is most likely TOS_NODE_ID, but there may be other values available depending on your hardware platform. Depending on your platform, you may/may not have this SerialID feature. For example, the DS2411 chip is used on some of the tmote brand motes for this purpose. -Paul Ricardo . wrote: Thanks for your response. What do you mean by NodeID, is obtained by TOS_NODE_ID, right? My problem is that I can not change this value efficiently. Worse, it is not desirable for my application to be dependent on this number that is set manually. So my idea was to have a unique number that is not manually modified. I have read here on the mailling-list that I can obtain the EUI, the unique 8bits of ZigBee module through the interface S2411, or the 64bit unique identifier through interface SerialId. The problem is that I do not find any of this interfaces in my TinyOS Souce Tree (I'm using TinyOS-2.0.2-2). I could not know why these interfaces are not available, or if have been renamed. I'm stuck in this problem, any ideas are welcome! On Sat, Nov 28, 2009 at 2:53 AM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Ricardo, It's very easy to have a unique sequence number. Just similar to what you suggested, you can combine the node's ID with the local sequence number. However, I wouldn't suggest adding the two numbers together. If you do, then you lose the uniqueness of the sequence number. Instead keep them as separate fields in the packet. The sequence number is now K,NodeID, assuming a node doesn't re-use a K value, it will be globally unique because no two nodes should have the same NodeID. Having globally unique sequence numbers is easy, totally ordering each sequence number is another matter. -Paul Ricardo . wrote: Please, anyone? Any suggestions will be welcome Hello everyone, I wonder if there is any way to send a message with a sequence number that is guaranteed to be unique across the network. For example, MacAddress + K, where K is a counter that is incremented each time that a message is sent. My mote has a RF230 radio. This is possible, or something that has a similar behavior? Thanks in advance, -- Ricardo ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto: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 mailto:Tinyos-help@millennium.berkeley.edu https
Re: [Tinyos-help] Tinyos2.x installation error
Kartik, What is happening is that your cygwin installation does not have a sym link to your shell in /bin/sh. Because of this, the msp430 tools aren't able to be installed, and thus, the next command to install the binutils fails after. To correct this type 'which sh' and figure out where your shell is located. Add a symbolic link from that location to /bin/sh. Once you do this, you should be able to complete the first task, which will correct the issues for your second command. Hope this helps, -Paul Kartik Siddhabathula wrote: Hi All, While trying to install tinyos2.x, I am getting the following errors: raghaven...@gautam ~ $ rpm -ivh msp430tools-base-0.1-20050607.cygwin.i386.rpm error: Failed dependencies: /bin/sh is needed by msp430tools-base-0.1-20050607 raghaven...@gautam ~ $ rpm -ivh msp430tools-binutils-2.16-20050607.cygwin.i386.rpm error: Failed dependencies: msp430tools-base = 0.1 is needed by msp430tools-binutils-2.16-20050607 Please help. Thanks in advance, Kartik ___ 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] Errors while using CC2420Config interface
Vikram, Please see another recent post regarding this issue. http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg30507.html Thanks, -Paul Vikram vik76 wrote: Hello, I couldn't understand and believe this. I was doing make micaz sim which gave all sorts of errors that I mentioned in the first mail of this chain. Just by chance, now I compiled using make micaz, I got no errors. Can anyone explain this to me please? Thanks and Regards Vikram On Sat, Nov 28, 2009 at 3:35 PM, Razvan Musaloiu-E. razv...@cs.jhu.edu mailto:razv...@cs.jhu.edu wrote: Hi! On Sat, 28 Nov 2009, Vikram vik76 wrote: Hello everybody, I want to use the CC2420Config interface for setting the channel using command void setChannel( uint8_t channel ); I also call the sync() and have implemented syncDone(). In my module I included the code uses interface CC2420Config; For wiring I use this code components CC2420ControlC; App.CC2420Config - CC2420ControlC; In makefile I included PFLAGS += -I$(TOSDIR)/chips/cc2420 -I$(TOSDIR)/chips/cc2420/control -I$(TOSDIR)/chips/cc2420/interfaces What platform are you using? If you use one that is using the cc2420 the above includes should already be added by the .platform config file. -- Razvan ME After doing the above I get the following errors for CC2420.h tinyos-2x/tos/chips/cc2420/CC2420.h:120: syntax error before `nx_bool' tinyos-2x/tos/chips/cc2420/CC2420.h:120: warning: no semicolon at end of struct or union tinyos-2x/tos/chips/cc2420/CC2420.h:121: syntax error before `ack' tinyos-2x/tos/chips/cc2420/CC2420.h:122: syntax error before `timesync' tinyos-2x/tos/chips/cc2420/CC2420.h:132: syntax error before `}' tinyos-2x/tos/chips/cc2420/CC2420.h:132: warning: type defaults to `int' in declaration of `cc2420_metadata_t' tinyos-2x/tos/chips/cc2420/CC2420.h:132: warning: data definition has notype or storage class Also the following errors /tinyos-2x/tos/chips/cc2420/control/CC2420ControlC.nc:62: component AlarmMultiplexC not found tinyos-2x/tos/chips/cc2420/control/CC2420ControlC.nc:73: component CC2420SpiC not found Also several other errors which I am not listing. I wonder whether I have missed some important step. Please help. ___ 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] unique sequence number help
Ricardo, It's very easy to have a unique sequence number. Just similar to what you suggested, you can combine the node's ID with the local sequence number. However, I wouldn't suggest adding the two numbers together. If you do, then you lose the uniqueness of the sequence number. Instead keep them as separate fields in the packet. The sequence number is now K,NodeID, assuming a node doesn't re-use a K value, it will be globally unique because no two nodes should have the same NodeID. Having globally unique sequence numbers is easy, totally ordering each sequence number is another matter. -Paul Ricardo . wrote: Please, anyone? Any suggestions will be welcome Hello everyone, I wonder if there is any way to send a message with a sequence number that is guaranteed to be unique across the network. For example, MacAddress + K, where K is a counter that is incremented each time that a message is sent. My mote has a RF230 radio. This is possible, or something that has a similar behavior? Thanks in advance, -- Ricardo ___ 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] How to override the MAC protocol? (Jammer implementation)
Kartik, I suggest that you take a look at the nesdoc (google tinyos nesdoc) for the platform you are developing for. By looking at the components you currently use to send messages, you can drill-down the wirings until you find the MAC implementation. Learning how to use grep to search contents of files will really help in your search. After you find the file(s) that implement the MAC, you can read its contents to determine where it performs CCA checks prior to transmitting. Hope that helps. I could search myself for your platform and find the files for you, but as the saying goes. If you give a man a fish, he will have a single meal. If you teach him how to fish, he will eat all his life. Good luck with the search. -Paul Kartik Siddhabathula wrote: Hi All, I want to over ride the MAC protocol. I want to ensure that a mote sends a message continuously without sensing the channel. In fact I would like to implement a jammer. Can anyone please tell me how to do it? Thanks in advance, Kartik ___ 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] safe error
Giorgio, I believe I know what the problem is. When you type make safe, it attempts to catch any possibly unsafe operations. Mostly this is concerned with memory access and going outside of bounds on an array, etc. In your example, the operation is not safe. If for example you did this: uint8_t oneChar = 'A'; dimImmagine(oneChar); Your function now just read some random memory location after oneChar, and compared it with 200. Now reading memory can't corrupt the kernel, or other code, but you can definitely get unpredictable values(from the read). The only safe memory actions that can be done on a pointer is reading/writing buf[0]. There is no way to determine what the memory bounds of a pointer are, so make safe is going to complain if you read/write to any other offset from a pointer. If you want this code to be safe, you need to change your function declaration to something like this: #define BUF_LENGTH 10 ... void dimImmagine(uint8_t buf1[BUF_LENGTH]); ... See this website for safe programming on tinyos: http://docs.tinyos.net/index.php/Safe_TinyOS -Paul giorgio wrote: I am trying to understand why my program sometimes block using the option safe .I use tinyos 2.1 with telosb .Why is an error the follow code ? void dimImmagine(uint8_t*buf1) { 440 if(buf1[2]==200) when I compile with the option make telosb safe RadioCImpl.nc:440: Error: Assertion will always fail in upper bound check: buf1 + (2 + 1) = buf1 + 1 Each help is very important :thank in advance Giorgio ___ 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] simulation time
Wafa, When you say the simulation takes less than X ms, how much less? Without more detailed information, it's difficult to say whether there is a problem, or you are interpreting the simulation time incorrectly. Please check out this thread on the mailing list. Hopefully it should explain some things about the simulation time. -Paul wafa jaballah wrote: Hello all, Thanks for your help, but I really sometimes ask questions that maybe seem evident. I have an application that it sends packets during 1200 ms and after that I want to stop sending and simulating and I get finally the different parameters. When I run the python file, I found that simulation takes less than 1200ms. What is the problem? In my fileC.nc, I add the following code: if(call(Timer.getNow()) 1200) { simstop =1; } And so in Python file, I have added the following code: v6 = m1.getVariable(proC.simstop) while (v6.getData() == 0): t.runNextEvent(); Any suggestions are welcome. Best Regards, ___ 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] Tinyos-1.x problem in modified AMStandard.nc
Kiraneet, As stated before, tinyos-1.x hasn't been in development for a few years, so it's unlikely that many people on the list are going to be able to give you much support. Please include at least the important code segments that you modified/created, otherwise, I can only guess in the dark about the problem. If TOSSIM is segfaulting, then it's very likely that you have some memory corruption issues. (unless there were some issues in TOSSIM for 1.x) -Paul Kiraneet sharma wrote: Hello everyone... I had asked this query earlier but since I got no reply yet..I am trying to explain the problem in detail.If someone could help me I would be really grateful. I am trying to simulate data aggregation in tinyos-1.x I have 6 nodes: 1 and 2 send their data to their leader i.e. node 3..similarly 4 and 5 send data to node 6.. after about collecting three readings nodes 3 and 6 calculate the average and send the aggregated data to base station i.e. node 0. This thing is done entirely in simulation and works well for ONE time only. After that nodes 3 and 6 continue to correctly calculate the average and send data to base station,however it is never received. The thing is that when I am trying to implement the same logic without any average calculation then it works fine. To implement this entire logic I have added a few statements in receive and send in AMStandard. So is it possible that multiple sends are done consecutively and so packet collision occurs, causing the packets to be dropped and not being received by base station? At times the program terminates with a segmentation fault ? Any pointers where should I do this averaging thing ? Where does the problem lie? Thanks a lot in advance.. Hope to hear from you.. Best regards, Kiraneet ___ 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] Send\Receive buffer
Giorgio, In general, you would need a special mote with multiple radios(or a special radio) to be able to send/receive at the same time. Even then, transmissions and receptions would need to be separated in frequency. I am not aware of any readily available motes that have this capability. I notice that you reference a CC2420 chip which comes on the telosB/micaZ line of motes. I know for a fact that these motes only have one radio, so concurrent transmission/reception is impossible on these devices. Hope this helps, -Paul giorgio wrote: Hi to all people, I have two nodes that must receive and at the same time they must send(packet lenght = 28 byte).I use the CC2420ActiveMessageC component.I have some trouble with them and I try to understand if a node that receive and send can corrupt the packet received.So what a node receive is in a different buffer than the buffer that is used to send ? Thank Giorgio ___ 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] Simulation
Giorgio, What Marcus means is that any code that does not utilize the telosb hardware can be tested in TOSSIM. So in TOSSIM, you CAN: send messages, parse messages, blink leds,perform computations, any software related task. In TOSSIM, you CANNOT: take an ADC reading from a telosB mote, utilize telosB flash, etc. Anything that does not interact with the telosB hardware (any component that is wired to a telosB component most likely uses telosB hardware) can be used. Regards, -Paul giorgio wrote: How do you do ? Giorgio On Tuesday 24 November 2009 14:28:38 Marcus Autenrieth wrote: Hi, Am Tue, 24 Nov 2009 13:57:59 +0100 schrieb giorgio giorgio.gala...@unimi.it: Hi to all, I use telosb with tinyos 2.1 and I'd Like to use simulation or debugging step. Is it possible using tossim with telosb ? No. Afaik Tossim is built around micaz. But this might be mitigable depending on what you are trying to debug. I've got TelosB Hardware too and I'm using TOSSIM to validate hardware-independent logic. Enjoy: http://docs.tinyos.net/index.php/TOSSIM Cheers,... -- Marcus. ___ 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] Problem to simulate with MTS300 components
Daniel, In general, TOSSIM doesn't simulate all mote hardware. There are functions which have not been implemented, or been implemented differently in simulation than in the real hardware. (I would bet one such case is here: /opt/tinyos-2.x/tos/chips/atm128/adc/Atm128AdcC.nc:65) One example is the printf function of tinyos. In hardware, there is a buffer that holds the printf string, and only automatically flushes it when the buffer is more than half full. If you want an immediate flush, you need to use the function printfflush(). In TOSSIM, printf always flushes immediately, and printfflush is not defined. I found that a lot of times, i had to write a lot of compiler if statements with: #ifndef Some custom define stating that we are compiling for TOSSIM ... #endif or #ifndef ... ... #else ... #endif If you want to work with both the real hardware and tossim. Just a word of warning, do not use TOSSIM as the define variable because it can muck up the build in other places that use it for a different purpose. -Paul Daniel Garcia Aubert wrote: Hi, I ´m doing a job in TinyOS 2.x installed Xubuntos. I am working on MicaZ platform that uses the component TempC MTS300 sensor, but when compiling to simulate make micaz sim gives the following error: $ make micaz sim mkdir -p build/micaz placing object files in build/micaz writing XML schema to app.xml compiling SenseHopAppC to object file sim.o ncc -c -shared -fPIC -o build/micaz/sim.o -g -O0 -tossim -fnesc-nido-tosnodes=1000 -fnesc-simulate -fnesc-nido-motenumber=sim_node\(\) -finline-limit=10 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=mts300 -DIDENT_PROGRAM_NAME=\SenseHopAppC\ -DIDENT_USER_ID=\sueko\ -DIDENT_HOSTNAME=\sueko-desktop\ -DIDENT_USER_HASH=0xa8ec4319L -DIDENT_UNIX_TIME=0x4b031de6L -DIDENT_UID_HASH=0xe92f65e4L -Wno-nesc-data-race SenseHopAppC.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 `Atm128AdcC': /opt/tinyos-2.x/tos/chips/atm128/adc/Atm128AdcC.nc:65: no match make: *** [sim-exe] Error 1 But if I compile with make micaz: $ make micaz mkdir -p build/micaz compiling SenseHopAppC to a micaz binary ncc -o build/micaz/main.exe -Os -finline-limit=10 -Wall -Wshadow -Wnesc-all -target=micaz -fnesc-cfile=build/micaz/app.c -board=mts300 -DIDENT_PROGRAM_NAME=\SenseHopAppC\ -DIDENT_USER_ID=\sueko\ -DIDENT_HOSTNAME=\sueko-desktop\ -DIDENT_USER_HASH=0xa8ec4319L -DIDENT_UNIX_TIME=0x4b03110cL -DIDENT_UID_HASH=0xcb64349dL -fnesc-dump=wiring -fnesc-dump='interfaces(!abstract())' -fnesc-dump='referenced(interfacedefs, components)' -fnesc-dumpfile=build/micaz/wiring-check.xml SenseHopAppC.nc -lm SenseHopC.nc: In function `SenseHopC$Receive$receive': SenseHopC.nc:74: warning: unused variable `valor' compiled SenseHopAppC to build/micaz/main.exe 13268 bytes in ROM 316 bytes in RAM avr-objcopy --output-target=srec build/micaz/main.exe build/micaz/main.srec avr-objcopy --output-target=ihex build/micaz/main.exe build/micaz/main.ihex writing TOS image The same occurs with the example /apps/tests/mts300/PhotoTemp/Oscilloscope Do I have a configuration problem? Thanks and regards. -- Daniel García Aubert Ingeniero Técnico en Informática de Gestión. Universidad Carlos III de Madrid. ___ 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] Mica2: compilation mote upload error
Try typing just make mica2 and see what how much RAM and Program Flash required for your program. It should be displayed at the end of the build process. If you're trying to flash the motes w/ a program that exceeds these limits, then it's very likely that you're having these issues. -Paul Ronny Stangl wrote: Hi @ all, I just received some mica2 motes from Crossbow with a MIB510CA platform. (more precisely: I use the modified hardware, named Cricket) When i try to load an application on the motes (e.g. Blink), I get the following error: ... Atmel AVR ATmega128 is found. Verifying: flash flash error at address 0x0: file=0x0c, mem=0xff ... flash error at address 0x66b: file=0x00, mem=0xff I have read a lot of articles from the Tinyos-help mailing list... but nothing works. I used: MIB510=/dev/ttyS3 make mica2 reinstall,mib510 (and yes, the ttyS3 is the port that I have to use ;-) ) or make mica2 install mib510,ttyS3 or make mica2 install mib510,com4 If I try it on this way: ./main -dprog=mib510 -dserial=/dev/ttyS3 -dpart=ATmega128 --wr_fude_e=ff --erase --upload if=main.srec The error message is program to big for the RAM or The NTVDM-CPU has detect a illegal command CS:10ad IP:019a OP:63 00 0c 94 63 I hope somebody have a solution :-) ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Where can I find a schematic of MDA320?
Haixia, I haven't been able to find them anywhere, your best be is probably contacting crossbow directly about it. -Paul Li, Haixia wrote: Hello, Paul, Thank you very much. I read the user guide, but there is a little information which cannot support to write a driver. Do you have any other ideas? I try to read the old MDA320 driver for tinyos1.x, but it's not easy without the schematic of the MDA320. Thanks and Regards, Haixia Li From: Paul Johnson [oewyn...@gmail.com] Sent: Saturday, November 21, 2009 8:58 PM To: Li, Haixia Cc: tinyos-help@millennium.berkeley.edu Subject: Re: [Tinyos-help] Where can I find a schematic of MDA320? Haixia, I'm not aware of any schematics that are available for the MDA320, but you might want to check out the MTS-MDA User guide. That should at least give you a starting place. http://www.xbow.com/support/Support_pdf_files/MTS-MDA_Series_Users_Manual.pdf -Paul Li, Haixia wrote: Hello, Where can I find a schematic of MDA320? I want to modify the old driver for tinyos1.x because I cannot find the MDA320 driver for tinyos2.x. Thanks and regards, Haixia Li ___ 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] Multicast in tinyos-2.x
Akankshu, If they are all within transmission range, most likely the best way is to perform a broadcast. If that is not possible, then most likely you need to have some sort of message queue that you process. Since AMSend.send() is a split-phase operation, when the send() command finishes, it doesn't mean that the transmission has occured. If you try to send multiple packets before the previous one calls sendDone, then it's very likely you will overwrite your previous packet, or something else unexpected can happen. You might want to check out the tinyos programer's guide here: http://csl.stanford.edu/~pal/pubs/tinyos-programming.pdf It has a section on split-phase behavior and how to write code to accomodate it. -Paul Akankshu Dhawan wrote: Hi Paul I wanted to know what is the best way to send to multiple nodes ? Can I call several AMSend.send() commands and hope they are executed in a stack ? Or Should I post the next call from inside sendDone and have some sort of recursive mechanism ? or Is there a groupID kind of system to multicast at once ? I would really appreciate your help. Thanks a lot Sincerely Akankshu Dhawan On Sat, Nov 21, 2009 at 9:58 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Haixia, I'm not aware of any schematics that are available for the MDA320, but you might want to check out the MTS-MDA User guide. That should at least give you a starting place. http://www.xbow.com/support/Support_pdf_files/MTS-MDA_Series_Users_Manual.pdf -Paul Li, Haixia wrote: Hello, Where can I find a schematic of MDA320? I want to modify the old driver for tinyos1.x because I cannot find the MDA320 driver for tinyos2.x. Thanks and regards, Haixia Li ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto: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 mailto:Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Where can I find a schematic of MDA320?
Haixia, I'm not aware of any schematics that are available for the MDA320, but you might want to check out the MTS-MDA User guide. That should at least give you a starting place. http://www.xbow.com/support/Support_pdf_files/MTS-MDA_Series_Users_Manual.pdf -Paul Li, Haixia wrote: Hello, Where can I find a schematic of MDA320? I want to modify the old driver for tinyos1.x because I cannot find the MDA320 driver for tinyos2.x. Thanks and regards, Haixia Li ___ 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] question on command interrupting
Zhao, In general there is no difference between the keywords async and sync (which is the default if you define nothing) except from where that function can be called. An async function can never call a sync function, but a sync function can call another sync function, or an async function. The async keyword is usually used to indicate that an interrupt can call this function and nothing bad will happen(concurrent modification of variables, etc), however all of that protection must be made by the programmer, and is not automatic. This link might be helpful for describing the async keyword. http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2003-June/001583.html In general, there is no preemption in the standard tinyos except for interrupts. sync functions will never preempt sync functions. It may be possible for async functions to be prempted by other async calls. If you read/modify a variable that is used in an async function without the atomic { } block, i believe the compiler will generate a warning, but I wouldn't depend on this to catch every possible race condition. Reading section 4.5 Concurrency in the tinyos programming manual should give you better insight into the differences between async and sync commands. Hope this helps, -Paul Zhao Stephen wrote: Dear all, I am reading Tinyos Programming. I am puzzled with async and sync. The following is a snatch. /commandresult_tSendMsg.send...{/ /if(!state){/ /state=TRUE;/ ///sendapacket/ /returnSUCCESS;/ /}/ /returnFAIL;/ /}/ / / /If this command were async, then it's possible between the conditional“if(!state)”and the assignment “state=TRUE”that an other component jumps in and tries to send as well./ // I think if the command is sync, it is also possible by interrupt. Right? ___ 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] random values
Wafa, You'd have to check the NESDOC for the particular component you are wiring to Random, but I am pretty sure there is a call that allows you to set the seed of the random number generator. There may also be a way to do this within the python program. -Paul wafa jaballah wrote: Hi all, I want to generate a random value in each simulation. So I do like this: rnd=call Random.rand16(); When I simulate in TOSSIM using tinyos2.x, I have the same value of rnd in each simulation. How can I do to have a different random values. Thanks ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] cc2420Packet setPower and getPower
Akankshu, The tx_power data field is part of the packet's metadata. This means that it's not transmitted when a packet is sent. Therefore, the tx_power for a received packet will always be the default value because it is only used for outgoing packets. -Paul Akankshu Dhawan wrote: Hi All I am trying to set the transmission power and then get the received message's TxPower on the MICAZ. I am setting the power as follows: call CC2420Packet.setPower(sendBuf,11); memcpy(call AMSend.getPayload(sendBuf, sizeof(local)), local, sizeof local); if (call AMSend.send(AM_BROADCAST_ADDR, sendBuf, sizeof local) == SUCCESS) sendBusy = TRUE; and then inside Receive.receive(message_t* msg, void* payload, uint8_t len) { ... txPow=call CC2420Packet.getPower(msg); printf(The received packet's Tx power is : %d\n,txPow); ... } == My wirings in the configuration file is : components CC2420PacketC; SafeC.CC2420Packet - CC2420PacketC; and inside the module file is : uses { ... interface CC2420Packet; } but on this display I keep getting the value of txPow as 0 . Can some one please guide me as to what I might be doing wrong here. Thanks a lot. Akankshu -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ 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] Set local time of each mote programmatically at boot time
Yes, you can do that, but it won't accurately model a real clock because of clock skew. In general, clocks do not run at the exact same rate, their frequency tends to drift. This drift depends on a lot of factors such as temperature, humidity, etc. In TOSSIM there is no support for clock skew. Another drawback of simulation is that it doesn't simulate processing time. This means that you will never have any jitter (the non-deterministic timing differences between receiving a packet and processing it, or preparing a packet, and sending it). These two factors are what makes time synchronization a non-trivial problem. Using TOSSIM you could check your algorithm to see if it sends messages correctly, parses received messages correctly, corrects the random offset between nodes, etc, but you will not be able to see how accurate the synchronization is using pure simulation. -Paul mojtaba raznahan wrote: I think i should solve this problem by specifying random numbers as clock offset between motes,and sim_time() as global time. On Mon, Nov 16, 2009 at 10:31 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Paul, Thanks again for your clear answers. Yes, I think like you.So due to this issue I can't test time synchronization algorithms in TOSSIM,am I right ?Or maybe there is some interface for doing this job .. ? sincerley, Mojtaba On Mon, Nov 16, 2009 at 9:58 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Mojtaba, Actually, i believe the bootAtTime is in 100's of pico seconds (10^-10) seconds. So 1024 * 10^-10 = 0.001024, and apparently sim_time_string() returns time in seconds (up to nano seconds (10^-9)). There are actually 1024 milli ticks per second, so this is why each timer fired is adding not quite 1.0 to the time. As for your other issue, this is actually by design. If a node transmits a broadcast packet, all other nodes in the transmission range will receive it at the same time. The boot times only change when the node powers up, but doesn't skew it's clock. In fact, i can't say for 100%, but I think that sim_time_string() grabs the global simulation time, and there is no local clock simulation is TOSSIM. -Paul mojtaba raznahan wrote: Hi Janos, thanks for reply. What's the meaning of this numbers ? I set the bootAtTime event as these : *t.getNode(0).bootAtTime(1024); t.getNode(1).bootAtTime(1320); t.getNode(2).bootAtTime(6000)*; And i get the time by *sim_time_string()* method and it print the boot times as this : 0:0:0.00102 and 0:0:0.00132 and 0:0:0.00600 . As i can guess 102 means 1024 MilliSec and 132 means 1320 Milil. And I set the startPeriodic at 1000 ,some thing is ambiguous.The last statement prints the time equal to 0:0:0.00142 the next statment is *Timer.startPeriodic(1000)*,but in the output when i print the time in *Timer.fired()* event, it prints the time equal to *0:0:0.976562642* and the later *0:0:1.953125142* ,* 0:0:2.929687642*, *0:0:3.906250142* what does it mean ? And also when i send a packet, the 2 other recievers get the packet at the same time!!(I've set the bootTimes differently!). Thanks, Mojtaba On Mon, Nov 16, 2009 at 7:34 PM, Janos Sallai sal...@isis.vanderbilt.edu mailto:sal...@isis.vanderbilt.edu wrote: In tossim, the node object in python has a bootAtTime method which lets you set when the mote boots. You can use this to make the local clock's offsets different from each other. By the way, TOSSIM does not simulate clock skew. This might limit the validity of the simulation results. Janos On Mon, Nov 16, 2009 at 7:55 AM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi all, I want to know how can I set the local time of each mote programmatically ? I want to set different local time for each node then test my synchronization algorithm on them. I used the LocalTime interface to get the local time but i can't set different initial local time for each node.And LocalTime interface has 2 type TMilli and TMicro but when i use TMicro then in configuration section there isn't any component provider for it! .I'm using Tinyos 2.1.0 and TOSSIM. Regards
Re: [Tinyos-help] Set local time of each mote programmatically at boot time
Mojtaba, %d in printf is used for signed 16 bit integers, you need to use %lu for 32 bit unsigned integers. -Paul mojtaba raznahan wrote: You're right, Paul,sim_time() returns an uint32_t measure.I see this number in the program : *DEBUG (0): Booted at time 1024 DEBUG (1): Booted at time 1320 DEBUG (2): Booted at time 6000 . . DEBUG (1): Timer fired at 1175691828 DEBUG (1): Timer fired at -1943585060 DEBUG (1): Timer fired at -767894652 DEBUG (1): Timer fired at 407795756 .* . . What is this negative numbers ? Is it because of overflow ? my boot times are : *t.getNode(0).bootAtTime(1024); t.getNode(1).bootAtTime(1320); t.getNode(2).bootAtTime(6000);* and I use this statement to print the time in the code : *dbg(Base,Timer fired at %d\n,sim_time());* And timer period is 1000.But when is use sim_time_string() it returns the correct form of time as I said before. Thanks, On Tue, Nov 17, 2009 at 8:51 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Yes, you can do that, but it won't accurately model a real clock because of clock skew. In general, clocks do not run at the exact same rate, their frequency tends to drift. This drift depends on a lot of factors such as temperature, humidity, etc. In TOSSIM there is no support for clock skew. Another drawback of simulation is that it doesn't simulate processing time. This means that you will never have any jitter (the non-deterministic timing differences between receiving a packet and processing it, or preparing a packet, and sending it). These two factors are what makes time synchronization a non-trivial problem. Using TOSSIM you could check your algorithm to see if it sends messages correctly, parses received messages correctly, corrects the random offset between nodes, etc, but you will not be able to see how accurate the synchronization is using pure simulation. -Paul mojtaba raznahan wrote: I think i should solve this problem by specifying random numbers as clock offset between motes,and sim_time() as global time. On Mon, Nov 16, 2009 at 10:31 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Paul, Thanks again for your clear answers. Yes, I think like you.So due to this issue I can't test time synchronization algorithms in TOSSIM,am I right ?Or maybe there is some interface for doing this job .. ? sincerley, Mojtaba On Mon, Nov 16, 2009 at 9:58 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Mojtaba, Actually, i believe the bootAtTime is in 100's of pico seconds (10^-10) seconds. So 1024 * 10^-10 = 0.001024, and apparently sim_time_string() returns time in seconds (up to nano seconds (10^-9)). There are actually 1024 milli ticks per second, so this is why each timer fired is adding not quite 1.0 to the time. As for your other issue, this is actually by design. If a node transmits a broadcast packet, all other nodes in the transmission range will receive it at the same time. The boot times only change when the node powers up, but doesn't skew it's clock. In fact, i can't say for 100%, but I think that sim_time_string() grabs the global simulation time, and there is no local clock simulation is TOSSIM. -Paul mojtaba raznahan wrote: Hi Janos, thanks for reply. What's the meaning of this numbers ? I set the bootAtTime event as these : *t.getNode(0).bootAtTime(1024); t.getNode(1).bootAtTime(1320); t.getNode(2).bootAtTime(6000)*; And i get the time by *sim_time_string()* method and it print the boot times as this : 0:0:0.00102 and 0:0:0.00132 and 0:0:0.00600 . As i can guess 102 means 1024 MilliSec and 132 means 1320 Milil. And I set the startPeriodic at 1000 ,some thing is ambiguous.The last statement prints the time equal to 0:0:0.00142 the next statment is *Timer.startPeriodic(1000)*,but in the output when i print the time in *Timer.fired()* event, it prints the time equal to *0:0:0.976562642* and the later *0:0:1.953125142* ,* 0:0:2.929687642*, *0:0:3.906250142* what does it mean ? And also when i send a packet, the 2 other recievers get the packet at the same time!!(I've set the bootTimes differently!). Thanks, Mojtaba On Mon, Nov 16, 2009 at 7:34 PM, Janos Sallai sal...@isis.vanderbilt.edu mailto:sal
Re: [Tinyos-help] Set local time of each mote programmatically at boot time
Mojtaba, As I said before, there is nothing wrong, you are interpreting the time information incorrectly. When you print sim_time() it is in 10^-9 of a second(i believe). This means that there are 10^9 ticks per second. The python function bootAtTime uses these ticks to set the boot time of the node. Your timer counts differently, it has 1024(maybe it's 1000 in TOSSIM) ticks per second(not how often it fires, but how often it changes), this means that each tick of your timer is equal to 10^9/1024 or 976,562.5(or 1,000,000 for TOSSIM) sim ticks. Since your timer ticks 1000 times before firing, you should see the first tick somewhere around 976,562,500(or 1,000,000,000) simulation time. You saw an event at *1,175,691,828. *This looks about right to me. -Paul mojtaba raznahan wrote: Paul, thanks,Yes corrected by %lu. but why between this to line of code there is a big gap ? *dbg(Control,AMControl started Successfully %lu .\n,sim_time()); if(TOS_NODE_ID == 1 ) { dbg(Base,This is the base station...ready for sending packets %lu.\n,sim_time()); call Timer.startPeriodic(TIMER_DELAY); } *In the output i have this times : *DEBUG (0): Booted at time 1024 **---it's true* *DEBUG (0): AMControl started Successfully 1124 . **---it's true* *DEBUG (1): Booted at time 1320 .**---it's true* *DEBUG (1): AMControl started Successfully 1420 .**---it's true* *DEBUG (1): This is the base station...ready for sending packets 1420. ---it's true* *DEBUG (2): Booted at time 6000 .**---it's true* *DEBUG (2): AMControl started Successfully 6100 .**---it's true* *DEBUG (1): Timer fired at 1175691828 What's wrong ? DEBUG (1): Packet sent at 1175691828 data is :2 DEBUG (2): The Packet recieved at 1195375551 and the length is : 02 and data is :7. DEBUG (0): The Packet recieved at 1195375551 and the length is : 02 and data is :7. DEBUG (1): sendDone at 1197054008. * On Tue, Nov 17, 2009 at 9:43 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Mojtaba, %d in printf is used for signed 16 bit integers, you need to use %lu for 32 bit unsigned integers. -Paul mojtaba raznahan wrote: You're right, Paul,sim_time() returns an uint32_t measure.I see this number in the program : *DEBUG (0): Booted at time 1024 DEBUG (1): Booted at time 1320 DEBUG (2): Booted at time 6000 . . DEBUG (1): Timer fired at 1175691828 DEBUG (1): Timer fired at -1943585060 DEBUG (1): Timer fired at -767894652 DEBUG (1): Timer fired at 407795756 .* . . What is this negative numbers ? Is it because of overflow ? my boot times are : *t.getNode(0).bootAtTime(1024); t.getNode(1).bootAtTime(1320); t.getNode(2).bootAtTime(6000);* and I use this statement to print the time in the code : *dbg(Base,Timer fired at %d\n,sim_time());* And timer period is 1000.But when is use sim_time_string() it returns the correct form of time as I said before. Thanks, On Tue, Nov 17, 2009 at 8:51 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Yes, you can do that, but it won't accurately model a real clock because of clock skew. In general, clocks do not run at the exact same rate, their frequency tends to drift. This drift depends on a lot of factors such as temperature, humidity, etc. In TOSSIM there is no support for clock skew. Another drawback of simulation is that it doesn't simulate processing time. This means that you will never have any jitter (the non-deterministic timing differences between receiving a packet and processing it, or preparing a packet, and sending it). These two factors are what makes time synchronization a non-trivial problem. Using TOSSIM you could check your algorithm to see if it sends messages correctly, parses received messages correctly, corrects the random offset between nodes, etc, but you will not be able to see how accurate the synchronization is using pure simulation. -Paul mojtaba raznahan wrote: I think i should solve this problem by specifying random numbers as clock offset between motes,and sim_time() as global time. On Mon, Nov 16, 2009 at 10:31 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Paul, Thanks again for your clear answers. Yes, I think like you.So due to this issue I can't test time synchronization algorithms in TOSSIM,am I right ?Or maybe there is some interface for doing this job .. ? sincerley, Mojtaba On Mon, Nov 16, 2009 at 9:58 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Mojtaba
Re: [Tinyos-help] residual energy monitoring for MICAZ
Akankshu, To the best of my knowledge there is no sure-fire way of determining how much residual energy the batteries contain. I believe the MicaZ has the ability to take ADC measurements on the battery voltage itself (using some regulated voltage as a reference). However, this won't exactly correlate with energy reserves of the battery as most batteries supply a constant voltage until they are very near the end of their reserves. Most likely the best you can do is look at the datasheets of each of the components, determine how much energy they use while on or in any other mode(varying sleep modes for microprocessor, etc) you use them in, and try to keep a running tally of your guess as to how much energy that mote has used. Using this internal tally you can make decisions based upon energy usage. With hardware diagnostic tools (Ammeter, etc) you can measure how much current the motes are drawing, and by integrating the current you can get the energy consumed. However, any low power devices are probably not going to have this functionality built-in(the micaz included). -Paul Akankshu Dhawan wrote: Hi All I want to know what is the best way to get the residual battery (energy) on the MICAZ motes ? I need to calculate this intermittently and based on the value make some decisions so I really need this. I would appreciate if someone who has worked on similar issues can guide me with this Thanks Akankshu Dhawan -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ 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] Clustering and state switching in tinyos-2.x
Akankshu, 1) if (clusterhead) { //do something } else //!clusterhead { //do something } 2) Look at the micaz NESDOC (google nesdoc)for how to turn off the receiver for the radio. The real problem you are going to run into is how does the non-clusterheads know when to become the new clusterhead if they turn off their radio. If it's timing based, you need to synchronize their clocks periodically (which requires all nodes to have the receiver enabled). If the receivers are always turned off, you will not be able receive ACKs, so the transmitting node will have no idea if it's data actually reached the clusterhead or not (this can lead to very poor PRRs at your sink). -Paul Akankshu Dhawan wrote: Hi All I am trying to implement a clustering algorithm and for that I want to make sure that the Receive mechanism applies only to the clusterhead. Regular Nodes: - samples data - Transmit packets every few seconds Clusterhead - samples the data - Receives regular node packets - processes the data (including its own as well as received) - then transmits to the base station its results Since they both have the same sampling process I want to have the same code and just switch behavior at time intervals on whether its a clusterhead or just a regular node (state maintenance). I have a question: 1. How do I make sure that the same piece of code behaves differently at different nodes depending on whether its the clusterhead or not ? How do I restrict this receive mechanism to only clusterheads ? I am basically talking about a state variable for the cluster . Please guide me Thanks Akankshu -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ 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] Set local time of each mote programmatically at boot time
Mojtaba, Actually, i believe the bootAtTime is in 100's of pico seconds (10^-10) seconds. So 1024 * 10^-10 = 0.001024, and apparently sim_time_string() returns time in seconds (up to nano seconds (10^-9)). There are actually 1024 milli ticks per second, so this is why each timer fired is adding not quite 1.0 to the time. As for your other issue, this is actually by design. If a node transmits a broadcast packet, all other nodes in the transmission range will receive it at the same time. The boot times only change when the node powers up, but doesn't skew it's clock. In fact, i can't say for 100%, but I think that sim_time_string() grabs the global simulation time, and there is no local clock simulation is TOSSIM. -Paul mojtaba raznahan wrote: Hi Janos, thanks for reply. What's the meaning of this numbers ? I set the bootAtTime event as these : *t.getNode(0).bootAtTime(1024); t.getNode(1).bootAtTime(1320); t.getNode(2).bootAtTime(6000)*; And i get the time by *sim_time_string()* method and it print the boot times as this : 0:0:0.00102 and 0:0:0.00132 and 0:0:0.00600 . As i can guess 102 means 1024 MilliSec and 132 means 1320 Milil. And I set the startPeriodic at 1000 ,some thing is ambiguous.The last statement prints the time equal to 0:0:0.00142 the next statment is *Timer.startPeriodic(1000)*,but in the output when i print the time in *Timer.fired()* event, it prints the time equal to *0:0:0.976562642* and the later *0:0:1.953125142* ,* 0:0:2.929687642*, *0:0:3.906250142* what does it mean ? And also when i send a packet, the 2 other recievers get the packet at the same time!!(I've set the bootTimes differently!). Thanks, Mojtaba On Mon, Nov 16, 2009 at 7:34 PM, Janos Sallai sal...@isis.vanderbilt.edu mailto:sal...@isis.vanderbilt.edu wrote: In tossim, the node object in python has a bootAtTime method which lets you set when the mote boots. You can use this to make the local clock's offsets different from each other. By the way, TOSSIM does not simulate clock skew. This might limit the validity of the simulation results. Janos On Mon, Nov 16, 2009 at 7:55 AM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi all, I want to know how can I set the local time of each mote programmatically ? I want to set different local time for each node then test my synchronization algorithm on them. I used the LocalTime interface to get the local time but i can't set different initial local time for each node.And LocalTime interface has 2 type TMilli and TMicro but when i use TMicro then in configuration section there isn't any component provider for it! .I'm using Tinyos 2.1.0 and TOSSIM. Regards, -- Mojtaba Raznahan BS of Computer engineering TMU university www.raznahan.com http://www.raznahan.com ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto:Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- Mojtaba Raznahan BS of Computer engineering TMU university www.raznahan.com http://www.raznahan.com ___ 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] AMSend.sendDone event isn't signaled...
Mojtaba, Glad I could help. I understand how frustrating it can be when you're first starting out. As for the text file... Basically it's a noise trace, meaning that they took Received Signal Strength (RSS) measurements over a long period of time. They use this input to train a model to generate similar (but not replaying the trace) noise values. Each time a node in TOSSIM attempts to send a packet, it first performs a CCA. This takes an RSS measurement to determine whether anyone else is transmitting at the same time. Obviously if there is another node and the link between them, TOSSIM can deal with this, but when you want to simulate interference from other devices, such as WiFi or microwaves, it uses the noise figure. This noise figure is also used to determine whether the Signal to Noise Ratio(SNR) is sufficiently high to prevent corruption of a packet in the form of bit-inversions. If this corruption occurs, TOSSIM just drops the packet (in my experience anyways) instead of flipping some bits. There are most likely academic papers describing in detail how TOSSIM uses the CPM model to generate noise values, but I'm not in the lab right now, so I can't look for any in particular that would help you out. If you don't have access to academic paper repositories like ACM/IEEE, then the best place to look is the code itself. I've found that being very good at looking for particular variables/keywords in an entire project using grep is an invaluable tool when i'm trying to understand the inner. Regards, -Paul mojtaba raznahan wrote: Paul, Thank you veryyy much!!!.It worked! I had seen this page several times but i wasn't accurate enough and so i didn't used the noise model at all. Really you gave me a big help! Thank you. But what is this numbers ? It claimed that you should use at least 100 entry of this numbers so the CPM can create the statistical model.Have you any sources to read more about this topic and it's usage ? your sincerley, Mojtaba http://www.raznahan.com ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Data rate between PC and telosb through Serial Port
Long, In general, the serial port should be able to provide that sort of datarate easily. If i remember correctly the telosB motes use 115200 baud for the serial communication. This means that you can send up to 115,200 bits/second through the serial. The data rate that you are wanting to send is 40 * 20 * 8 = 6400 bits/second (not including headers, etc). This shouldn't stress the serial port or the radio(assuming that there isn't too much interference on the channel you are using). You might want to look at how many packets/sec you see at each step (PC to mote, mote to mote, mote to PC). It most likely is not because of the serial, but because you are not generating enough packets, or for some reason you are processing packets way too slowly in your implementation. Hope this helps. -Paul Le Thanh Long wrote: Hi All, I want to communicate between 2 PCs using Zigbee on Telosb. In my application, I want to send 40 packets/second, the packet size is around 20 bytes but my program can send only around 5 packets/seconds. My program is similar to TestSerial in tutorial http://docs.tinyos.net/index.php/Mote-PC_serial_communication_and_SerialForwarder . The program will write to serial port and BaseStation running in telosb will forward it to another Telosb. I wonder what is the reason behind the slow transmission. I guess that is because of bottle neck of serial port. Can you give some hints to achieve higher data rate? Thank you and best regards, Long New Email names for you! http://sg.rd.yahoo.com/sg/mail/domainchoice/mail/signature/*http://mail.promotions.yahoo.com/newdomains/sg/ Get the Email name you've always wanted on the new @ymail and @rocketmail. Hurry before someone else does! ___ 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] AMSend.sendDone event isn't signaled...
Mojtaba, Make sure when you are setting up your links in the simulation you set up BOTH directions of the link. For example if you're trying to send something from node 1 to node 2, you need to define the gain for link 1-2 and from 2-1. Otherwise, 1 will be able to send to 2, but 2 will never respond with an ACK. -Paul mojtaba raznahan wrote: Really need your helps... Can't anybody help me ?? Does it related to simulation section ?? On Tue, Nov 10, 2009 at 10:09 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: I'm still bickering with this issue...some help plz On Tue, Nov 10, 2009 at 7:44 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: How can i make sure that the message ACK is active or not ? I have not worked with ACK yet On Tue, Nov 10, 2009 at 7:26 PM, Ricardo . ricardo.mas...@gmail.com mailto:ricardo.mas...@gmail.com wrote: I read one of the threads that the cause of the issue might be the ACK messages. ACK will arrive at the event will never be signaled. If the message ACK is active and no ACK is received sendDone is not signaled. On Tue, Nov 10, 2009 at 3:37 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi Ricardo, Thanks for reply. I wrote a dbg statement in first of sendDone event but ...the sendDone event is not signaled at all! event void AMSend.sendDone(message_t* bufPtr, error_t error) { * dbg(Base,sendDone %s .\n,sim_time_string());* if (pkt == bufPtr) { busy = FALSE; } } There isn'nt any statement to print while simulating Really confused! What's your idea ?? Does it related to Radio configuration of simulation code ?(python code ?) On Tue, Nov 10, 2009 at 6:43 PM, Ricardo . ricardo.mas...@gmail.com mailto:ricardo.mas...@gmail.com wrote: Try print the value of error_t error in sendDone event On Mon, Nov 9, 2009 at 3:53 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi, Im writing a simple application to test send and receive of motes .AMSend.send command works but AMSend.sendDone event isn't signaled after sending so the busy flag does'nt change to false. and in the next time the AMSend.send command does not return SUCCESS . this is my code : event void Boot.booted() { dbg(Boot,Booted at time %s .\n,sim_time_string()); call AMControl.start(); } event void AMControl.startDone(error_t err) { dbg(Control,AMControl started %s .\n,sim_time_string()); if(err == SUCCESS) { if(TOS_NODE_ID == 1 ) { dbg(Base,This is the base station...ready for sending packets %s.\n,sim_time_string()); call Timer.startPeriodic(TIMER_DELAY); } } else call AMControl.start(); } event void AMControl.stopDone(error_t err) { } event void Timer.fired() { if(!busy) { RbsMsg* data = (RbsMsg*) ( call Packet.getPayload(pkt,sizeof(RbsMsg))); data-count = counter; if( call AMSend.send(AM_BROADCAST_ADDR,pkt,sizeof(RbsMsg)) == SUCCESS) { dbg(Base,Packet sent %s.\n,sim_time_string()); busy= TRUE; counter++; } else
Re: [Tinyos-help] AMSend.sendDone event isn't signaled...
Mojtaba, Which node is 1 sending to and when??? I see that the node boot times are pretty far spaced apart. It could be that if you're sending from 1 to 2, node 2 is not booted up when node 1 sends, thus, it will never receive an ACK and sendDone will never be called. -Paul mojtaba raznahan wrote: Hi Paul, Thank you very much for answer. I checked out this problem,but still doen't work!! This is my simulation code and node 1 is the sender node :(Is it correct ?) #! /usr/bin/python import TOSSIM import sys import random from TOSSIM import * t = TOSSIM.Tossim([]) r = t.radio(); for i in range(0, 3): m = t.getNode(i); m.bootAtTime(503 * i + 1); r.add(1,0,-50.0); r.add(0,1,-50.0); r.add(1,2,-50.0); r.add(2,1,-50.0); r.add(2,0,-50.0); r.add(0,2,-50.0); t.addChannel(Boot,sys.stdout); t.addChannel(Base,sys.stdout); t.addChannel(Receive,sys.stdout); t.addChannel(Control,sys.stdout); for i in range(0, 1000): t.runNextEvent(); sincerley, Mojtaba On Sat, Nov 14, 2009 at 8:11 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Mojtaba, Make sure when you are setting up your links in the simulation you set up BOTH directions of the link. For example if you're trying to send something from node 1 to node 2, you need to define the gain for link 1-2 and from 2-1. Otherwise, 1 will be able to send to 2, but 2 will never respond with an ACK. -Paul mojtaba raznahan wrote: Really need your helps... Can't anybody help me ?? Does it related to simulation section ?? On Tue, Nov 10, 2009 at 10:09 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: I'm still bickering with this issue...some help plz On Tue, Nov 10, 2009 at 7:44 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: How can i make sure that the message ACK is active or not ? I have not worked with ACK yet On Tue, Nov 10, 2009 at 7:26 PM, Ricardo . ricardo.mas...@gmail.com mailto:ricardo.mas...@gmail.com wrote: I read one of the threads that the cause of the issue might be the ACK messages. ACK will arrive at the event will never be signaled. If the message ACK is active and no ACK is received sendDone is not signaled. On Tue, Nov 10, 2009 at 3:37 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi Ricardo, Thanks for reply. I wrote a dbg statement in first of sendDone event but ...the sendDone event is not signaled at all! event void AMSend.sendDone(message_t* bufPtr, error_t error) { * dbg(Base,sendDone %s .\n,sim_time_string());* if (pkt == bufPtr) { busy = FALSE; } } There isn'nt any statement to print while simulating Really confused! What's your idea ?? Does it related to Radio configuration of simulation code ?(python code ?) On Tue, Nov 10, 2009 at 6:43 PM, Ricardo . ricardo.mas...@gmail.com mailto:ricardo.mas...@gmail.com wrote: Try print the value of error_t error in sendDone event On Mon, Nov 9, 2009 at 3:53 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi, Im writing a simple application to test send and receive of motes .AMSend.send command works but AMSend.sendDone event isn't signaled after sending so the busy flag does'nt change to false. and in the next time the AMSend.send command does not return SUCCESS . this is my code : event void Boot.booted() { dbg(Boot,Booted at time %s .\n,sim_time_string()); call AMControl.start(); } event void AMControl.startDone(error_t err) { dbg(Control,AMControl started %s .\n,sim_time_string()); if(err == SUCCESS
Re: [Tinyos-help] Timer accuracy in MicaZ
I'm not exactly sure of that particular interface in TOS 1.x but, i remember that in TOS, the milli counter ticks 1024 times per second not 1000, so this might account for some of the time difference. -Paul Mohammad S. Hashemian wrote: Hi all, In the application I'm working on, I need to know the exact time of a specific event, so I recorded the time turned on the mote, and I programmed the mote to put the time value in the packet as well (using Time.getLow32() and Time.getHigh32, Time is SimpleTime.Time interface), using this value and adding it to the base time (the time I turned the mote on) I should be able to compute the time which event occured. The problem is that this time increases faster than it should. For example suppose the event is firing a timer in code which occur every 4 seconds, and in the timer event handler, I put the time value and send it to the server PC. In such a test, the difference between time that server receives the packet and the computed time (time value in the packet + base time which I turned the mote on) is zero, but after 15 minutes the reported time is 20 seconds ahead of the current time, and this value increases that for example in 2 days, the reported time by mote is 64 minutes ahead of the current time. The procedure of computing time (recording the mote start time and adding the reported time to it) seems straight forward and correct, so the only problem I can think about is inaccuracy of clock in the mote. I tested this on couple of motes but all of them had the same problem, so do you think if the problem is in the way I implemented my test or it's just some inaccuracy in mote's clock? BTW I use MicaZ motes with TOS 1.1 Thanks all, Mohammad ___ 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] AMSend.sendDone event isn't signaled...
Mojtaba, If you are sending messages to AM_BROADCAST_ADDR, then there are no acks, so sendDone should be fired as soon as the radio successfully sends the packet. If sendDone isn't firing then this must mean the radio isn't able to send the packet. The only reason that I can think of that could cause TOSSIM to fail sending a packet is if CCA always thinks that there is a packet being transmitted. I would recommend you closely follow the .py example file given in: http://docs.tinyos.net/index.php/TOSSIM#Configuring_a_Network Especially the part that deals with the Noise Model. I seem to remember having problems with my applications when i tried to skip using the noise model. This may be what is causing your problems. I'm not very familiar with TOSSIM, but i believe it uses the noise model to run the CCA check. If no model is created, then i'm not sure how it determines what energy level the simulated radio is sensing during CCA, and what threshold it would use in that case. Let me know if this solves your problem. -Paul mojtaba raznahan wrote: Paul, Really thanks for your responses.I changed the boot times to 1000,each node is booted at 1000. And Node 1 is a sender and every 2000MilliSec sends a packet to AM_BROADCAST_ADDR (I also changed it to the numbers ,like 2 or 0).But still does'nt worked.In the first time AMSend.send returns a SUCCESS But the AMSend.sendDone event is not signaled to change the busy flag for later sends.I also chanaged the busy flag to false but next time AMSend.send doesn't return SUCCESS . Paul, should i active the ACK manually ? Or It's Automatically? *for i in range(0, 3): m = t.getNode(i); m.bootAtTime(1000);* This is the Timer.fired event : *ent void Timer.fired() { counter++; dbg(Base,Timer fired at %s .\n,sim_time_string()); if(!busy) { RbsMsg *data = call Packet.getPayload(pkt,sizeof(RbsMsg)); data-count = counter; dbg(Base,data in the packet is : %hhu.\n,data-count); flag = call AMSend.send(2,pkt,sizeof(RbsMsg)); if( flag == SUCCESS) { dbg(Base,Packet sent %hhu.\n,data-count); busy = TRUE; counter++; } else dbg(Base,was not SUCCESSFULL %S.\n,sim_time_string()); } else dbg(Control, the busy flag is true.\n,sim_time_string()); * And this is my message struct : *enum { TIMER_DELAY = 2000, AM_Rbs = 6 }; typedef nx_struct RbsMsg { nx_uint8_t count; } RbsMsg; #endif * On Sat, Nov 14, 2009 at 9:51 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Mojtaba, Which node is 1 sending to and when??? I see that the node boot times are pretty far spaced apart. It could be that if you're sending from 1 to 2, node 2 is not booted up when node 1 sends, thus, it will never receive an ACK and sendDone will never be called. -Paul mojtaba raznahan wrote: Hi Paul, Thank you very much for answer. I checked out this problem,but still doen't work!! This is my simulation code and node 1 is the sender node :(Is it correct ?) #! /usr/bin/python import TOSSIM import sys import random from TOSSIM import * t = TOSSIM.Tossim([]) r = t.radio(); for i in range(0, 3): m = t.getNode(i); m.bootAtTime(503 * i + 1); r.add(1,0,-50.0); r.add(0,1,-50.0); r.add(1,2,-50.0); r.add(2,1,-50.0); r.add(2,0,-50.0); r.add(0,2,-50.0); t.addChannel(Boot,sys.stdout); t.addChannel(Base,sys.stdout); t.addChannel(Receive,sys.stdout); t.addChannel(Control,sys.stdout); for i in range(0, 1000): t.runNextEvent(); sincerley, Mojtaba On Sat, Nov 14, 2009 at 8:11 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Mojtaba, Make sure when you are setting up your links in the simulation you set up BOTH directions of the link. For example if you're trying to send something from node 1 to node 2, you need to define the gain for link 1-2 and from 2-1. Otherwise, 1 will be able to send to 2, but 2 will never respond with an ACK. -Paul mojtaba raznahan wrote: Really need your helps... Can't anybody help me ?? Does it related to simulation section ?? On Tue, Nov 10, 2009 at 10:09 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: I'm still bickering with this issue...some help plz On Tue, Nov 10, 2009 at 7:44 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: How can i make sure that the message ACK is active or not ? I have
Re: [Tinyos-help] why dosen't someone reply to this?? plz i require serious help
I am not aware of many people that are still using tinyos 1.x, so I doubt you will be able to get any sort of authoritative response from anyone. Since the compiler is complaining about TOSH_NUM_NODES, have you considered adding to your Makefile a line like this: CFLAGS += -DTOSH_NUM_NODES=### where ### is the number of nodes in your experiment. Most likely something is referring to this #define and since it's not defined, it's giving an error. Look at the file indicated: /opt/tinyos-1.x/tos/platform/pc/nido.h:63 To see what the issue is. -Paul Arslan Shahid wrote: I'm currently following the Lesson 5 (TOSSIM) from the TinyOS 1.x Tutorial, in which I'm supposed to compile CntToLedsAndRfm application. In that step i found problems running the make pc, and I realized that it happens for other applications. It shows: xubun...@xubuntos-tinyos:/opt/tinyos-1.x/apps/CntToLedsAndRfm$ make pc mkdir -p build/pc compiling CntToLedsAndRfm to a pc binary ncc -o build/pc/main.exe -g -O0 -I%T/lib/Counters -pthread -fnesc-nido-tosnodes=1000 -fnesc-simulate -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=pc -fnesc-cfile=build/pc/app.c -board=micasb -DIDENT_PROGRAM_NAME=\CntToLedsAndRfm\ -DIDENT_USER_ID=\xubuntos\ -DIDENT_HOSTNAME=\xubuntos-tinyos\ -DIDENT_USER_HASH=0x00f95284L -DIDENT_UNIX_TIME=0x4addfadcL -DIDENT_UID_HASH=0xaa66b4d0L CntToLedsAndRfm.nc -lm In file included from /opt/tinyos-1.x/tos/platform/pc/hardware.h:43, from /opt/tinyos-1.x/tos/system/tos.h:144: /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 integer constant make: *** [exe0] Error 1 Someone on the mailing list suggested to add the flag -fnesc-nido-tosnodes=1000 on the .target file found in /opt/tinyos-1.x/tools/make, but the flags are there, and as it is seen in the output above, they appear in the ncc command... So, i don't know if I missed make, or if there are any other files of TinyOS 2.x that conflict with the 1.x version... How to fix this error? My environment is the xubuntos distribution, running it's image in VMWare Player. I crucially appreciate all the help. Thanks in advance! Bing brings you maps, menus, and reviews organized in one place. Try it now. http://www.bing.com/search?q=restaurantsform=MFESRPpubl=WLHMTAGcrea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1 ___ 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] Visualization tool for TinyOs 2.x
Mojtaba, You need a CVS client to check out the entire project. Depending on your platform there are lots of different cvs programs. -Paul mojtaba raznahan wrote: Hi, Excuse me, how can i download whole project as a single file ? In this link i should download the project one by one Thanks On Mon, Nov 9, 2009 at 10:44 PM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi Mehmet, Thanks you very much. I'll try this application .I will ask you again,If i hade a problem using this. Best Regards, On Mon, Nov 9, 2009 at 9:23 PM, Mehmet Akif Antepli akifante...@gmail.com mailto:akifante...@gmail.com wrote: Hi, You can have a look at Octopus application in the following link; http://tinyos.cvs.sourceforge.net/viewvc/tinyos/tinyos-2.x-contrib/ucd/ I have been using it for a long time. You have to play with payload struct in order for the gui to communicate with your network. All the best, -- Mehmet Akif Antepli On Mon, Nov 9, 2009 at 10:13 AM, mojtaba raznahan mojtaba.razna...@gmail.com mailto:mojtaba.razna...@gmail.com wrote: Hi, Is there any Visualization tool for TinyOs 2.x ? I heard TinyViz doesn't work with TinyOs 2.x. Simulating with just TOSSIM is not very sensible... and i want to see what are my algorithms doing . And at this point, what other people do for visualization in TinyOs 2.x ? Recently I found a framework named cadena for eclipse ...does this framework have visualization tools ? or just compiling ? Regards, -- Mojtaba Raznahan BS of Computer engineering TMU university www.raznahan.com http://www.raznahan.com/ ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto:Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- Mojtaba Raznahan BS of Computer engineering TMU university www.raznahan.com http://www.raznahan.com -- Mojtaba Raznahan BS of Computer engineering TMU university www.raznahan.com http://www.raznahan.com ___ 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] why dosen't someone reply to this?? plz i require serious help
Akankshu, CFLAGS is usually the flags you pass to gcc (or in this case ncc). It simply is a lit of command line parameters that you pass to the program. To see what various flags do, you should look at the man pages for gcc/ncc. In general, the flag -DSOMETHING it basically is the same as if you had typed #define SOMETHING in your code. -DSOMETHING=### it's the same as #define SOMETHING ###. -Paul Akankshu Dhawan wrote: Hi Paul I dont have a similar problem but I want to learn about using CFLAGS and PLFAGS in tinyoy-2.x. I have used some of them when people have told me and for the most part they have worked but I want to learn about the usage and different such flags ? I look forward to hearing from someone Akankshu On Fri, Nov 13, 2009 at 1:10 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: I am not aware of many people that are still using tinyos 1.x, so I doubt you will be able to get any sort of authoritative response from anyone. Since the compiler is complaining about TOSH_NUM_NODES, have you considered adding to your Makefile a line like this: CFLAGS += -DTOSH_NUM_NODES=### where ### is the number of nodes in your experiment. Most likely something is referring to this #define and since it's not defined, it's giving an error. Look at the file indicated: /opt/tinyos-1.x/tos/platform/pc/nido.h:63 To see what the issue is. -Paul Arslan Shahid wrote: I'm currently following the Lesson 5 (TOSSIM) from the TinyOS 1.x Tutorial, in which I'm supposed to compile CntToLedsAndRfm application. In that step i found problems running the make pc, and I realized that it happens for other applications. It shows: xubun...@xubuntos-tinyos:/opt/tinyos-1.x/apps/CntToLedsAndRfm$ mailto:xubun...@xubuntos-tinyos:/opt/tinyos-1.x/apps/CntToLedsAndRfm$ make pc mkdir -p build/pc compiling CntToLedsAndRfm to a pc binary ncc -o build/pc/main.exe -g -O0 -I%T/lib/Counters -pthread -fnesc-nido-tosnodes=1000 -fnesc-simulate -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=pc -fnesc-cfile=build/pc/app.c -board=micasb -DIDENT_PROGRAM_NAME=\CntToLedsAndRfm\ -DIDENT_USER_ID=\xubuntos\ -DIDENT_HOSTNAME=\xubuntos-tinyos\ -DIDENT_USER_HASH=0x00f95284L -DIDENT_UNIX_TIME=0x4addfadcL -DIDENT_UID_HASH=0xaa66b4d0L CntToLedsAndRfm.nc -lm In file included from /opt/tinyos-1.x/tos/platform/pc/hardware.h:43, from /opt/tinyos-1.x/tos/system/tos.h:144: /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 integer constant make: *** [exe0] Error 1 Someone on the mailing list suggested to add the flag -fnesc-nido-tosnodes=1000 on the .target file found in /opt/tinyos-1.x/tools/make, but the flags are there, and as it is seen in the output above, they appear in the ncc command... So, i don't know if I missed make, or if there are any other files of TinyOS 2.x that conflict with the 1.x version... How to fix this error? My environment is the xubuntos distribution, running it's image in VMWare Player. I crucially appreciate all the help. Thanks in advance! Bing brings you maps, menus, and reviews organized in one place. Try it now. http://www.bing.com/search?q=restaurantsform=MFESRPpubl=WLHMTAGcrea=TEXT_MFESRP_Local_MapsMenu_Resturants_1x1 ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto: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 mailto:Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] MicP precision compared to SoundLocalizer
Akankshu, I have taken a look at the code, but I'm not really able to say what is significantly different between the two other than the fact that SoundLocalizer is designed to sample the microphone as fast as possible, so there are probably some optimizations that Hu Siquan (the author of the code, his email is inside the code if you need it) made to make it perform better. You would have to talk to him if you have questions about it as I have no hands-on experience with any of the mts300 functionality. Your problem may be that the MicP implementation is that it has more overhead and samples the microphone fewer times per second. I have no idea of the speeds, but if for example, the MicP implementation takes 10 seconds to collect 1000 samples, you may be missing all of the peaks of the sound events (clapping, shouting, or whatnot) when you are sampling the ADC, versus SoundLocalizer which is designed to sample the ADC as fast as possible. Without access to the hardware, and performing some profiling of each implementation, i can't say for sure if this is the case. Sorry that i couldn't help you more. -Paul Akankshu Dhawan wrote: Hi Paul Can you tell me what might be the different between the microphone implementation in MicrophoneC inside SoundLocalizer Vs the MicP inside mts300 ? Thanks a lot Akankshu On Thu, Nov 12, 2009 at 4:44 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: CVS under /tinyos-2.x-contrib/tinyos-programming/ -Paul Martin Osterloh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, sorry for interfering this thread. But, where can I find the sourcecode to the soundlocalizer demo? Best, Martin Akankshu Dhawan wrote: Hi Michael and Zainul Thanks a lot for your response. I am grateful to be hearing from you. I will look into the corrected mean solution before I suggest some hardware changes to my team. Although, my bigger question was why direct sampling by calling getData-dataReady on a free running ADC (this is what is used in the SoundLocalizer example in Tinyos-2.x described in the book also) responds better ? if I try to do threshold detection of every sample using the same interface and direct sampling I get values which are very responsive and high rate of sampling. I know I am loosing on some precision by sampling at a rate other than the default ATM128_ADC_PRESCALE but since I am mainly using it for thresholding I think my application can handle it. Can you tell me some comparison between the microphone setup used by the MicP and MicStream compared to the SoundLocalizer direct sampling setup ? Thanks a lot once again Sincerely Akankshu Dhawan On Thu, Nov 12, 2009 at 1:30 PM, Michael Schippling sc...@santafe.edu mailto:sc...@santafe.edu mailto:sc...@santafe.edu wrote: I suspect that the straight averaging thing is not what you want. I haven't looked at the mic data, but it's sampling an AC signal (sound wave pressure alternates between compression and rarefaction at the frequency you perceive) and is probably biased so a no-pressure signal is pretty much in the middle of the ADC range. Averaging that AC signal over a number of high-low pressure waves will just give you the middle again. If that is the case, what you want to do is rectify the signal -- half-wave would just chop off the samples below the mid-value, full-wave would invert them around the mid-value -- before trying to average to get a loudness. If you are trying to get the Sound Pressure Level -- how loud the sound is at any particular time -- it's called Envelope Following in the good old days of signal processing. If you know any electronics, what you want to build is a diode or diode bridge, to rectify the signal, and a capacitor to filter, or average, it to a slowly varying DC value. MS Akankshu Dhawan wrote: Hi All I am using two mechanisms for high sampling. 1. Using MicStreamC and changing the prescalar value inside MicP to ATM128_ADC_PRESCALE_32 and the gain value is set to 64. I create a buffer of 1000 samples and every time the buffer gets full I take the average and print it out. The problem is that the microphone does not seem to be responding or is not showing me sufficiently precise values. The average when I dont make a noise is around 500 ADC.. and even if I am clapping shouting (for long durations) it still shows me slightly */lower values /like 497 etc. So I am not sure why this is so ?* 2. When I created the low level interfaces on my own using the sample
Re: [Tinyos-help] Data memory for micaz motes
Vikram, Please examine the crossbow datasheet for the micaz or the crossbow's MPR-MIB User's Manual for this information. http://www.xbow.com/support/support_pdf_files/mpr-mib_series_users_manual.pdf -Paul Vikram vik76 wrote: Hello, I would like to know how much memory is available in micaz motes for the following. 1. Data 2. Program Thanks Vikram ___ 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] Data memory for micaz motes
Vikram, Look at Table 1-2. Mote Product Summary in the link I provided. It provides the exact information that you are asking about. As for your other question, Program Flash Memory is reserved explicitly for your executable(so no, program size does directly affect available data size). RAM (SRAM in this case) is used to store any program variables that you might use, and any variables tinyos uses internally, stack variables, etc. Measurement(Serial) Flash is used to store whatever you want, measurement readings, logs, etc. EEPROM is used to store configuration data that you burn onto the device. This might be node ID's, private/public keys for encryption, etc. -Paul Vikram vik76 wrote: On examining the micaz datasheet I found Program Flash Memory - 128K bytes Measurement (Serial) Flash - 512K bytes Configuration EEPROM - 4K bytes I am not very clear about the purpose of all of the above. I would like to know where the program executable code resides, and where the data resides. From data I mean how many bytes of values can the variables in my program store. Does the program and data share the same memory? If yes, does this mean that if my program size increases, then the available data size decreases. My requirement is to use an array of uint8_t for a large number of elements whose values keep changing dynamically. Thanks Vikram On Fri, Nov 13, 2009 at 11:42 AM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Vikram, Please examine the crossbow datasheet for the micaz or the crossbow's MPR-MIB User's Manual for this information. http://www.xbow.com/support/support_pdf_files/mpr-mib_series_users_manual.pdf -Paul Vikram vik76 wrote: Hello, I would like to know how much memory is available in micaz motes for the following. 1. Data 2. Program Thanks Vikram ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu mailto: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] Transmission power adjusting
Alfred, It really depends on what your topology looks like. If the nodes, before the change, received messages with an RSS of -45 dBm, and you reduced the power level from +0dBm to -15dBm. The RSS would go from -45dBm to -60dBm. Depending on your hardware, this can still be within the white range of transmission where the link quality is excellent. For reference, with the MICA2 which uses the CC1000 radio, when the transmission power is set to low (approximately -20dBm), we were able to successfully receive packets on average at 38 ft, and in some cases up to 65 ft. -Paul Alfred NOBEL wrote: Hi all, I would like to adjust the Transmission power of all sent packets. To do, I added this line in the makefile: CFLAGS += -DCC2420_DEF_RFPower=3 (low transmission power of CC2420 compatible platforms) However, I think that this command didn't work as expected because links connectivity stays excellent. -- Best regards, Alfred.Nooobel ___ 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] Low Power Listening : setRxSleepInterval
Xiaodong, My comments are in-line Hi Guys, I have a question regarding the low power listening function. I know for the receiver, we could use setLocalSleepInterval() to invoke the periodic sleeping. And for the sender, in order to send the packet to this receiver, setRxSleepInterval should be used to set the receiver's sleep interval value into the packet meta data field. *However, my question is what is the detail of this proceedure? I don't quite understand the reason why this packet can be received by the receiver with the same sleep interval value, as we set the receiver's interval to the packet's meta data field.* Basically the sender repeatedly sends the packet until it has a good idea that the receiving node likely heard it. The sender figures out how long to send the packet based upon the receiving node's RxSleepInterval. A very abstract example: Lets say the Receiving node with ID = 3 is awake for 1 second every 5 seconds. If a transmitting node (ID = 2) continually sends a packet to Node 3 for 5 seconds, then it is very likely that the receiving node was awake sometime during which the entire packet was transmitted. In tinyos2.x DefaultLplP.nc, I found when to initialize the sending, the following function will be called: void initializeSend() { if(call LowPowerListening.getRxSleepInterval(currentSendMsg) ONE_MESSAGE) { if(call AMPacket.destination(currentSendMsg) == AM_BROADCAST_ADDR) { call PacketAcknowledgements.noAck(currentSendMsg); } else { // Send it repetitively within our transmit window call PacketAcknowledgements.requestAck(currentSendMsg); } call SendDoneTimer.startOneShot( call LowPowerListening.getRxSleepInterval(currentSendMsg) + 20); } post send(); } *What is the use of this SendDoneTimer?* seems to me that it schdules next fire time at the interval +20 ms. And when the timer fires, it will do the following: /** * When this timer is running, that means we're sending repeating messages * to a node that is receive check duty cycling. */ event void SendDoneTimer.fired() { if(call SendState.getState() == S_LPL_SENDING) { // The next time SubSend.sendDone is signaled, send is complete. call SendState.forceState(S_LPL_CLEAN_UP); } } *What does the above function mean?* From what i can gather, there is another timer called SubSend that is in charge of repeatedly sending the packet. This timer determines when SubSend should stop trying to send the packet. If SubSend succeeded, the state would not be S_LPL_SENDING, so the SendDoneTimer doesn't need to do anything. However if it is S_LPL_SENDING, this means that the SubSend was not able to successfully send the packet to the node, therefore, it needs to abandon the attempt. Think of it as a watchdog timer, if it doesn't succeed by the allotted time, the send will be aborted. * * ** *Another question is in the initializeSend function, when the destination address is not broadcast, it will request ack. Does this mean that the software ack is automatically turned on? When a receiver receives packet, it will send out ack automatically? Is it necessary?* There is a field in the packet that indicates this packet should be acked. Calling PacketAcknowledgements.requestAck(currentSendMsg); Makes the necessary modifications to the packet. The receiver will automatically send an ACK if this bit is set in the packet upon receiving it. When an ACK is requested, the sendDone event for a particular packet is not called until the ACK is received. In the case of a broadcast packet, sendDone is called whenever the mac protocol successfully transmits the packet (regardless of collisions, etc that may have occurred) I hope this helps you. -Paul ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] Low Power Listening : setRxSleepInterval
Yes, that pretty much sums it up. There are better ways of doing it, but those usually require either very strict time synchronization or beacons whenever a node wakes up from sleep. Each has its disadvantages, it just depends on what is more important to the application. Of course, if you come up with a better way of doing it w/out time synchronization or beacons, then i'm sure you could get a research paper out of it at the least. :-) -Paul Xiaodong Wang wrote: Hi Paul, Thank you very much for your reply. This helps a lot. According to your reply, then I have a follow up question. Bascially, the sender will repeatedly send a packet, which covers at least one sleeping interval such that the receiver is likely to hear the packet. This seems very inefficient, especially when the receiver is in low-duty-cycle application. I think this incurs a lot of energy waste at the sender side, as well as the unnecessary interference at other nodes because of the continuously using of channel. Am I right? Thanks, Xiaodong On Tue, Nov 10, 2009 at 6:46 PM, Paul Johnson oewyn...@gmail.com mailto:oewyn...@gmail.com wrote: Xiaodong, My comments are in-line Hi Guys, I have a question regarding the low power listening function. I know for the receiver, we could use setLocalSleepInterval() to invoke the periodic sleeping. And for the sender, in order to send the packet to this receiver, setRxSleepInterval should be used to set the receiver's sleep interval value into the packet meta data field. *However, my question is what is the detail of this proceedure? I don't quite understand the reason why this packet can be received by the receiver with the same sleep interval value, as we set the receiver's interval to the packet's meta data field.* Basically the sender repeatedly sends the packet until it has a good idea that the receiving node likely heard it. The sender figures out how long to send the packet based upon the receiving node's RxSleepInterval. A very abstract example: Lets say the Receiving node with ID = 3 is awake for 1 second every 5 seconds. If a transmitting node (ID = 2) continually sends a packet to Node 3 for 5 seconds, then it is very likely that the receiving node was awake sometime during which the entire packet was transmitted. In tinyos2.x DefaultLplP.nc, I found when to initialize the sending, the following function will be called: void initializeSend() { if(call LowPowerListening.getRxSleepInterval(currentSendMsg) ONE_MESSAGE) { if(call AMPacket.destination(currentSendMsg) == AM_BROADCAST_ADDR) { call PacketAcknowledgements.noAck(currentSendMsg); } else { // Send it repetitively within our transmit window call PacketAcknowledgements.requestAck(currentSendMsg); } call SendDoneTimer.startOneShot( call LowPowerListening.getRxSleepInterval(currentSendMsg) + 20); } post send(); } *What is the use of this SendDoneTimer?* seems to me that it schdules next fire time at the interval +20 ms. And when the timer fires, it will do the following: /** * When this timer is running, that means we're sending repeating messages * to a node that is receive check duty cycling. */ event void SendDoneTimer.fired() { if(call SendState.getState() == S_LPL_SENDING) { // The next time SubSend.sendDone is signaled, send is complete. call SendState.forceState(S_LPL_CLEAN_UP); } } *What does the above function mean?* From what i can gather, there is another timer called SubSend that is in charge of repeatedly sending the packet. This timer determines when SubSend should stop trying to send the packet. If SubSend succeeded, the state would not be S_LPL_SENDING, so the SendDoneTimer doesn't need to do anything. However if it is S_LPL_SENDING, this means that the SubSend was not able to successfully send the packet to the node, therefore, it needs to abandon the attempt. Think of it as a watchdog timer, if it doesn't succeed by the allotted time, the send will be aborted. ** ** *Another question is in the initializeSend function, when the destination address is not broadcast, it will request ack. Does this mean that the software ack is automatically turned on? When a receiver receives packet, it will send out ack automatically? Is it necessary?* There is a field in the packet that indicates this packet should be acked. Calling PacketAcknowledgements.requestAck(currentSendMsg); Makes the necessary modifications to the packet. The receiver will automatically send an ACK if this bit is set
Re: [Tinyos-help] Low Power Listening : setRxSleepInterval
I think beacons whenever a node wakes up from sleep covers that :-) But regardless, either you are sending additional messages to keep tight time synchronization (even if you have no need to send packets in the near future), each node is wasting energy every time it wakes up by sending a beacon(even if no node has anything to send to it), or the sender wastes energy sending superfluous packets. It all depends on how common transmissions are in your network. If they are very rare, then on the event that a sender needs to spend a little extra energy might not be that bad compared to the constant overhead of synchronization or beacons. On the other hand if transmissions are common, then you will probably be better off with beacons or time synchronization. -Paul Razvan Musaloiu-E. wrote: Hi! On Tue, 10 Nov 2009, Paul Johnson wrote: Yes, that pretty much sums it up. There are better ways of doing it, but those usually require either very strict time synchronization or beacons whenever a node wakes up from sleep. Each has its disadvantages, it just depends on what is more important to the application. Actually, there is one more way which doesn't involve synchronization or sending so many packets: a node could signal that he is awake by sending a packet and the sender waits for this signal. :-) A MAC protocol based on this is RI-MAC: http://www.cs.rice.edu/~yanjun/research/sensys08.pdf The same idea is also used in Low Power Probing in Koala: http://cs.jhu.edu/~razvanm/ipsn2008koala.pdf The master+lpp head from here [1] is implementing LPP as an alternative to LPL. LPP is also implemented in Contiki along XMAC (which is similar with the LPL). :-) [1] http://hinrg.cs.jhu.edu/git/?p=razvanm/tinyos-2.x.git All the best! Razvan ME Of course, if you come up with a better way of doing it w/out time synchronization or beacons, then i'm sure you could get a research paper out of it at the least. :-) -Paul Xiaodong Wang wrote: Hi Paul, Thank you very much for your reply. This helps a lot. According to your reply, then I have a follow up question. Bascially, the sender will repeatedly send a packet, which covers at least one sleeping interval such that the receiver is likely to hear the packet. This seems very inefficient, especially when the receiver is in low-duty-cycle application. I think this incurs a lot of energy waste at the sender side, as well as the unnecessary interference at other nodes because of the continuously using of channel. Am I right? Thanks, Xiaodong On Tue, Nov 10, 2009 at 6:46 PM, Paul Johnson oewyn...@gmail.com wrote: Xiaodong, My comments are in-line Hi Guys, I have a question regarding the low power listening function. I know for the receiver, we could use setLocalSleepInterval() to invoke the periodic sleeping. And for the sender, in order to send the packet to this receiver, setRxSleepInterval should be used to set the receiver's sleep interval value into the packet meta data field. *However, my question is what is the detail of this proceedure? I don't quite understand the reason why this packet can be received by the receiver with the same sleep interval value, as we set the receiver's interval to the packet's meta data field.* Basically the sender repeatedly sends the packet until it has a good idea that the receiving node likely heard it. The sender figures out how long to send the packet based upon the receiving node's RxSleepInterval. A very abstract example: Lets say the Receiving node with ID = 3 is awake for 1 second every 5 seconds. If a transmitting node (ID = 2) continually sends a packet to Node 3 for 5 seconds, then it is very likely that the receiving node was awake sometime during which the entire packet was transmitted. In tinyos2.x DefaultLplP.nc, I found when to initialize the sending, the following function will be called: void initializeSend() { if(call LowPowerListening.getRxSleepInterval(currentSendMsg) ONE_MESSAGE) { if(call AMPacket.destination(currentSendMsg) == AM_BROADCAST_ADDR) { call PacketAcknowledgements.noAck(currentSendMsg); } else { // Send it repetitively within our transmit window call PacketAcknowledgements.requestAck(currentSendMsg); } call SendDoneTimer.startOneShot( call LowPowerListening.getRxSleepInterval(currentSendMsg) + 20); } post send(); } *What is the use of this SendDoneTimer?* seems to me that it schdules next fire time at the interval +20 ms. And when the timer fires, it will do the following: /** * When this timer is running, that means we're sending repeating messages
Re: [Tinyos-help] transmission power levels
Akankshu, It really depends on a lot of factors. An environment with lots of obstacles(trees, cubicles, buildings, cars, etc) can cause severe multipath effects which make estimation difficult. But as a start, you can look at free space propagation loss models. These will give you a *minimum* loss that any omnidirectional signal will experience as it travels through free space (no obstacles near transmitter, receiver, or anywhere inbetween). There are more complicated models that you can look into but that would probably be my first start. The general principle of Free Space Propagation is that each time the distance doubles (goes from 1 meter to 2, 2 to 4, 4 to 8, etc) the signal experiences a 3dB loss. This means that Received Signal Strength (RSS) rapidly decrease as you first begin to move away from a transmitter, then decrease more slowly as you get further and further away. The signal strength loss between 1 meter and 2 meters is (approximately) the same as the signal strength loss between 200 meters and 400 meters. As for reliable reception, that depends on a lot of factors too (noise, multipath signals arriving out of phase and at differing power levels, etc). In a perfect world, as long as the RSS is above the radio sensitivity, then you should be able to correctly detect and decode the packet, but in reality, noise, interference and multipath effects lower the effective sensitivity of the radio because it makes it harder to decode the signal from the noisy environment. Mathematical models can give you a basis to start your tests, but are never going to be a replacement for actual experiments. Slight differences in hardware between motes can also play a role in the transmission range. Hope this helps. -Paul Akankshu Dhawan wrote: Hi All I know we can set the transmission power levels of different motes. I want to know what is the correlation factor between the transmission power level and distance that it can reliably propagate ? I am using MICAZ motes and MTS310 sensorboard. Thanks Akankshu -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ 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] Using memories
David, In general, SDRAM will be much faster than FLASH memory. If you need detailed timing information you need to look on your imote for the chips that are used for FLASH/SDRAM and look up the manufacturer's datasheets (not crossbow's datasheet which is more like an advertisement for the imote2). However, SDRAM is volatile memory and flash memory is non-volatile, meaning that when the mote loses power, SDRAM will lose all stored information while FLASH will maintain it. As for accessing the flash or sdram: The ram is on-board meaning that whenever you allocate variables, it will use the microprocessor's RAM to store it. So if you want to store a 10 element vector in ram, you just declare the variable, and access it like any other variable. I don't have any personal experience with imote2, but flash should be able to be accessed just like the flash on other platforms (assuming the functionality has been ported from the Tinyos 1.x stack). See TEP 103 for more information http://www.tinyos.net/tinyos-2.x/doc/pdf/tep103.pdf The tinyos IMOTE2 wiki might also help: http://docs.tinyos.net/index.php/T2_on_Imote2 -Paul David Rodenas Herráiz wrote: Hi all Imote2 has 32 MB of FLASH memory and 32MB of SDRAM. Which of these memories, FLASH or SDRAM, is faster? I searched that in the datasheet but I did not find it. How can I use anyone of them? I need to store large data structures. Regards David 49 habitantes, 49 expertos en Windows 7. Así es Sietes, ¡Visítalo! http://www.sietesunpueblodeexpertos.com/ ___ 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] AlarmMicro32C in SoundLocalizer Tinyos-2.x
Akankshu, As for your Question #1, there is an AlarmMicro32C it's just in the tos.platforms.mica.AlarmMicro32C directory. For Question #2, I haven't looked closely at the SoundLocalizer program, it basically samples the ADC as fast as possible. When it detects that the current sample is greater than the threshold it will start the next phase of the algorithm. I've glanced at the code, and it isn't storing the samples, it simply checks them as it samples then discards the result if it doesn't exceed the threshold. The ADC may be capable of sampling at 38kHz, but it all depends on how fast tinyos is able to fire off the alarm and process each signal. This may be vastly different from the theoretical maximum of the ADC. I don't know exactly what you are trying to do, but it would be possible to have a circular buffer and store the last x ADC samples. But take note that your available RAM is generally very low on the micaz. One other note is that it appears to be taking very coarse grained ADC samples, so there is a lot of loss in precision with the sound localizer program. Its intent however was simply detecting the node closest to the event, so the precision wasn't needed. -Paul Akankshu Dhawan wrote: Hi I was trying to get high sampling from the MICAZ motes and MTS310CB sensorboard by using some ideas from the SoundLocalizer in tinyos-2.x-contrib (Also part of tinyos programming) I would be really grateful to anyone who can help me with some questions that I had run into 1. This is suppose to be comptabile to MICAZ motes but there is not AlarmMicro32c in the platforms directory for MICAZ ? 2. Considering that the detector fires continuously and the ADC samples at around 38 KHz, is each data element being compared to the threshol value ? Is there a way I can store this in some sort of a Buffer ? If I keep adding the data into the buffer and overwrite it when full I should be able to create a circular buffer. Please correct me if I am wrong ? I would really appreciate if anyone can help me with this Thanks Akankshu Dhawan -- First they ignore you, then they laugh at you, then they fight you, then you win. - Mahatma Gandhi ___ 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
[Tinyos-help] Mica2 (CC1000) Packet loss with 900MHz configuration
Hi, My apologies in advance if this question has already been answered in the archives. I've searched for anything similar but never came up with any relevant hits. I am experiencing unusual packetloss with the Mica2 (CC1000) platform. Initially, I saw approximately a 20% loss. After doing some digging, I realized that simply setting the operation frequency to 900 MHz does not modify the other hardware configuration presets. After tuning the radio using one of the 900MHz presets, i was able to improve that figure to somewhere around 3% packet loss, but any other tweaks seem ineffective at removing these last few percentage points. The environment in which I am performing the tests is very controlled, and I have verified with a cheap commercial spectrum analyzer (Metageek's WiSpy for 900MHz) that there is no external interference that could be causing the packet loss. To the best of my ability I have determined that for some reason or another, the CC1000 Radio is not always picking up the preamble of the transmitting node. (I have checked to see if the packets just fail CRC by modifying the SNOOP implementation, but the CRC check is only rarely the cause of packet loss. It seems as if the receiving node never locks on and decodes the packet.) I have tested my application on MICA2's 433 MHz nodes, 900MHz nodes, and the TelosB 2.4 GHz nodes and I have only experienced this problem with the MICA2 900 MHz nodes(The 433 MHz, and 2.4 GHz nodes experienced 0 packetloss during the test operation). By looking at the CC1000 datasheet, i've been unable to figure out what setting would need to be tweaked to correct this issue. So far, the best candidates i've found are the PEAK_LEVEL_OFFSET in the MODEM2 register(Derivation of this value is dependent on frequency, however i wasn't able to determine if the preset value matches the derived value), and the MODEM1 register which deals with the average filter and locking/settling time(In the CC1000 Documentation it says If the data is Manchester coded, there is no need to lock the averaging filter... however it appears that it is being locked in the radio presets). I have tried tweaking these parameters to no great effect. Has anyone experienced similar problems before, or does anyone have any ideas as to what is causing the packetloss issue in only the 900 MHz? Thanks, -Paul Johnson ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help