how to upload contiki to arduino

hello, i'm using fedora and i'm trying to upload contiki to arduino

1st i have trying using the arduino 1.0, but when i import contiki, gives me lots of errors, because of the imports,

i would like to know, how can i compile and send it to arduino.

thanks

gives me lots of errors

Which are?

with out the contiki.h, normal...

hello-world.c:42:21: error: contiki.h: No such file or directory
hello-world.c:46: error: expected ')' before string constant
hello-world.c:47: error: expected declaration specifiers or '...' before '&' token

then i put the contiki.h in the project folder, and it appears lots of other missing files, that contiki needs...

i need to know is: with contiki in linux:

  • how to start a new project?
  • how to compile to arduino
  • how to send to arduino by usb cable, or what software i will use?

What we need to know is what contiki is, where you got contiki.h, what the contiki.cpp file contains, and when the errors you are seeing are, along with your code.

Hi! You need to obtain a copy of the Contiki Arduino port and execute the commands below.

Cheers,
Nestor

Clone contiki-arduino source code tree

git clone https://github.com/contiki/contiki-arduino

COMPILING AND UPLOADING TO ARDUINO

To compile the code, e.g., under examples/hello-world

make TARGET=arduino ARDUINO_MODEL=Duemilanove

To generate hex image file

avr-objcopy hello-world.arduino -j .text -j .data -O ihex hello-world.hex

To program the Arduino

avrdude -D -p atmega328p -c arduino -P /dev/ttyUSB0 -b 57600 -Uflash:w:hello-world.hex

To monitor the serial output

ttylog -V -d /dev/ttyUSB0 -b 115200

foxboy6:
with out the contiki.h, normal...

hello-world.c:42:21: error: contiki.h: No such file or directory
hello-world.c:46: error: expected ')' before string constant
hello-world.c:47: error: expected declaration specifiers or '...' before '&' token

then i put the contiki.h in the project folder, and it appears lots of other missing files, that contiki needs...

i need to know is: with contiki in linux:

  • how to start a new project?
  • how to compile to arduino
  • how to send to arduino by usb cable, or what software i will use?

Thanks, this made it possible for me to boot contiki on my new arduino Uno R3. I had to tweak the makefiles a bit (and disable slip-uart1 building for now) but it worked out fine. I'll ship my diffs to the contiki folks to see if they want to integrate them, so that the next person with an R3 can gain from it also.

great :slight_smile:

does it function as a complete OS? so now you can send multiple programs to it?

Steen:
great :slight_smile:

does it function as a complete OS? so now you can send multiple programs to it?

You can have several programs loaded (I think, 99% sure), and of course lots of functions to call from a shell-like environment which would be perceived as "programs" in a way, but I'm not sure you can (easily) add software later on without making a new sketch with the OS and your new programs on it. Also, having only 1-2k of writeable memory leaves not-very-much for adding stuff later.

IcePic:
Thanks, this made it possible for me to boot contiki on my new arduino Uno R3. I had to tweak the makefiles a bit (and disable slip-uart1 building for now) but it worked out fine. I'll ship my diffs to the contiki folks to see if they want to integrate them, so that the next person with an R3 can gain from it also.

I have worked around different errors and tweaked around with the makefiles too. Right now I obtain the following error about the slip-uart:

In file included from ../../platform/arduino/contiki-conf.h:49:0,
                 from ../../core/contiki.h:39,
                 from ../../core/dev/slip.c:39:
../../platform/arduino/platform-conf.h:80:4: warning: #warning "Setting default SLIP port (#0)"
../../platform/arduino/platform-conf.h:89:4: warning: #warning "Setting default SLIP baud rate (@115200)"
../../core/dev/slip.c: In function ‘process_thread_slip_process’:
../../core/dev/slip.c:278:32: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:278:53: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:281:10: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:281:31: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:281:52: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:284:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:285:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:288:2: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:289:5: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../core/dev/slip.c:290:4: warning: dereferencing type-punned pointer will break strict-aliasing rules
make: *** No rule to make target `obj_arduino/slip_uart0.o', needed by `contiki-arduino.a'.  Stop.

