Contiki NG Installation
This post shows the contiki NG installation in Ubuntu 20.04 OS. The same instruction will work for Ubuntu 22.04 as well.
Requirements:
OS - Ubuntu 20.04
Contiki NG OS - https://github.com/contiki-ng/contiki-ng
Watch the video for complete installation instructions
Step 1 : Install the basics
Login in to Ubuntu and open the terminal.
Give the following command and press enter
$ sudo apt install build-essential doxygen git curl wireshark python-serial srecord rlwrap autoconf automake libxmu-dev gcc-msp430 default-jdk ant openjdk-11-jdk
Step 2: To install GCC for ARM controller
Download the following file and unzip (decompress) it in the home folder (in my case it is /home/pradeepkumar)
set the above in the PATH Environment.
/home/pradeepkumar/.bashrc
to open the above file using a terminal
$] gedit /home/pradeepkumar/.bashrc
export PATH=$PATH:/home/pradeepkumar/gcc-arm-none-eabi-5_2-2015q4-20151219-linux/bin
Step 3 : Set JAVA_HOME Path
Contiki NG Supports JDK 11 or JDK 8, hence we need to set the JAVA 11 as the default Java Compiler to work with Contiki NG.
To find the location of Java, find here
$] update-alternatives --config java
Set the Path in to the JAVA_HOME Variable.
$] cd
$] gedit /home/pradeepkumar/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
Step 4 - Installing CoAP Client
$ sudo apt-get install -y npm && sudo apt-get clean && sudo npm install coap-cli -g && sudo ln -s /usr/bin/nodejs /usr/bin/node
Step 5 - Installing MQTT Clients
$ sudo apt-get install -y mosquitto mosquitto-clients
Step 6 Download Contiki NG
$ git clone https://github.com/contiki-ng/contiki-ng.git
$ cd contiki-ng
$ git submodule update --init --recursive
Step 7 To open the cooja Simulator, follow the steps
$ cd contiki-ng/tools/cooja
$ ./gradlew run
An eclipse based editor window opens where you can do the simulation.
In case to use the compiler in the command line interface, there is a separate procedure
$ cd contiki-ng/examples/hello-world
To compile for native mode use the following method
$ make TARGET=native
To run the native example
$ ./hello-world.native
To cross compile for the sky mote, use the following command
$ make TARGET=sky
To run the sky motes, we need sky motes or else we can use the cooja simulator to emulate the application.
To cross compile for the sky mote, use the following command
$ make TARGET=zoul
Comments
Post a Comment