Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Home

Baptiste Gaultier edited this page · 15 revisions
Clone this wiki locally

Arduino µIPv6 Stack

In Telecom Bretagne, we love open source and IPv6. That's why we decided to port the Contiki OS network stack (6LoWPAN/IPv6 + RPL + CoAP) to our favorite prototyping platform : Arduino.

How to use IPv6 stack library

We released a first example which demonstrates the use of IPv6 stack library : IPv6UDPexample.ino In this example, you will need two Arduino Mega with Wireless Proto Shield and Xbee Series 1 mounted.

Then follow these steps :

  1. Change the value of the SERIAL_BUFFER_SIZE to 128 in /arduino-directory/hardware/arduino/cores/arduino/HardwareSerial.cpp
  2. Clone the IPv6 Stack repo : git clone https://github.com/telecombretagne/Arduino-IPv6Stack.git
  3. Upgrade and configure the Xbee modules using X-CTU like so : X-CTU screenshot.png
    • ID - PAN ID 0xABCD (if you want to talk with Contiki nodes configured with 0xABCD PAN ID by default)
    • MM - MAC Mode 2 - 802.15.4 WITH ACKS
    • AP - API Enable 2 - API ENABLED W/PPP
    • MY - 16-bit Source Address 0xFFFF
    • DH - Destination Address High 0x00
    • DL - Destination Address Low 0xFFFF
  4. You can also use your favorite serial communication program (like minicom, screen, cutecom, coolterm...)

    1. To do so, connect your Arduino MEGA mounted by a XBee shield w/ XBee Series 1 module to your computer
    2. Upload BareMinimum.ino (Files‣Examples‣01.Basics‣BareMinimum) to your Arduino MEGA (don't forget to switch the wireless shield to USB)
    3. Then fire up your terminal and type : $ screen /dev/<arduino_tty> 9600
    4. Type $ screen /dev/<arduino_tty> 9600
    5. Press +++ without pressing Enter and wait for OK
    6. Enter each command+value and press Enter (Eg. ATCHE sets channel to 0x0E==14)
    7. Then type +++ followed by Enter to write the configuration to non-volatile memory
  5. Configure your motes using contiki_conf.h

    For nodes (can be run with two nodes only):

    • UIP_CONF_ROUTER 0
    • UIP_CONF_IPV6_RPL 1
    • UIP_CONF_ND6_SEND_RA 0

For routers (can have a border router and intermediate ones (see IS_INTERMEDIATE_ROUTER in IPv6UDPexample.ino)):

  • UIP_CONF_ROUTER 1
  • UIP_CONF_IPV6_RPL 1
  • UIP_CONF_ND6_SEND_RA 0
    1. If you want a different prefix for the 6LoWPAN context then you have to define SICSLOWPAN_CONF_ADDR_CONTEXT_0 in contiki_conf.h like so : #define SICSLOWPAN_CONF_ADDR_CONTEXT_0 {addr_contexts[0].prefix[0]=0xbb;addr_contexts[0].prefix[1]=0xbb;addr_contexts[0].prefix[2]=0;addr_contexts[0].prefix[3]=0;addr_contexts[0].prefix[4]=0;addr_contexts[0].prefix[5]=0;addr_contexts[0].prefix[6]=0;addr_contexts[0].prefix[7]=0;}
  • Change it in the example too (IPv6UDPexample.ino) and put the same as in the context: IPv6Address prefix(0xbb, 0xbb, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
    1. Upload IPv6UDPexample.ino to the two Arduino Mega (don't forget to switch the wireless shield to USB)
    2. Switch to Micro position. The wireless module will then communicate with the microcontroller.
    3. Enjoy !
Something went wrong with that request. Please try again.