MCPcopy Index your code
hub / github.com/contiki-os/contiki

github.com/contiki-os/contiki @3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 3.0 ↗ · + Follow
15,005 symbols 38,885 edges 2,596 files 6,028 documented · 40%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Contiki Examples

The examples/ directory contains a few examples that will help you get started with Contiki.

To run the example programs, you need either to be running Linux or FreeBSD (or any other UNIX-type system), or install Cygwin if you are running Microsoft Windows http://cygwin.com. As a minimum you will need to have the gcc C compiler installed. To run the examples in the 'netsim' target, you need to have GTK 1.x development libraries installed. These are usually called 'gtk-devel', 'libgtk1-devel' or similar in your Linux software installation programs.

compile-platforms/

A test script that compiles Contiki for a number of platforms and reports any errors found during the build.

email/

An email program supporting SMTP. It can be compiled and run in the 'win32' target by typing the following commands:

cd examples/email
make
./email-client.win32

Most likely you'll have to adjust the TCP/IP values set in main() in platform/win32/contiki-main.c to match your needs.

Please consult cpu/native/net/README-WPCAP.md as well.

esb/

A set of demo applications for the ESB board.

ftp/

An FTP client supporting download. It can be compiled and run in the 'win32' target by typing the following commands:

cd examples/ftp
make
./ftp-client.win32

Most likely you'll have to adjust the TCP/IP values set in main() in platform/win32/contiki-main.c to match your needs.

Please consult cpu/native/net/README-WPCAP.md as well.

hello-world/

A really simple Contiki program that shows how to write Contiki programs. To compile and test the program, go into the hello-world directory:

cd examples/hello-world

Run the 'make' command.

make

This will compile the hello-world program in the 'native' target. This causes the entire Contiki operating system and the hello-world application to be compiled into a single program that can be run by typing the following command:

./hello-world.native

This will print out the following text:

Contiki initiated, now starting process scheduling
Hello, world

The program will then appear to hang, and must be stopped by pressing the C key while holding down the Control key.

irc/

An IRC client. It can be compiled and run in the 'win32' target by typing the following commands:

cd examples/irc
make
./irc-client.win32

Most likely you'll have to adjust the TCP/IP values set in main() in platform/win32/contiki-main.c to match your needs.

Please consult cpu/native/net/README-WPCAP.md as well.

multi-threading/

A quite simple demonstration of the Contiki multi-threading library employing two worker threads each running a recursive function. It can be compiled and run in the 'native' target by typing the following commands:

cd examples/multi-threading
make
./multi-threading.native

rime/

Contains a set of examples on how to use the Rime communications stack. To run those examples in the 'netsim' target (a very simple Contiki network simulator), compile the programs with:

make TARGET=netsim

You will need to have GTK 1.x development libraries installed.

Run the different programs:

./test-abc.netsim
./test-meshroute.netsim
./test-rudolph0.netsim
./test-rudolph1.netsim
./test-treeroute.netsim
./test-trickle.netsim

Most of the examples requires you to click with the middle mouse button on one of the simulated nodes for something to happen.

sky/

Examples inteded for running on the Tmote Sky board. To compile those, you need to have msp430-gcc (the gcc C compiler for the MSP430 microcontroller) installed.

The follwing programs are included:

  • blink.c A simple program that blinks the on-board LEDs
  • sky-collect.c Collects sensor data and energy profile values to a sink. Press the "user" button on the Tmote Sky that is connected to the PC to make the node a sink.
  • test-button.c Toggles the LEDs when the button is pressed.
  • test-cfs.c Tests the 1 mb flash memory of the Tmote Sky

telnet-server/

A simple TCP telnet server with a simple command shell. It can be compiled and run in the 'minimal-net' target by typing the following commands:

cd examples/telnet-server
make
./telnet-server.minimal-net

Most likely you'll have to adjust the TCP/IP values set in main() in platform/minimal-net/contiki-main.c to match your needs.

Please consult cpu/native/net/README-WPCAP.md as well if you are running Microsoft Windows.

webbrowser/

A text mode web browser supporting links and forms. It can be compiled and run in the 'win32' target by typing the following commands:

cd examples/webbrowser
make
./webbrowser.win32

Most likely you'll have to adjust the TCP/IP values set in main() in platform/win32/contiki-main.c to match your needs.

Please consult cpu/native/net/README-WPCAP.md as well.

webserver/

