contiki-ng / contiki-ng

Contiki-NG: The OS for Next Generation IoT Devices
https://www.contiki-ng.org/
BSD 3-Clause "New" or "Revised" License
1.3k stars 698 forks source link

Simulate CoAP Server and BR in Cooja #1546

Closed fkerem closed 3 years ago

fkerem commented 3 years ago

I could not find any mote to simulate coap server in Cooja. I tried all motes and they did not compile. Do you have any suggestions?

jeppenodgaard commented 3 years ago

Whats your environment and what is you compile error?

Building examples/coap/coap-example-server/ with make -j coap-example-server.cooja TARGET=cooja in docker image contiker/contiki-ng should work.

atiselsts commented 3 years ago

I suggest following jeppenodgaard's advice. Let us know if there are futher questions.

fkerem commented 3 years ago

I use the docker image for Mac. Here is the compilation output I get when I use the command that you provided @jeppenodgaard

`

make -j coap-example-server.cooja TARGET=cooja CC coap-example-server.c MKDIR build/cooja/obj CC ../../../arch/platform/cooja/./platform.c CC ../../../arch/platform/cooja/lib/simEnvChange.c CC ../../../arch/platform/cooja/sys/cooja_mt.c CC ../../../arch/platform/cooja/sys/cooja_mtarch.c ../../../arch/platform/cooja/./platform.c:38:10: fatal error: jni.h: No such file or directory

include

^~~ compilation terminated. CC ../../../arch/platform/cooja/./rtimer-arch.c ../../../Makefile.include:412: recipe for target 'platform.o' failed make: [platform.o] Error 1 make: Waiting for unfinished jobs.... CC ../../../os/dev/slip.c Process returned error code 2 `

I re-cloned the repository but maybe I have to update the docker image to the latest version because there is an issue with dependency.

fkerem commented 3 years ago

No, even though I pulled the latest Docker image, I get the same compilation error:

`

make coap-example-server.cooja TARGET=cooja CC coap-example-server.c MKDIR build/cooja/obj CC ../../../arch/platform/cooja/./platform.c ../../../arch/platform/cooja/./platform.c:38:10: fatal error: jni.h: No such file or directory

include

^~~ compilation terminated. make: *** [platform.o] Error 1 ../../../Makefile.include:412: recipe for target 'platform.o' failed Process returned error code 2 `

fkerem commented 3 years ago

I figured it out, this was the case: https://github.com/contiki-ng/contiki-ng/issues/1224#issuecomment-614099135