How did you disabled it? Where?

Thank you very much.

Juan

@IcePick: can you elaborate on the changes you had to make to e.g. the makefiles. Thanks.

IcePic:
Thanks, this made it possible for me to boot contiki on my new arduino Uno R3. I had to tweak the makefiles a bit (and disable slip-uart1 building for now) but it worked out fine. I'll ship my diffs to the contiki folks to see if they want to integrate them, so that the next person with an R3 can gain from it also.

Maybe this is a FAQ, but I see no reference to Arduino on contiki website (rather ATmega128 in Micaz platform ?) On github, the files seem to be 3-4 years old...

Could you provide a small description of the Contiki requirements and features ? It seems it's targeted at WSNs (wireless sensor nodes) but that's still very confusing.

Hello All ! Thank you for your help !

I try to install contiki on arduino Uno.

I did that :

nctsim:
Hi! You need to obtain a copy of the Contiki Arduino port and execute the commands below.

Cheers,
Nestor

Clone contiki-arduino source code tree

git clone https://github.com/contiki/contiki-arduino

COMPILING AND UPLOADING TO ARDUINO

To compile the code, e.g., under examples/hello-world

make TARGET=arduino ARDUINO_MODEL=Duemilanove

To generate hex image file

avr-objcopy hello-world.arduinoaCgYkiHX -j .text -j .data -O ihex hello-world.hex

To program the Arduino

avrdude -D -p atmega328p -c arduino -P /dev/ttyUSB0 -b 57600 -Uflash:w:hello-world.hex

To monitor the serial output

ttylog -V -d /dev/ttyUSB0 -b 115200

But before compiling, I added some lines to my contiki-arduino/platform/arduino/Makefile.arduino :

else ifeq ($(ARDUINO_MODEL), Uno) # ATmega168 @ 16MHz (5V)

http://www.arduino.cc/en/Main/ArduinoBoardUno

AVR_MCU_CLOCK = 16
AVR_MCU_SPEED = 16000000UL
MCU = atmega328
USART_PORT = 0

But when using "make TARGET=arduino ARDUINO_MODEL=Uno", here's what I get :

make TARGET=arduino ARDUINO_MODEL=Uno
avr-gcc -DCONTIKI=1 -DCONTIKI_TARGET_ARDUINO=1 -Wall -mmcu=atmega328 -gdwarf-2 -I. -I../../core -I../../cpu/avr -I../../platform/arduino -DF_CPU=16000000UL -DMCU_MHZ=16 -DAUTO_CRC_PADDING=2 -DUSART_BAUD=USART_BAUD_9600 -DUSART_PORT=RS232_PORT_0 -Os -I. -I../../platform/arduino/. -I../../platform/arduino/apps -I../../platform/arduino/net -I../../platform/arduino/loader -I../../cpu/avr/. -I../../cpu/avr/dev -I../../core/dev -I../../core/lib -I../../core/net -I../../core/net/mac -I../../core/net/rime -I../../core/net/rpl -I../../core/sys -I../../core/cfs -I../../core/ctk -I../../core/lib/ctk -I../../core/loader -I../../core/. -MMD -c ../../core/net/rime/rimeaddr.c -o obj_arduino/rimeaddr.o
In file included from ../../platform/arduino/platform-conf.h:71,
from ../../platform/arduino/contiki-conf.h:49,
from ../../core/net/rime/rimeaddr.h:58,
from ../../core/net/rime/rimeaddr.c:46:
../../cpu/avr/dev/rs232.h:56:2: error: #error "Please implement a rs232 header for your MCU (or set the MCU type in contiki-conf.h)."
In file included from ../../platform/arduino/contiki-conf.h:49,
from ../../core/net/rime/rimeaddr.h:58,
from ../../core/net/rime/rimeaddr.c:46:
../../platform/arduino/platform-conf.h:77:3: error: #error "RS232 header was not included ?"
../../platform/arduino/platform-conf.h:86:3: error: #error "RS232 header was not included ?"
make: *** [obj_arduino/rimeaddr.o] Error 1

Any idea about how to solve this?

Thank you !

Kile