iot-lab / iot-lab

FIT Iot-LAB repository
Other
98 stars 47 forks source link

Error while compiling the er-example-server.c in IoT-LAB #234

Closed vishal623 closed 5 years ago

vishal623 commented 6 years ago

Hello,

I am trying to compile er-example-server.c but it gives me following error.

mypc:~/iot-lab/parts/contiki/examples/er-rest-example$ make TARGET=iotlab-m3 mkdir obj_iotlab-m3 mkdir -p obj_iotlab-m3/cortex-m3/ mkdir -p obj_iotlab-m3/iotlab-m3/ mkdir -p obj_iotlab-m3/isl29020/ mkdir -p obj_iotlab-m3/l3g4200d/ mkdir -p obj_iotlab-m3/lps331ap/ mkdir -p obj_iotlab-m3/lsm303dlhc/ mkdir -p obj_iotlab-m3/n25xxx/ mkdir -p obj_iotlab-m3/rf2xx/ mkdir -p obj_iotlab-m3/softtimer/ mkdir -p obj_iotlab-m3/stm32/ mkdir -p obj_iotlab-m3/stm32f1xx/ CC ../../apps/er-coap/er-coap.c CC ../../apps/er-coap/er-coap-engine.c CC ../../apps/er-coap/er-coap-transactions.c CC ../../apps/er-coap/er-coap-observe.c CC ../../apps/er-coap/er-coap-separate.c CC ../../apps/er-coap/er-coap-res-well-known-core.c CC ../../apps/er-coap/er-coap-block1.c CC ../../apps/er-coap/er-coap-observe-client.c CC ../../apps/rest-engine/rest-engine.c CC ../../platform/iotlab-m3/../../../openlab/drivers/cortex-m3/boot.c CC ../../platform/iotlab-m3/../../../openlab/drivers/cortex-m3/nvic.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/dma.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/i2c.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/spi.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/timer.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/uart.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/unique_id.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/usb.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32/watchdog.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/adc.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/afio.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/boot.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/exti.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/flash.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/gpio.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/rcc.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/rcc_clock.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/rcc_sysclk.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/rtc.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/sdio.c CC ../../platform/iotlab-m3/../../../openlab/drivers/stm32f1xx/stm32f1xx.c CC ../../platform/iotlab-m3/../../../openlab/lib/softtimer/soft_timer_delay.c CC ../../platform/iotlab-m3/../../../openlab/periph/rf2xx/rf2xx.c CC ../../platform/iotlab-m3/../../../openlab/platform/iotlab-m3/iotlab-m3.c CC ../../platform/iotlab-m3/../../../openlab/platform/iotlab-m3/iotlab-m3_drivers.c CC ../../platform/iotlab-m3/../../../openlab/platform/iotlab-m3/iotlab-m3_lib.c CC ../../platform/iotlab-m3/../../../openlab/platform/iotlab-m3/iotlab-m3_periph.c CC ../../platform/iotlab-m3/../../../openlab/periph/lsm303dlhc/lsm303dlhc.c CC ../../platform/iotlab-m3/../../../openlab/periph/lps331ap/lps331ap.c CC ../../platform/iotlab-m3/../../../openlab/periph/l3g4200d/l3g4200d.c CC ../../platform/iotlab-m3/../../../openlab/periph/isl29020/isl29020.c CC ../../platform/iotlab-m3/../../../openlab/periph/n25xxx/n25xxx.c CC ../../platform/iotlab-m3/../openlab/clock-systick.c CC ../../platform/iotlab-m3/../openlab/watchdog.c CC ../../platform/iotlab-m3/../openlab/radio-rf2xx.c CC ../../platform/iotlab-m3/../openlab/dev/uart1.c CC ../../platform/iotlab-m3/../openlab/slip-arch.c CC ../../platform/iotlab-m3/../openlab/openlab-port.c CC ../../platform/iotlab-m3/../openlab/rtimer-arch.c CC ../../platform/iotlab-m3/./leds-arch.c CC ../../platform/iotlab-m3/./platform-sensors.c CC ../../platform/iotlab-m3/../iotlab/platform-addr.c CC ../../platform/iotlab-m3/../openlab/dev/acc-mag-sensor.c CC ../../platform/iotlab-m3/../openlab/dev/fake-button-sensor.c CC ../../platform/iotlab-m3/../openlab/dev/gyr-sensor.c CC ../../platform/iotlab-m3/../openlab/dev/light-sensor.c CC ../../platform/iotlab-m3/../openlab/dev/pressure-sensor.c CC ../../core/dev/leds.c CC ../../core/lib/sensors.c CC ../../core/dev/slip.c CC ../../platform/iotlab-m3/../openlab/dev/xmem.c CC ../../core/cfs/cfs-coffee.c CC ../../platform/iotlab-m3/../openlab/openlab-main.c CC ../../core/sys/autostart.c CC ../../core/sys/ctimer.c CC ../../core/sys/energest.c CC ../../core/sys/arg.c CC ../../core/sys/stimer.c CC ../../core/sys/etimer.c CC ../../core/sys/compower.c CC ../../core/sys/process.c CC ../../core/sys/rtimer.c CC ../../core/sys/mt.c CC ../../core/sys/procinit.c CC ../../core/sys/timer.c CC ../../core/dev/serial-line.c CC ../../core/dev/nullradio.c CC ../../core/lib/settings.c CC ../../core/lib/crc16.c CC ../../core/lib/me.c CC ../../core/lib/ifft.c CC ../../core/lib/me_tabs.c CC ../../core/lib/ccm-star.c CC ../../core/lib/mmem.c CC ../../core/lib/ringbufindex.c CC ../../core/lib/list.c CC ../../core/lib/gcr.c CC ../../core/lib/aes-128.c CC ../../core/lib/trickle-timer.c CC ../../core/lib/print-stats.c CC ../../core/lib/memb.c CC ../../core/lib/petsciiconv.c CC ../../core/lib/random.c CC ../../core/lib/assert.c CC ../../core/lib/ringbuf.c CC ../../core/net/ipv6/websocket.c CC ../../core/net/ipv6/uip-icmp6.c CC ../../core/net/ipv6/uip-ds6.c CC ../../core/net/ipv6/uip-ds6-route.c CC ../../core/net/ipv6/uip6.c CC ../../core/net/ipv6/uip-ds6-nbr.c CC ../../core/net/ipv6/uip-nd6.c CC ../../core/net/ipv6/websocket-http-client.c CC ../../core/net/ipv6/sicslowpan.c CC ../../core/net/ip/slipdev.c CC ../../core/net/ip/dhcpc.c CC ../../core/net/ip/uip-packetqueue.c CC ../../core/net/ip/tcp-socket.c CC ../../core/net/ip/uiplib.c CC ../../core/net/ip/ip64-addr.c CC ../../core/net/ip/uip-udp-packet.c CC ../../core/net/ip/psock.c CC ../../core/net/ip/tcpip.c CC ../../core/net/ip/resolv.c CC ../../core/net/ip/uip-nameserver.c CC ../../core/net/ip/uip-split.c CC ../../core/net/ip/udp-socket.c CC ../../core/net/ip/simple-udp.c CC ../../core/net/ip/uip-debug.c CC ../../core/net/rpl/rpl-nbr-policy.c CC ../../core/net/rpl/rpl-of0.c CC ../../core/net/rpl/rpl-dag.c CC ../../core/net/rpl/rpl-timers.c CC ../../core/net/rpl/rpl-ext-header.c CC ../../core/net/rpl/rpl.c CC ../../core/net/rpl/rpl-mrhof.c CC ../../core/net/rpl/rpl-ns.c CC ../../core/net/rpl/rpl-icmp6.c CC ../../core/net/rpl/rpl-dag-root.c CC ../../core/net/queuebuf.c CC ../../core/net/nbr-table.c CC ../../core/net/packetbuf.c CC ../../core/net/netstack.c CC ../../core/net/linkaddr.c CC ../../core/net/net-debug.c CC ../../core/net/link-stats.c CC ../../core/net/mac/nullmac.c CC ../../core/net/mac/nullrdc-noframer.c CC ../../core/net/mac/frame802154e-ie.c CC ../../core/net/mac/mac-sequence.c CC ../../core/net/mac/nordc.c CC ../../core/net/mac/csma.c CC ../../core/net/mac/frame802154.c CC ../../core/net/mac/mac.c CC ../../core/net/mac/framer-802154.c CC ../../core/net/mac/framer-nullmac.c CC ../../core/net/mac/phase.c CC ../../core/net/mac/nullrdc.c CC ../../core/net/mac/contikimac/contikimac.c CC ../../core/net/mac/contikimac/contikimac-framer.c CC ../../core/net/llsec/nullsec.c CC ../../core/net/llsec/anti-replay.c CC ../../core/net/llsec/ccm-star-packetbuf.c AR contiki-iotlab-m3.a CC er-example-server.c CC ./resources/res-separate.c CC ./resources/res-radio.c CC ./resources/res-light.c ./resources/res-light.c: In function 'res_get_handler': ./resources/res-light.c:60:54: error: 'LIGHT_SENSOR_PHOTOSYNTHETIC' undeclared (first use in this function) uint16_t light_photosynthetic = light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC); ^ ./resources/res-light.c:60:54: note: each undeclared identifier is reported only once for each function it appears in ./resources/res-light.c:61:45: error: 'LIGHT_SENSOR_TOTAL_SOLAR' undeclared (first use in this function) uint16_t light_solar = light_sensor.value(LIGHT_SENSOR_TOTAL_SOLAR); ^ ../../platform/openlab/Makefile.include_tail:39: recipe for target 'obj_iotlab-m3/res-light.o' failed make: *** [obj_iotlab-m3/res-light.o] Error 1 rm obj_iotlab-m3/res-radio.o obj_iotlab-m3/res-separate.o er-example-server.co

