If you want to set up your Contiki development environment on a server rather than using the Instant Contiki virtual machine, this is for you.
- Follow the steps in Contiki wiki page Setup Contiki toolchain in ubuntu 13.04.
- Instead of cloning the Contiki repo in the Step 3 mentioned above, you should upload the Contiki folder from the Instant Contiki VM to your server. This is because the repo is outdated somehow. I had the problem that the source file cannot be compiled using the source files in the repo.
- Now you should be able to compile example files.
You may want to simulate your application using Cooja on the server, which is useful when you need to do a batch simulation without GUI.
Do the following steps to configure Cooja simulation tools on your server.
- Upload all files under the
contiki/tools/coojafolder from the Instant Contiki to your server.
- Go to
ant runto compile.
- Now navigate to
java -jar Cooja.jar -nogui=PATH_TO_YOUR_CSC_FILE. Remember, you need a script to control the simulation. See Using Cooja Test Scripts to Automate Simulations.
- You should see log output in the console, which shows you the simulation is running.
- After completion, you can find
Cooja.testlogfile under the
distfolder, which is the simulation log file you need.
About "Run test (repeatedly) without GUI"
As mentioned in Using Cooja Test Scripts to Automate Simulations, it does not work anymore. Therefore you need create a shell script to run your test repeated. I have done this, and you can find the shell script below:
#!/bin/sh if [ "$#" -ne 2 ]; then echo "Usage: $0 csc_file repeat_times" echo "example: $0 ~/contiki/your_file.csc 10" exit fi cd /home/user/contiki/tools/cooja/dist for i in `seq 1 $2` do echo ">>>>> Running $i" java -mx512m -jar cooja.jar -nogui=$1 mv COOJA.testlog "$1.$i.log" done