contiki-os / contiki

The official git repository for Contiki, the open source OS for the Internet of Things
http://www.contiki-os.org/
Other
3.72k stars 2.58k forks source link

cooja simulation compile error with rpl-border-router #844

Closed zwpaper closed 10 years ago

zwpaper commented 10 years ago

I was using cooja to simulate the contiki. But when I try to simulate the rpl -border-router example, when add motes by compiling the border-router.c, no matter what platform I chose, there were errors occur. Cooja mote:

make border-router.cooja TARGET=cooja CC border-router.c CC ../../../platform/cooja/./contiki-cooja-main.c ../../../platform/cooja/./contiki-cooja-main.c: In function 'contiki_init': ../../../platform/cooja/./contiki-cooja-main.c:231:14: warning: variable 'shortaddr' set but not used [-Wunused-but-set-variable] uint16_t shortaddr; ^ ../../../platform/cooja/./contiki-cooja-main.c:289:5: warning: passing argument 1 of 'linkaddr_copy' from incompatible pointer type [enabled by default] linkaddr_copy(addr, &linkaddr_node_addr); ^ In file included from ../../../core/./net/rime/announcement.h:69:0, from ../../../core/./net/rime/rime.h:48, from ../../../platform/cooja/./contiki-cooja-main.c:52: ../../../core/./net/linkaddr.h:86:6: note: expected 'union linkaddrt ' but argument is of type 'uint8_t ' void linkaddr_copy(linkaddr_t dest, const linkaddr_t *from); ^ ../../../platform/cooja/./contiki-cooja-main.c:325:3: warning: implicit declaration of function 'eeprom_init' [-Wimplicit-function-declaration] eeprom_init(); ^ mv contiki-cooja-main.o obj_cooja/mtype783.o CC slip-bridge.c slip-bridge.c:44:23: fatal error: dev/uart1.h: No such file or directory

include "dev/uart1.h"

                   ^

compilation terminated. make: _\ [obj_cooja/slip-bridge.o] Error 1 Process returned error code 2

after I add the uart1.h to platform/cooja/dev This occurred

