Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thielemans/4246df73d159985b16f0e87c72e2f332 to your computer and use it in GitHub Desktop.
Save thielemans/4246df73d159985b16f0e87c72e2f332 to your computer and use it in GitHub Desktop.
Contiki setup on a new linux (virtual) machine
1. Installation
a. Install & update Linux
b. Optional: Install virtualbox guest additions
c. If using a minimal install, install common developer tools like java, git, etc…
i. sudo apt install openjdk-8-jdk git python build-essential
ii. Optional: Install Eclipse IDE for C/C++ Developers
2. Download Contiki from git
a. git clone https://github.com/contiki-os/contiki.git
b. git submodule update --init --recursive
3. Installation for cooja
Note: cooja and cooja-motes work on 64-bit OS but require a 32-bit java and gcc compilation. It also contains deprecated code so one should use Java 8!
a. # apt install openjdk-8-jdk:i386 libc6-dev-i386 ant
b. edit file contiki/tools/config/cooja/config/external_tools.config to compile 32-bit
i. Line 17 (COMPILER_ARGS) append with: -m32
ii. Line 18 (LINK_COMMAND_1) append with: -m32
c. Start cooja using the JAVA_HOME environment variable pointing to the 32-bit java. This can be done via the following cooja.sh script:
#!/bin/bash
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-i386"
export JAVA_HOME
ant run
d. Set executable permissions via chmod +x cooja.sh
e. From now on, start cooja using ./cooja.sh instead of ant run
4. Compiler for Zolertia ZOUL (Re-mote, Firefly) and other ARM microcontrollers
a. # apt install gcc-arm-none-eabi
5. Compiler for Zoleria Z1 and other MSP430 microcontrollers
a. # apt install binutils-msp430 gcc-msp430 msp430-libc
6. Other uploading/serialview/tunslip related things
a. Install python and python-serial which might be needed for uploading
i. #apt install python python-serial
b. Add user to dialout group for enabling serialview/login to work without sudo
i. #usermod -a -G dialout <user>
ii. A logout/login (or reboot) is required to take effect
c. Recompile tunslip6 from source (in case of a 64bit OS)
i. In Contiki/tools: gcc -o tunslip6 tunslip6.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment