We begin from downloading tikiridb 0.2 version from http://score.ucsc.lk and the daily snapshot code of the contiki from http://www.sics.se/contiki/. We create a new directory somewhere in our Ubuntu machine and put the two downloaded source directories ("0.2" and "contiki-2.x") in that directory side by side. Now it's time to follow a sequence of instructions to reach our goal.
1) Open the file "0.2/node/platform-modified/cooja/packetizer-arch.c" and put this function to the end of it.
void packetizer_arch_writeb(unsigned char c) {
rs232_send(c);
}
2) Copy the "serial_forwarder" directory in "0.2/cooja/plugins/" to the "contiki-2.x/tools/cooja/apps/" directory.
3) open file "contiki-2.x/tools/cooja/build.xml",
1. As a child element of
<ant antfile="build.xml" dir="apps/serial_forwarder" target="clean" inheritAll="false"/>
2. As a child element of
4) open file "contiki-2.x/tools/cooja/config/external_tools_linux.config" and replace the variable "DEFAULT_PROJECTDIRS" with,
DEFAULT_PROJECTDIRS = [CONTIKI_DIR]/tools/cooja/apps/mrm;[CONTIKI_DIR]/tools/cooja/apps/mspsim;[CONTIKI_DIR]/tools/cooja/apps/avrora;[CONTIKI_DIR]/tools/cooja/apps/serial_forwarder
5) Install additional packages that are needed to compile tikirisql(TikiriDB client).
In the terminal type:
# apt-get install flex bison
6) Compile tikirisql client
In the terminal type:
# cd 0.2/gateway/tikirisql
# make
7) Open the file "0.2/test-apps/Makefile" with your favorite
text editor and set the path to Contiki directory appropriately.
8) Go to "contiki-2.x/tools/cooja" directory and type,
ant clean
ant run
This will open the cooja simulator. Close it.
9) Go to the directory "0.2/test-apps" and issue the command,
make test-app.cooja TARGET=cooja
10) Now our cooja simulator will start and get ready to run tikiridb. In the GUI of the opened cooja, we should follow the precedure as follows. In the dialog box for create new simulation, click "Create button". In the next create mote type window, click "Compile". when it's done click on "Create". Now in the add motes window enter 2 for number of motes and then click "Create and add" button.Now in the "simulation visualizer" window, right click on a mote and "open mote plugin for contiki" >> serial forwarder. Then in the serial forwarder window, keep the default port value it has and click "start". Then in the control panel, click "start". A simulation error window will come. Close it and goto the menu bar,
file >> reload simulation >> keep random seeds. Now the serial forwader will be running. Start the control panel also.
11) Go to the directory "0.2/gateway/tikirisql" and issue the command,
./tikirisql -H localhost -P 25601
when you issue an sql query in the prompt and if it hangs without printing the data, there should be something wrong. Check whether the motes in the simulation are in within each others radio range. If not, drag them to closer.