make border-router.cooja TARGET=cooja CC border-router.c CC ../../../platform/cooja/./contiki-cooja-main.c ../../../platform/cooja/./contiki-cooja-main.c: In function 'contiki_init': ../../../platform/cooja/./contiki-cooja-main.c:231:14: warning: variable 'shortaddr' set but not used [-Wunused-but-set-variable] uint16_t shortaddr; ^ ../../../platform/cooja/./contiki-cooja-main.c:289:5: warning: passing argument 1 of 'linkaddr_copy' from incompatible pointer type [enabled by default] linkaddr_copy(addr, &linkaddr_node_addr); ^ In file included from ../../../core/./net/rime/announcement.h:69:0, from ../../../core/./net/rime/rime.h:48, from ../../../platform/cooja/./contiki-cooja-main.c:52: ../../../core/./net/linkaddr.h:86:6: note: expected 'union linkaddrt ' but argument is of type 'uint8_t ' void linkaddr_copy(linkaddr_t dest, const linkaddr_t from); ^ ../../../platform/cooja/./contiki-cooja-main.c:325:3: warning: implicit declaration of function 'eeprom_init' [-Wimplicit-function-declaration] eeprom_init(); ^ mv contiki-cooja-main.o obj_cooja/mtype136.o CC slip-bridge.c ar rcf obj_cooja/mtype136.a obj_cooja/simEnvChange.o obj_cooja/cooja_mt.o obj_cooja/cooja_mtarch.o obj_cooja/rtimer-arch.o obj_cooja/slip.o obj_cooja/watchdog.o obj_cooja/rimestats.o obj_cooja/beep.o obj_cooja/button-sensor.o obj_cooja/ip.o obj_cooja/leds-arch.o obj_cooja/moteid.o obj_cooja/pir-sensor.o obj_cooja/rs232.o obj_cooja/vib-sensor.o obj_cooja/clock.o obj_cooja/log.o obj_cooja/cfs-cooja.o obj_cooja/cooja-radio.o obj_cooja/eeprom.o obj_cooja/random.o obj_cooja/sensors.o obj_cooja/leds.o obj_cooja/symbols.o obj_cooja/uip-driver.o obj_cooja/arg.o obj_cooja/autostart.o obj_cooja/compower.o obj_cooja/ctimer.o obj_cooja/energest.o obj_cooja/etimer.o obj_cooja/mt.o obj_cooja/process.o obj_cooja/procinit.o obj_cooja/rtimer.o obj_cooja/stimer.o obj_cooja/timer.o obj_cooja/nullradio.o obj_cooja/serial-line.o obj_cooja/aes-128.o obj_cooja/assert.o obj_cooja/crc16.o obj_cooja/gcr.o obj_cooja/ifft.o obj_cooja/list.o obj_cooja/me.o obj_cooja/me_tabs.o obj_cooja/memb.o obj_cooja/mmem.o obj_cooja/petsciiconv.o obj_cooja/print-stats.o obj_cooja/ringbuf.o obj_cooja/settings.o obj_cooja/trickle-timer.o obj_cooja/linkaddr.o obj_cooja/nbr-table.o obj_cooja/netstack.o obj_cooja/packetbuf.o obj_cooja/packetqueue.o obj_cooja/queuebuf.o obj_cooja/dhcpc.o obj_cooja/psock.o obj_cooja/resolv.o obj_cooja/simple-udp.o obj_cooja/slipdev.o obj_cooja/tcp-socket.o obj_cooja/tcpip.o obj_cooja/udp-socket.o obj_cooja/uip-debug.o obj_cooja/uip-packetqueue.o obj_cooja/uip-split.o obj_cooja/uip-udp-packet.o obj_cooja/uiplib.o obj_cooja/uaodv-rt.o obj_cooja/uaodv.o obj_cooja/uip-fw-drv.o obj_cooja/uip-fw.o obj_cooja/uip-neighbor.o obj_cooja/uip-over-mesh.o obj_cooja/uip.o obj_cooja/uip_arp.o obj_cooja/sicslowpan.o obj_cooja/uip-ds6-nbr.o obj_cooja/uip-ds6-route.o obj_cooja/uip-ds6.o obj_cooja/uip-icmp6.o obj_cooja/uip-nd6.o obj_cooja/uip6.o obj_cooja/csma.o obj_cooja/frame802154.o obj_cooja/framer-802154.o obj_cooja/framer-nullmac.o obj_cooja/framer.o obj_cooja/mac-sequence.o obj_cooja/mac.o obj_cooja/nullmac.o obj_cooja/nullrdc-noframer.o obj_cooja/nullrdc.o obj_cooja/phase.o obj_cooja/abc.o obj_cooja/announcement.o obj_cooja/broadcast-announcement.o obj_cooja/broadcast.o obj_cooja/chameleon-bitopt.o obj_cooja/chameleon-raw.o obj_cooja/chameleon.o obj_cooja/channel.o obj_cooja/collect-link-estimate.o obj_cooja/collect-neighbor.o obj_cooja/collect.o obj_cooja/ipolite.o obj_cooja/mesh.o obj_cooja/multihop.o obj_cooja/neighbor-discovery.o obj_cooja/netflood.o obj_cooja/polite-announcement.o obj_cooja/polite.o obj_cooja/rime.o obj_cooja/rmh.o obj_cooja/route-discovery.o obj_cooja/route.o obj_cooja/rucb.o obj_cooja/rudolph0.o obj_cooja/rudolph1.o obj_cooja/rudolph2.o obj_cooja/runicast.o obj_cooja/stbroadcast.o obj_cooja/stunicast.o obj_cooja/timesynch.o obj_cooja/trickle.o obj_cooja/unicast.o obj_cooja/rpl-dag.o obj_cooja/rpl-ext-header.o obj_cooja/rpl-icmp6.o obj_cooja/rpl-mrhof.o obj_cooja/rpl-of0.o obj_cooja/rpl-timers.o obj_cooja/rpl.o obj_cooja/anti-replay.o obj_cooja/ccm.o obj_cooja/nullsec.o Redefining printf objcopy --redefine-sym printf=log_printf border-router.co; objcopy --redefine-sym printf=log_printf obj_cooja/mtype136.o; objcopy --redefine-sym printf=log_printf obj_cooja/slip-bridge.o; objcopy --redefine-sym printf=log_printf obj_cooja/httpd-simple.o; objcopy --redefine-sym printf=log_printf obj_cooja/mtype136.a; objcopy --redefine-sym puts=log_puts border-router.co; objcopy --redefine-sym puts=log_puts obj_cooja/mtype136.o; objcopy --redefine-sym puts=log_puts obj_cooja/slip-bridge.o; objcopy --redefine-sym puts=log_puts obj_cooja/httpd-simple.o; objcopy --redefine-sym puts=log_puts obj_cooja/mtype136.a; objcopy --redefine-sym putchar=log_putchar border-router.co; objcopy --redefine-sym putchar=log_putchar obj_cooja/mtype136.o; objcopy --redefine-sym putchar=log_putchar obj_cooja/slip-bridge.o; objcopy --redefine-sym putchar=log_putchar obj_cooja/httpd-simple.o; objcopy --redefine-sym putchar=log_putchar obj_cooja/mtype136.a; gcc -I'/home/paper/Software/jdk/include' -I'/home/paper/Software/jdk/include/linux' -shared -Wl,-Map=obj_cooja/mtype136.map -o obj_cooja/mtype136.cooja border-router.co obj_cooja/mtype136.o obj_cooja/slip-bridge.o obj_cooja/httpd-simple.o obj_cooja/mtype136.a obj_cooja/mtype136.a(log.o): In function putchar': /home/paper/Dev/Contiki/contiki/examples/ipv6/rpl-border-router/../../../platform/cooja/sys/log.c:114: multiple definition oflog_putchar' obj_cooja/slip-bridge.o:/home/paper/Dev/Contiki/contiki/examples/ipv6/rpl-border-router/slip-bridge.c:125: first defined here collect2: error: ld returned 1 exit status make: _* [obj_cooja/mtype136.cooja] Error 1 Process returned error code 2

sky and some others:

make border-router.sky TARGET=sky CC slip-bridge.c AR contiki-sky.a CC ../../../platform/sky/./contiki-sky-main.c LD border-router.sky border-router.co: file not recognized: File format not recognized collect2: ld returned 1 exit status make: *\ [border-router.sky] Error 1 rm obj_sky/contiki-sky-main.o Process returned error code 2

Is there anyone know something about this?

I am trying to learn the rpl from the Cooja simulation, Is there anyone have other idea learning the rpl in contiki?

Sincerely Thanks. Paper

ejoerns commented 10 years ago

Ouh.. shows some remaining weaknesses of parts of the contiki implementation..

I tried to make a quick fix, just try it ;) Use tunslip6 and the SerialSocketServer to connect to the rpl mote.

For the future there should be a more generic and non-redundant definition of some devices, especially the uarts!