You are on page 1of 9

SRM Institute of Science and Technology

Department of Computer science and Engineering

Wireless Sensor Networks


Laboratory

Prepared By
Dr. A. Revathi
AP, Dept of CSE,
SRMIST
List of Experiments
S.No Name of Experiment
1 Hello-world example for the Remote platform using Contiki
2 Test the LED’s and Buttons using Contiki Programming
3 Implementing Timers using Contiki
4 Implementing Processes in Contiki
5 Implementing Analog sensors in Contiki
6 Implementing Digital sensors in Contiki
7 Implementing general input/ output pins in Contiki
8 Device addressing in Contiki
9 Setting Bandwidth and Channel in Contiki
10 Setting up Transmission power in Contiki
11 Changing the transmission power for the Remote in Contiki
12 Checking the Wireless Link
13 Configuring MAC layer using Contiki
14 Enabling IPV6 in Contiki
15 Enabling RPL using Contiki
Introduction to Contiki
Contiki is an operating system for
– networked, memory-constrained systems(35KB of ROM and around
3K of RAM)
– focus on low-power wireless Internet of Things devices
– It is an Embedded operating system
Contiki_NG – OS for next generation IOT devices.

Things to Know for this lab


– Understand Contiki C-programming code.
– Compile the code.
– Deploy code on a sensor node. (Optional)
– Through serial output of the sensor node see the result. (Optional)
Use of Makefile

• In order to run the code on the sensor node we need


make files telling the compiler how to compile the
programs for which specific platform.
Commands for Compile and Run

• Goto the corresponding directory where the program is stored


• Compilation: make TARGET=native <file name>
• Execution : ./<filename>.native

• Reference Link – For LED Programming


• https://www.youtube.com/watch?v=vU3B6e2H8aw
PROCESS(name, strname);

Implementing Process on Contiki

A Contiki process consists of two parts:


• a process control block
• a process thread.
structure of a process and protothread
PROCESS(name, strname); (PCB)
where,
• name - The variable name of the process structure.
• strname - The string representation of the process' name
• A process' thread contains the execution code of the
process.
• PROCESS_THREAD(name, ev, data)
where,
•name - The variable name of the process structure.
•ev - Event identifier sent to the thread during
invokation.
•data - Pointer to data passed to the thread during
invokation.
#include "contiki.h"
#include <stdio.h> PROCESS(example_process,"Example process");
AUTOSTART_PROCESSES(&example_process);
PROCESS_THREAD(example_process, ev, data)
{
PROCESS_BEGIN();
while(1)
{
PROCESS_WAIT_EVENT();
printf("Got event number %d\n", ev);
}
PROCESS_END();
}
Thank You

You might also like