Search code examples
kaa

kaa sample apps miss build files for c sdk


I have been researching kaa platform for weeks. And yesterday, I started running a sample application named gpiocontrol on kaa github. The java (android) sdk works fine. However, when trying to build the c sdk for esp8266, I find out some files are missing, which are

  • build.sh (Refered in readme file)
  • CMakelists.txt (Prompted when I tried to run cmake)

Also, I find these missing files in some previous commits of the project. So please check and re-add these files. Thank you very much kaa team.


Update

I do notice that the build files I mentioned above can be found in the /common path of the root directory (sample-apps).


Update 2

Unfortunately, the common build files does not have specific build files for esp8266 platform. Now I'm wondering which method should be used to build kaa for this platform, follow kaa documentation for esp8266 or just add the option -DKAA_PLATFORM=esp8266 to cmake command in common build.sh file? Actually, I have tried the second way but it failed :(

The common build.sh file cmake command

build() {
    mkdir -p "$PROJECT_HOME/build"
    cd "$PROJECT_HOME/build"
    cmake -DBUILD_TESTING=OFF ..
    make
}

Still wait for your response and thank you again!


Solution

  • The sample applications' sources you have discovered in the sample-apps repository on GitHub are first assembled by Maven build tool and then deployed into Kaa Sandbox image.

    This does most of the effort necessary to build the application(s) easily using Kaa Sandbox.

    Thus, the most simple way to build and run Kaa sample applications is by downloading them from Kaa Sandbox through the web interface and then building according to the guide. The guide itself is available on the Kaa Sandbox web interface and is tested for each the application delivered with the Kaa Sandbox.

    More information on using Kaa Sandbox is available in the official Kaa Getting started documentation.

    Please let me know if using Kaa Sandbox is not an option for you and you still need to build the applications manually.


    Update: I confirm the ESP8622 platform was disabled for the Kaa Sandbox 0.10.0 release due to some issues on that platform at the release time.

    We are planning to release Kaa 0.10.1 with fixes that should include ESP8622 platform fixes soon.


    Update 2: You can now use master branch of the kaaproject/sample-apps repository to build GPIO Control application for ESP8266 platform according to the below without need to wait for the next release:

    Create a CMakeLists.txt file within the root directory of the application with the next content:

    cmake_minimum_required(VERSION 3.0.2) 
    include(config.cmake) 
    
    if (NOT DEFINED KAA_MAX_LOG_LEVEL) 
        set(KAA_MAX_LOG_LEVEL 3) 
    endif (NOT DEFINED KAA_MAX_LOG_LEVEL) 
    
    set(BUILD_TESTING OFF CACHE BOOL "") 
    
    if (NOT DEFINED KAA_SDK_PATH) 
        add_subdirectory(libs/kaa) 
    else (NOT DEFINED KAA_SDK_PATH) 
        add_subdirectory(${KAA_SDK_PATH}) 
    endif (NOT DEFINED KAA_SDK_PATH) 
    
    install(TARGETS demo_client DESTINATION bin) 
    

    Extract the Kaa SDK into libs/kaa directory.

    Then run (formatted as single command):

    mkdir build && \
    cd build && \
    cmake .. \ 
        -DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \ 
        -DKAA_PLATFORM=esp8266 && \
    make