1 The examples/ directory contains a few examples that will help you get
4 To run the example programs, you need either to be running Linux or
5 FreeBSD (or any other *nix-type system), or install Cygwin if you are
6 running Microsoft Windows (http://www.cygwin.com/). As a minimum you
7 will need to have the gcc C compiler installed. To run the examples in
8 the 'netsim' target, you need to have GTK 1.x development libraries
9 installed. These are usually called 'gtk-devel', 'libgtk1-devel' or
10 similar in your Linux software installation programs.
14 A test script that compiles Contiki for a number of platforms and
15 reports any errors found during the build.
19 A demo application that shows the energy consumption of eight Tmote
20 Sky boards in real-time. The graphical user interface requires Java.
24 A set of demo applications for the ESB board.
28 A really simple Contiki program that shows how to write Contiki
29 programs. To compile and test the program, go into the hello-world
32 cd examples/hello-world
34 Run the 'make' command.
38 This will compile the hello-world program in the 'native' target.
39 This causes the entire Contiki operating system and the hello-world
40 application to be compiled into a single program that can be run by
41 typing the following command:
45 This will print out the following text:
47 Contiki initiated, now starting process scheduling
50 The program will then appear to hang, and must be stopped by
51 pressing the C key while holding down the Control key.
55 A quite simple demonstration of the Contiki multi-threading library
56 employing two worker threads each running a recursive function. It
57 can be compiled and run in the 'native' target by typing the
60 cd examples/multi-threading
62 ./multi-threading.native
66 Contains a set of examples on how to use the Rime communications
67 stack. To run those examples in the 'netsim' target (a very simple
68 Contiki network simulator), compile the programs with:
72 You will need to have GTK 1.x development libraries installed.
74 Run the different programs:
77 ./test-meshroute.netsim
78 ./test-rudolph0.netsim
79 ./test-rudolph1.netsim
80 ./test-treeroute.netsim
83 Most of the examples requires you to click with the middle mouse
84 button on one of the simulated nodes for something to happen.
88 Examples inteded for running on the Tmote Sky board. To compile
89 those, you need to have msp430-gcc (the gcc C compiler for the
90 MSP430 microcontroller) installed.
92 The follwing programs are included:
94 blink.c A simple program that blinks the on-board LEDs
95 sky-collect.c Collects sensor data and energy profile values
96 to a sink. Press the "user" button on the Tmote
97 Sky that is connected to the PC to make the node a
99 test-button.c Toggles the LEDs when the button is pressed.
100 test-cfs.c Tests the 1 mb flash memory of the Tmote Sky
104 A simple TCP telnet server with a simple command shell. It can be
105 compiled and run in the 'minimal-net' target by typing the following
108 cd examples/telnet-server
110 ./telnet-server.minimal-net
112 Most likely you'll have to adjust the TCP/IP values set in main() in
113 platform/minimal-net/contiki-main.c to match your needs.
115 Please consult cpu/native/net/README-WPCAP as well if you are running
120 A text mode web browser supporting links and forms. It can be compiled
121 and run in the 'win32' target by typing the following commands:
123 cd examples/webbrowser
127 Most likely you'll have to adjust the TCP/IP values set in main() in
128 platform/win32/contiki-main.c to match your needs.
130 Please consult cpu/native/net/README-WPCAP as well.
134 A web server supporting dynamic content creation using "scripts" which
135 are actually compiled-in C-functions. It can be compiled and run in the
136 'minimal-net' target by typing the following commands:
138 cd examples/webserver
140 ./webserver.minimal-net
142 As an alternative to the static and dynamic compiled-in content the web
143 server can instead support "external" static-only content loaded from
144 any storage supported by the 'Contiki File System' (CFS) interface. To
145 compile it in the 'minimal-net' target and have it load files from disk
146 use the following command:
150 Most likely you'll have to adjust the TCP/IP values set in main() in
151 platform/minimal-net/contiki-main.c to match your needs.
153 Please consult cpu/native/net/README-WPCAP as well if you are running