I am a Postdoctoral Research Fellow with The SUTD-MIT International Design Centre (IDC), Singapore University of Technology and Design (SUTD). My research topic is about protocol and algorithm design, resource allocation and localisation in wireless sensor network, UAV network and Ad Hoc network. I also enjoy the mobile programming (Android and Objective-C) and web server development. Thanks for sharing.
There are two computers, one is called Joker and the other is called Batman. They use Morse code to communicate. The microcontroller is Arduino and the wireless transceiver is NRF24L01+PA.
I find that sometimes it works fine especially at night when few people are in the lab, but sometimes transmission failed (both of them can not talk to each other or just one-way communication works). Not sure if the reason is the interference from wifi.
Just find a good way to convert pdf file to eps. This is quite useful when you edit a paper with Latex. Before we do it, we need to download the Texshop (http://pages.uoregon.edu/koch/texshop/):
To convert pdf → eps (Mac OS X will only do (e)ps → pdf & pdf → ps),
- open the pdf in TeXShop, choose the 'Selection' tool in the Preview window toolbar
- select the desired rectangle (or all, either with ⌘-A or manually),
- choose 'Preview>Save Selection to File...', & save as eps."
In ns2, if you want to calculate the receiving power threshold of a node, you may want to use threshold tool which has been integrated in ns2 source code.
I don`t know why the threshold.cc is not compiled in the new version of ns2 like ns-allinone-2.35. So we have to do it by ourselves. In ubuntu, if you try to do "gcc threshold.cc", you will get an error message of "<iostream.h>".
So, we replace this line "#include<iostream.h>" by
In Ubuntu, I use XvidCap to record video on the screen. The package link is https://launchpad.net/ubuntu/natty/+package/xvidcap.
One of the most useful features of XvidCap is that it allows to select the recording area instead of the whole screen. And it also supports to output the video in MPEG format.
You may need to convert it to other video format, such as WMV, ASF, MOV and some for ipod or iphone. Since I am working on Mac OS, I recommend a free software which is called iSkysoft iMedia Converter. Actually, there is a video teaching you how to crack, http://www.youtube.com/watch?v=cLo-zuMxSNM.
Hopefully, these two softwares are helpful to you.
After NS2 simulations are finished, someone may need to analyze the trace file which is output by TCL program. I got the trace file format which is like this
The first field is the event type, whose value can be s (send), r (receive), d (drop) or f (forward).
The second field the time this event happens.
The third field records the id of the node, on which this event takes place.
The fourth field shows the layer where this event happens. Its possible value may be one of the following four: AGT (agent), RTR (router), IFQ (interface queue), and MAC (mac).
The fifth field is normally a short broken line, which is reserved for special events. For example, when collision occurs, the broken line is replaced with COL.
The sixth field is the global sequence number for this packet, which is the integer number used to identify this packet in the whole network and distinguish it from others. Sequence number is only available for data packets and not allocated for control packets, like RTS/CTS/ACK and SYNC packets in S-MAC (using a zero instead).
The seventh field is the packet type. The actual value is determined by the application or MAC layer, which creates this packet. For example, cbr represents that it is a data packet generated by a CBR traffic source.
The eighth field is the packet size in bytes.
Since I use AODV routing protocol, the ninth field is AODV trace information including three numbers in brackets concerns MAC layer information. Usually, there will be four numbers in the brackets. Its format is like "[0x%x %d [%d %d] %f] (%s)" 1)| hexadecimal | Type | 2)| int | Hop Count | 3)|int | Destination | Destination Sequence Number | 4)|double | Lifetime | 5)|string | Operation (REPLY, ERROR, HELLO) |
The tenth field is IP trace info including | Source IP Address:Source Port Number | Destination IP Address:Destination Port Number | TTL Value | Next Hop Address, If Any |
5) If got "otcl-1.13 make failed! Exiting" error, i)edit the configure.in file in otcl-1.13, Line77 SHLIB_LD="ld -shared" -> SHLIB_LD="gcc -shared" ii)edit the configure file in otcl-1.13, Line6304 SHLIB_LD="ld -shared" -> SHLIB_LD="gcc -shared"
6) Edit otcl-1.13/Makefile.in,
CC= @CC@ -> CC= gcc-4.3
7) Then, $cd ns-allinone.2.34/
$./install
8) If got an error like
"`.gnu.linkonce.t._ZN11taskPending10taskStatusEh' referenced in section `.rodata' of wpan/p802_15_4mac.o: defined in discarded section `.gnu.linkonce.t._ZN11taskPending10taskStatusEh' of wpan/p802_15_4mac.o collect2: ld returned 1 exit status make: *** [ns] error 1"
, that is because you are using gcc3.3 to compile it. And you have to change gcc compiler version to gcc4 or above.
9) Then, it should work. Finally, dont forget to modify .bashrc file to add environment variables. export PATH=$PATH:/YOURDIR/ns-allinone-2.34/bin:/YOURDIR/ns-allinone-2.34/tcl8.4.18/unix:/YOURDIR/ns-allinone-2.34/tk8.4.18/unix
if we want to record the output in Linux command line, we could use "script" command.
script [-a] [-f] [-q] [-t] + file name
-a
Append the output to file or typescript retaining the prior contents.
-f
Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can supervise real-time what is being done using `cat foo'.
-q
Be quiet.
-t
Output timing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used to replay typescripts with realistic typing and output delays.
To exit the recording, we need to use "ctrl + d".
For example, we record the command line output to a log file whose name is "MyRecord".
$ script MyRecord.log
Then it will begin to record all the information displayed by command line. Finally, "ctrl + d" will exit and it will show "Script done, file is MyRecord.log"