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 An email program supporting SMTP. It can be compiled and run in the
20 'win32' target by typing the following commands:
26 Most likely you'll have to adjust the TCP/IP values set in main() in
27 platform/win32/contiki-main.c to match your needs.
29 Please consult cpu/native/net/README-WPCAP as well.
33 A set of demo applications for the ESB board.
37 A really simple Contiki program that shows how to write Contiki
38 programs. To compile and test the program, go into the hello-world
41 cd examples/hello-world
43 Run the 'make' command.
47 This will compile the hello-world program in the 'native' target.
48 This causes the entire Contiki operating system and the hello-world
49 application to be compiled into a single program that can be run by
50 typing the following command:
54 This will print out the following text:
56 Contiki initiated, now starting process scheduling
59 The program will then appear to hang, and must be stopped by
60 pressing the C key while holding down the Control key.
64 An IRC client. It can be compiled and run in the 'win32' target by
65 typing the following commands:
71 Most likely you'll have to adjust the TCP/IP values set in main() in
72 platform/win32/contiki-main.c to match your needs.
74 Please consult cpu/native/net/README-WPCAP as well.
78 A quite simple demonstration of the Contiki multi-threading library
79 employing two worker threads each running a recursive function. It
80 can be compiled and run in the 'native' target by typing the
83 cd examples/multi-threading
85 ./multi-threading.native
89 Contains a set of examples on how to use the Rime communications
90 stack. To run those examples in the 'netsim' target (a very simple
91 Contiki network simulator), compile the programs with:
95 You will need to have GTK 1.x development libraries installed.
97 Run the different programs:
100 ./test-meshroute.netsim
101 ./test-rudolph0.netsim
102 ./test-rudolph1.netsim
103 ./test-treeroute.netsim
104 ./test-trickle.netsim
106 Most of the examples requires you to click with the middle mouse
107 button on one of the simulated nodes for something to happen.
111 Examples inteded for running on the Tmote Sky board. To compile
112 those, you need to have msp430-gcc (the gcc C compiler for the
113 MSP430 microcontroller) installed.
115 The follwing programs are included:
117 blink.c A simple program that blinks the on-board LEDs
118 sky-collect.c Collects sensor data and energy profile values
119 to a sink. Press the "user" button on the Tmote
120 Sky that is connected to the PC to make the node a
122 test-button.c Toggles the LEDs when the button is pressed.
123 test-cfs.c Tests the 1 mb flash memory of the Tmote Sky
127 A simple TCP telnet server with a simple command shell. It can be
128 compiled and run in the 'minimal-net' target by typing the following
131 cd examples/telnet-server
133 ./telnet-server.minimal-net
135 Most likely you'll have to adjust the TCP/IP values set in main() in
136 platform/minimal-net/contiki-main.c to match your needs.
138 Please consult cpu/native/net/README-WPCAP as well if you are running
143 A text mode web browser supporting links and forms. It can be compiled
144 and run in the 'win32' target by typing the following commands:
146 cd examples/webbrowser
150 Most likely you'll have to adjust the TCP/IP values set in main() in
151 platform/win32/contiki-main.c to match your needs.
153 Please consult cpu/native/net/README-WPCAP as well.
157 A web server supporting dynamic content creation using "scripts" which
158 are actually compiled-in C-functions. It can be compiled and run in the
159 'minimal-net' target by typing the following commands:
161 cd examples/webserver
163 ./webserver-example.minimal-net
165 As an alternative to the static and dynamic compiled-in content the web
166 server can instead support "external" static-only content loaded from
167 any storage supported by the 'Contiki File System' (CFS) interface. To
168 compile it in the 'minimal-net' target and have it load files from disk
169 use the following command:
173 Most likely you'll have to adjust the TCP/IP values set in main() in
174 platform/minimal-net/contiki-main.c to match your needs.
176 Please consult cpu/native/net/README-WPCAP as well if you are running
181 A command line program that retrieves files from web servers and saves
182 them using the 'Contiki File System' (CFS). It can be compiled and run
183 in the 'minimal-net' target by typing the following commands:
189 Most likely you'll have to adjust the TCP/IP values set in main() in
190 platform/minimal-net/contiki-main.c to match your needs.
192 Please consult cpu/native/net/README-WPCAP as well if you are running