-
Notifications
You must be signed in to change notification settings - Fork 23
Home
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.
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 :
- Change the value of the SERIAL_BUFFER_SIZE to 128 in
/arduino-directory/hardware/arduino/cores/arduino/HardwareSerial.cpp
- Clone the IPv6 Stack repo :
git clone https://github.com/telecombretagne/Arduino-IPv6Stack.git
- Upgrade and configure the Xbee modules using X-CTU like so : 
- 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
-
You can also use your favorite serial communication program (like minicom, screen, cutecom, coolterm...)
-
To do so, connect your Arduino MEGA mounted by a XBee shield w/ XBee Series 1 module to your computer
-
Upload
BareMinimum.ino
(Files‣Examples‣01.Basics‣BareMinimum) to your Arduino MEGA (don't forget to switch the wireless shield to USB) -
Then fire up your terminal and type :
$ screen /dev/<arduino_tty> 9600
-
Type
$ screen /dev/<arduino_tty> 9600
-
Press
+++
without pressing Enter and wait forOK
-
Enter each command+value and press Enter (Eg.
ATCHE
sets channel to 0x0E==14) -
Then type
+++
followed by Enter to write the configuration to non-volatile memory -
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
- 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);
- Upload
IPv6UDPexample.ino
to the two Arduino Mega (don't forget to switch the wireless shield to USB) - Switch to Micro position. The wireless module will then communicate with the microcontroller.
- Enjoy !