Skip to content

Contiki-NG: The OS for Next Generation IoT Devices

License

Notifications You must be signed in to change notification settings

bunnmv/contiki-ng

 
 

Repository files navigation

Logo

Contiki-NG: The OS for Next Generation IoT Devices

Build Status Documentation Status license Latest release GitHub Release Date Last commit

Contiki-NG is an open-source, cross-platform operating system for Next-Generation IoT devices. It focuses on dependable (secure and reliable) low-power communication and standard protocols, such as IPv6/6LoWPAN, 6TiSCH, RPL, and CoAP. Contiki-NG comes with extensive documentation, tutorials, a roadmap, release cycle, and well-defined development flow for smooth integration of community contributions.

Unless explicitly stated otherwise, Contiki-NG sources are distributed under the terms of the 3-clause BSD license. This license gives everyone the right to use and distribute the code, either in binary or source code format, as long as the copyright license is retained in the source code.

Contiki-NG started as a fork of the Contiki OS and retains some of its original features.

Find out more:

Engage with the community:

Marcus' notes and Contiki-NG cheat sheet

Below are listed a series of useful commands and other tips for Contiki NG and Cooja usage focused on MacOS and Docker environment.

  1. MacOS adjustments for Docker usage

    • Include in ~/.bash_profile:
    export CNG_PATH=<absolute-path-to-your-contiki-ng>
    alias contiker="docker run --privileged \
    --mount type=bind,source=$CNG_PATH,destination=/home/user/contiki-ng \
    -e DISPLAY=docker.for.mac.host.internal:0 \
    -ti contiker/contiki-ng"
  2. MacOS adjustments XQuartz

    • Use this version of socat command for X11 server
    socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" &
    • In case the port is in use kill the process and try again (if possible, if not the port has to be changed in the Docker)
    lsof -nP -iTCP:6000 | grep LISTEN
    kill -9 $PID
  3. Run Contiker Docker

    • Start new container and run bash
    contiker bash
  • Start new container and run Cooja

    contiker cooja
  1. Usefull Docker commands

    • List all Docker images in your host
    docker image ls -a
    • List all Docker Containers ( Containers are instances of images, you can have N containers for 1 img)
    docker container ls -a
    • Rename container
    docker container <CONTAINER-ID | CONTAINER-NAME> rename <NEW-NAME>
    • Start container
    docker container <CONTAINER-ID | CONTAINER-NAME> start
    • Stop container
    docker container <CONTAINER-ID | CONTAINER-NAME> stop
  2. Run cooja on docker from its bash

    • Using shortcut in home dir:
    ~/cooja
    • Or going to Cooja dir in contiki-ng/tools/cooja and running:
    // run cooja
    ~/contiki-ng/tools/cooja$ ant 
    
    // run cooja with higher Heap memory available to Java. 
    // Usefull for big simulations 1536M instead of 512M
    ~/contiki-ng/tools/cooja$ ant run_bigmem 
    
    // run without GUI 
    // ../../.. relates to home dir
    // all paths are realtive paths
    
    ~/contiki-ng/tools/cooja$ ant run_nogui -Dargs=../../../examples/benchmarks/rpl-req-resp-modified/sim_100.csc
  3. Advanced Cooja Run: No GUI + increased heap mem

    • Run cooja without GUI in Cooja DIR:
    ~/contiki-ng/tools/cooja$ java -mx1536m -jar dist/cooja.jar -nogui="../../examples/benchmarks/rpl-req-resp-modified/sim_100.csc" -contiki="../.."
  4. Run command on different folder without leaving the folder

    ~/contiki-ng/tools/cooja$ (cd ~/contiki-ng/examples/benchmarks/rpl-req-resp-simple/ && make TARGET=cooja clean)
    

About

Contiki-NG: The OS for Next Generation IoT Devices

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 96.1%
  • Python 2.1%
  • C++ 0.6%
  • Java 0.3%
  • Shell 0.3%
  • Makefile 0.3%
  • Other 0.3%