A web server supporting dynamic content creation using "scripts" which are actually compiled-in C-functions. It can be compiled and run in the 'minimal-net' target by typing the following commands:

cd examples/webserver
make
./webserver-example.minimal-net

As an alternative to the static and dynamic compiled-in content the web server can instead support "external" static-only content loaded from any storage supported by the 'Contiki File System' (CFS) interface. To compile it in the 'minimal-net' target and have it load files from disk use the following command:

make HTTPD-CFS=1

Most likely you'll have to adjust the TCP/IP values set in main() in platform/minimal-net/contiki-main.c to match your needs.

Please consult cpu/native/net/README-WPCAP.md as well if you are running Microsoft Windows.

wget/

A command line program that retrieves files from web servers and saves them using the 'Contiki File System' (CFS). It can be compiled and run in the 'minimal-net' target by typing the following commands:

cd examples/wget
make
./wget.minimal-net

Most likely you'll have to adjust the TCP/IP values set in main() in platform/minimal-net/contiki-main.c to match your needs.

Please consult cpu/native/net/README-WPCAP.md as well if you are running Microsoft Windows.

Extension points exported contracts — how you extend this code

MoteType (Interface)
The mote type defines properties common for several motes. These properties may differ between different implementations [6 …
tools/cooja/java/org/contikios/cooja/MoteType.java
Visualizer (Interface)
(no doc) [14 implementers]
tools/collect-view/src/org/contikios/contiki/collect/Visualizer.java
CoffeeImage (Interface)
(no doc) [6 implementers]
tools/coffee-manager/org/contikios/coffee/CoffeeImage.java
Mote (Interface)
A simulated mote. All motes have an interface handler, a mote type and a mote memory. @see org.contikios.cooja.MoteInt [6 …
tools/cooja/java/org/contikios/cooja/Mote.java
Configurable (Interface)
(no doc) [4 implementers]
tools/collect-view/src/org/contikios/contiki/collect/Configurable.java
RadioPacket (Interface)
COOJA's general radio packet. In order to support cross-level communication, all radios must support transmitting and re [10 …
tools/cooja/java/org/contikios/cooja/RadioPacket.java
SerialConnectionListener (Interface)
(no doc) [3 implementers]
tools/collect-view/src/org/contikios/contiki/collect/SerialConnectionListener.java
ContikiMoteInterface (Interface)
A Contiki mote interface has information about which, if any, core interfaces it needs. All classes implementing this i [13 …
tools/cooja/java/org/contikios/cooja/contikimote/ContikiMoteInterface.java

Core symbols most depended-on inside this repo

printf
called by 1357
cpu/mc1322x/lib/printf.c
add
called by 531
tools/cooja/java/org/contikios/cooja/util/ArrayUtils.java
append
called by 482
tools/cooja/java/org/contikios/cooja/plugins/ScriptLog.java
equals
called by 406
tools/cooja/apps/mrm/java/org/contikios/mrm/AngleInterval.java
add
called by 397
tools/cooja/apps/mspsim/src/org/contikios/cooja/mspmote/MspMote.java
getName
called by 309
tools/cooja/java/org/contikios/cooja/plugins/BufferListener.java
printf
called by 253
platform/cooja/sys/log.c
etimer_set
called by 248
core/sys/etimer.c

Shape

Function 7,036
Method 4,077
Class 3,777
Enum 76
Interface 39

Languages

C57%
Java29%
C++12%
Python1%
TypeScript1%

Modules by API surface

cpu/rl78/sfrs-ext.h315 symbols
cpu/rl78/sfrs.h208 symbols
tools/cooja/java/org/contikios/cooja/plugins/BufferListener.java157 symbols
tools/cooja/java/org/contikios/cooja/Cooja.java146 symbols
tools/cooja/java/org/contikios/cooja/plugins/Visualizer.java105 symbols
tools/cooja/java/org/contikios/cooja/plugins/TimeLine.java104 symbols
tools/stm32w/stm32w_flasher/py_files/rs232_interface.py69 symbols
tools/cooja/java/org/contikios/cooja/contikimote/ContikiMoteType.java67 symbols
tools/collect-view/src/org/contikios/contiki/collect/CollectServer.java64 symbols
tools/cooja/apps/mrm/java/org/contikios/mrm/ChannelModel.java63 symbols
core/ctk/ctk.h60 symbols
apps/er-coap/er-coap.c55 symbols

For agents

$ claude mcp add contiki \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact