Exercise and Labs

Most of the Lab/Exercise work will be carried out using Crossbow-mica2.

Lab-1
Write a program to Blink LEDs using plan C


Lab-2
Write a program to Blink LEDs using TinyOS/NesC and
  • Use following command to make sure you have essentials installed
    • sudo aptget install build‐essential
  • Install TinyOS using these instructions. However install tinyos-2.1.0 using Synaptic Package Manager instead terminal commands. Note that we have hardy distribution installed. Furthermore, you have to use settings ->repositories->third-party-software in order to add live-CD link.
  • Check that you have installed everything properly and have right environment variables using these instructions.
  • In case tinyos environment variables are not set. Then create a file tinyos.sh in /etc/profile.d/ and add them there manually. They are described here. Make sure that your tinyos.sh is executable and you have restarted your Ubuntu after creating it.
  • Go to /opt/tinyos-2.x/apps/Blink and try to run make mica2
  • Copy the exe you have created to the mote-mica2 using UISP
  • Change the application to know it better and understand the text of first tutorial fully
  • In case you have time and will then look at the next tutorial.

Lab-3
Getting familiar with class-file format and bytecode instruction set
  • Aim is to get familaries with class file format of Java. Please look at the chaper-4 for Java specification
  • Install NetBeans on your Ubuntu using Synaptic package manager
  • Use SVN from NetBeans (or on terminal) to get TakaTuka (create new folder with named TakaTuka). The SVN URL is https://conedav.informatik.uni-freiburg.de/svn/TakaTuka/
  • Open pc-side-code project in NetBeans it will be under TakaTuka/pc-side-code folder
  • Use TakaTuka class file reader (takatuka.classreader.logic.StartMe) to read HelloWorld1.class
  • See its output in the output folder "HelloWorld1.txt" and also see class file using "javap -c HelloWorld1"
  • Do some experiments. Change HelloWorld1.java and check the class file again using above mentioned two methods.
  • Try to generate and observing working of Java instructions invokevirtual, invokestatic, invokespecial, getfield, setfield etc. See chapter-6 of Java specification for explaination of these instructions.
  • Try to generate global constant pool using takatuka.optimizer.cpGlobalization.logic.StartMeGlob and see that it has a single constant pool in 1.txt file 

Lab-4
Write a program to Blink LEDs using TakaTuka
Write a program to send and receive packets using TakaTuka

Exercise (optional)
Write a program using TakaTuka, that displays on PC the number of neighbors active around a base-node. Each node can switched On or Off at any time.