This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Alexa gadget example

Hi all,

I've found an alexa gadget example but I can't seem to get it running on my nRF52840-DK. The example I've found was located under repository:

https://github.com/nordic-auko/fw-nrfconnect-nrf.git

I've installed the following tools on my windows 10 PC already:

1) zephyr, This can run the blinky example on my nRF52840-DK, can build and flash.

2) nanoPB, although the NANOPB_PATH didn't got found in the t manifest? I fixed it by hard coding it for now, need to find the solution yet

3) ALEXA_EMBEDDED_PATH, same issue as nr 2 and also hard coded it temporary just to see if building it is possible

Now West is willing to start building the application as all configurations are met but I still get errors. 

file *\nanopb_generator.py", line 50, in <module>
from .proto import nanopb_pb2
ModuleNotFoundError: No module named '__main__.proto'; '__main__' is not a package

Anybody got an idea on how to proceed?

Thanks

Parents Reply Children
  • Hi Simon,

    Thanks for your reply. I did the commands you told me but all of the requirements where already satisfied.

    The error message has not changed as well when I retry my command:

    >west build -p auto -b nrf52840dk_nrf52840 samples/bluetooth/alexa_gadget

  • Hi, I've found something

    I've uninstalled all protobuf packages (also python3-protobuf) using pip.

    Reinstalled only the protobuf 

    >pip3 install protobuf

    And it got me further now. I only neet to figure out how 2 files are not found.

    Got the following error now:

    >west build -p auto -b nrf52840dk_nrf52840 samples/bluetooth/alexa_gadget
    [211/243] Building C object src/gadgets/CMakeFiles/ALEXA_GADGETS_PROFILE.dir/gadgets_profile.c.obj
    FAILED: src/gadgets/CMakeFiles/ALEXA_GADGETS_PROFILE.dir/gadgets_profile.c.obj
    C:\gnuarmemb\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.4.0-rc1-117-g6c53e9331854 -DKERNEL -DNRF52840_XXAA -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/include -Izephyr/include/generated -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf52 -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/subsys/settings/include -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/subsys/bluetooth -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/subsys/bluetooth/controller/ll_sw/nordic -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/nrfx -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/nrfx/drivers/include -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/nrfx/mdk -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/. -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/debug/segger/rtt -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/crypto/tinycrypt/lib/include -IC:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget/src/gadgets -Igenerated/alexa/protobuf -IC:%REPOSITORY_HOME_PATH%/nanopb-0.4.2-windows-x86 -isystem C:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/lib/libc/minimal/include -isystem c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.3.1/include -isystem c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.3.1/include-fixed -Os -imacros C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros C:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:%REPOSITORY_HOME_PATH%/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT src/gadgets/CMakeFiles/ALEXA_GADGETS_PROFILE.dir/gadgets_profile.c.obj -MF src\gadgets\CMakeFiles\ALEXA_GADGETS_PROFILE.dir\gadgets_profile.c.obj.d -o src/gadgets/CMakeFiles/ALEXA_GADGETS_PROFILE.dir/gadgets_profile.c.obj -c C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget/src/gadgets/gadgets_profile.c
    C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget/src/gadgets/gadgets_profile.c:12:10: fatal error: bluetooth/services/gadgets.h: No such file or directory
    12 | #include <bluetooth/services/gadgets.h>
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    [212/243] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    C:\gnuarmemb\bin\arm-none-eabi-gcc.exe -DBUILD_VERSION=v2.4.0-rc1-117-g6c53e9331854 -DKERNEL -DNRF52840_XXAA -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/include -Izephyr/include/generated -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf52 -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/subsys/settings/include -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/subsys/bluetooth -IC:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/subsys/bluetooth/controller/ll_sw/nordic -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/cmsis/CMSIS/Core/Include -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/nrfx -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/nrfx/drivers/include -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/nrfx/mdk -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/hal/nordic/. -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/debug/segger/rtt -IC:%REPOSITORY_HOME_PATH%/zephyrproject/modules/crypto/tinycrypt/lib/include -IC:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget/src/gadgets -Igenerated/alexa/protobuf -IC:%REPOSITORY_HOME_PATH%/nanopb-0.4.2-windows-x86 -isystem C:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/lib/libc/minimal/include -isystem c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.3.1/include -isystem c:/gnuarmemb/bin/../lib/gcc/arm-none-eabi/9.3.1/include-fixed -Os -imacros C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacros C:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-address-of-packed-member -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:%REPOSITORY_HOME_PATH%/zephyrproject/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:%REPOSITORY_HOME_PATH%/zephyrproject=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget/src/main.c
    C:%REPOSITORY_HOME_PATH%/fw-nrfconnect-nrf/samples/bluetooth/alexa_gadget/src/main.c:17:10: fatal error: dk_buttons_and_leds.h: No such file or directory
    17 | #include <dk_buttons_and_leds.h>
    | ^~~~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    [220/243] Building C object src/gadgets/CMakeFiles/ALEXA_GADGETS_PROFILE.dir/__/__/generated/alexa/protobuf/eventHeader.pb.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' --build '%REPOSITORY_HOME_PATH%\fw-nrfconnect-nrf\build'

    >

  • Mysteryduck said:
    bluetooth/services/gadgets.h: No such file or directory
    12 | #include <bluetooth/services/gadgets.h>

    I think can be solved by simply adding the gadgets.h file to nrf/include/bluetooth/services.

    Check out this commit, which I think includes all the changes that should get applied to the nrf repository in order to make the Alexa Gadgets service sample to work.

    Best regards,

    Simon

Related