When I tried to compile in local Contiki, it doesn't give me this error.

Please guide me.

Thanks Vishal

vishal623 commented 6 years ago

It is related to dev/light-sensor.h file which is located in the platform folder. But for m3 I didn't find this file. In iotlab-m3 folder, only the following files are there.

~/contiki/platform/iotlab-m3/contiki-conf.h , leds-arch.c, Makefile.iotlab-m3, platform-headers.h and platform-sensors.c

Actually, 'LIGHT_SENSOR_PHOTOSYNTHETIC' and 'LIGHT_SENSOR_TOTAL_SOLAR' this two variable are declared in light-sensor.h file like following.

define LIGHT_SENSOR_PHOTOSYNTHETIC 0

define LIGHT_SENSOR_TOTAL_SOLAR 1

My question is where is the light-sensor.h file for iotlab-m3? It is in Contiki, or it is in openlab?

vishal623 commented 6 years ago

When I removed the light resources from code still it gives me the same error.

fsaintma commented 6 years ago

Hi I have just compiled the CoAP example on the IoT-LAB Grenoble SSH frontend and it works. So I suppose that it's a problem of arm-gcc toolchain version on your computer. Should you verify ?

<login>@grenoble:~$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150303 (release) [ARM/embedded-4_9-branch revision 221220]
vishal623 commented 6 years ago

