Home
bgaultier edited this page Apr 12, 2013
·
15 revisions
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 : ![X-CTU screenshot.png](./raw/master/wiki/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
- 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 !