Reverted recent change as there's now a general (and actually working) solution in...
[contiki-2.x.git] / README-EXAMPLES
blob83039b1a8745cab76da2d5a98c445243390d4b11
1 The examples/ directory contains a few examples that will help you get
2 started with Contiki.
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.
12 compile-platforms/
14   A test script that compiles Contiki for a number of platforms and
15   reports any errors found during the build.
17 energest-demo/
19   A demo application that shows the energy consumption of eight Tmote
20   Sky boards in real-time. The graphical user interface requires Java.
22 esb/
24   A set of demo applications for the ESB board.
26 hello-world/
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
30   directory:
32     cd examples/hello-world
34   Run the 'make' command.
36     make
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:
43     ./hello-world.native
45   This will print out the following text:
47     Contiki initiated, now starting process scheduling
48     Hello, world
50   The program will then appear to hang, and must be stopped by
51   pressing the C key while holding down the Control key.
53 multi-threading/
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
58   following commands:
60     cd examples/multi-threading
61     make
62     ./multi-threading.native
64 rime/
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:
70     make TARGET=netsim
72   You will need to have GTK 1.x development libraries installed.
74   Run the different programs:
75   
76     ./test-abc.netsim
77     ./test-meshroute.netsim
78     ./test-rudolph0.netsim
79     ./test-rudolph1.netsim
80     ./test-treeroute.netsim
81     ./test-trickle.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.
86 sky/
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
98                      sink.
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
102 telnet-server/
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
106   commands:
108     cd examples/telnet-server
109     make
110     ./telnet-server.minimal-net
111     
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.
114   
115   Please consult cpu/native/net/README-WPCAP as well if you are running
116   Microsoft Windows.
118 webbrowser/
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
124     make
125     ./webbrowser.win32
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.
132 webserver/
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
139     make
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:
148     make HTTPD-CFS=1
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
154   Microsoft Windows.