Thanks, sir.

I have checked the version of it. When I have login in any site, it is showing the same version of arm-gcc toolchain.

"arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150303 (release) [ARM/embedded-4_9-branch revision 221220]".

In my local system, it is showing like following.

arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2018-q3-update) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]

On Mon, Sep 10, 2018 at 7:58 PM, Saint-Marcel notifications@github.com wrote:

Hi I have just compiled the CoAP example on the IoT-LAB Grenoble SSH frontend and it works. So I suppose that it's a problem of arm-gcc toolchain version on your computer. Should you verify ?

@grenoble:~$ arm-none-eabi-gcc --version arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150303 (release) [ARM/embedded-4_9-branch revision 221220] — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

-- Vishal Rathod Research Scholar, Computer Science and Engineering Department, National Institute of Technology, Karnataka. Email ID: vishalrathod.cs15f11@nitk.edu.in and vishalrathod@ieee.org

schrein commented 5 years ago

Hello @vishal623 , in order to compile Contiki 3.X on your local computer, you have to manually install and use the GNU Arm Embedded Toolchain 4.9-2015-q1-update , you can find it here: https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q1-update

vishal623 commented 5 years ago

Thanks sir.

On Mon, Jun 17, 2019 at 9:22 PM Guillaume Schreiner < notifications@github.com> wrote:

Closed #234 https://github.com/iot-lab/iot-lab/issues/234.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/iot-lab/iot-lab/issues/234?email_source=notifications&email_token=ACAC5O5DQLGBYRDCNSDN4RTP26XKNA5CNFSM4FUE3BOKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOSAQND2I#event-2418069993, or mute the thread https://github.com/notifications/unsubscribe-auth/ACAC5O2NQOGDZKNEYIQSTFTP26XKNANCNFSM4FUE3BOA .

-- Vishal Rathod Research Scholar, Department of Computer Science and Engineering, National Institute of Technology, Karnataka. Email ID: vishalrathod.cs15f11@nitk.edu.in and vishalrathod@ieee.org