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

Thread COAP parameters change

Hi! I'm developing Thread mesh using nrf52840 with COAP communication. I would like to set a longer timeout and more retransmission tries in COAP. I saw this parameters in openthread source, but after compilation of library with new parameters I have problems with compilation in project. Is there any way to change this parameters from SDK for Thread? Nodes in my mesh are waking every minute and sendig a portion of data. Sometimes they're disappearing for a while but long enough for node to use all retransmission tries. I will be very grateful for help!

Best regards, Wojciech Rzepecki

  • Can you post link to the parameters in the source you changed, and describe the compilation errors you faced after this?

  • There was few linker problems. I made workaruond for my problem using MessageQueue. Messages are enqueued in case of DETACHED state. I think change of Coap parameters was wrong way.

  • Hello Wojtek,

    Please give us more logs so we can help you fix the problems with compilation errors.

    Also i would advise you to rebuild OpenThread libraries using specific commit (the one used in SDK release) - 6a15261b (git checkout 6a15261b). Of course you can use the newest one, but then there is always a chance that API has been change.

    Side note: Remember that independently of what Sleepy End Device sends to its parent, if device fails three times to deliver any packet in a row (MAC retransmissions are not counted), then node will start attachment process from the beginning (trying to find a parent that is online). I don't know if this is the issue you have expirienced, but it is always a good thing to know.

  • I built this revision of openthread and I've got errors during project build. Here is log from MAKE:

    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-cli-f
    td.a(libopenthread_cli_ftd_cli_uart.cpp.o):(.rodata._ZTIN2ot3Cli6ServerE[_ZTIN2o
    t3Cli6ServerE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type
    _info'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-cli-f
    td.a(libopenthread_cli_ftd_cli_uart.cpp.o):(.rodata._ZTIN2ot3Cli4UartE+0x0): und
    efined reference to `vtable for __cxxabiv1::__si_class_type_info'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_instance_api.cpp.o): In function `otInstancePostConstructor(o
    tInstance*)':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/api/instance_api.cpp:76: undefined
    reference to `otPlatSettingsInit'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_instance_api.cpp.o): In function `otInstanceFactoryReset':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/api/instance_api.cpp:202: undefined
     reference to `otPlatSettingsWipe'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_instance_api.cpp.o): In function `otInstanceErasePersistentIn
    fo':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/api/instance_api.cpp:211: undefined
     reference to `otPlatSettingsWipe'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_key_manager.cpp.o): In function `ot::KeyManager::ComputeKey(u
    nsigned long, unsigned char*)':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/key_manager.cpp:144: undefin
    ed reference to `__cxa_end_cleanup'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_key_manager.cpp.o):(.ARM.extab.text._ZN2ot10KeyManager10Compu
    teKeyEmPh+0x0): undefined reference to `__gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mac.cpp.o): In function `ot::Mac::Mac::GetHashMacAddress(ot::
    Mac::ExtAddress*)':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/mac/mac.cpp:460: undefined referenc
    e to `__cxa_end_cleanup'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mac.cpp.o):(.ARM.extab.text._ZN2ot3Mac3Mac17GetHashMacAddress
    EPNS0_10ExtAddressE+0x0): undefined reference to `__gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mac.cpp.o): In function `ot::Crypto::AesCcm::~AesCcm()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/crypto/aes_ccm.hpp:57: undefined re
    ference to `__cxa_end_cleanup'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mac.cpp.o):(.ARM.extab.text._ZN2ot3Mac3Mac23ProcessTransmitSe
    curityERNS0_5FrameE+0x0): undefined reference to `__gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mac.cpp.o): In function `ot::Crypto::AesCcm::~AesCcm()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/crypto/aes_ccm.hpp:57: undefined re
    ference to `__cxa_end_cleanup'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mac.cpp.o):(.ARM.extab.text._ZN2ot3Mac3Mac22ProcessReceiveSec
    urityERNS0_5FrameERKNS0_7AddressEPNS_8NeighborE+0x0): undefined reference to `__
    gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle.cpp.o): In function `ot::Mle::Mle::Store()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle.cpp:388: undefined refer
    ence to `otPlatSettingsSet'
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle.cpp:384: undefined refer
    ence to `otPlatSettingsSet'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle.cpp.o): In function `ot::Mle::Mle::Restore()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle.cpp:285: undefined refer
    ence to `otPlatSettingsGet'
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle.cpp:310: undefined refer
    ence to `otPlatSettingsGet'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle.cpp.o): In function `ot::Crypto::AesCcm::~AesCcm()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/crypto/aes_ccm.hpp:57: undefined re
    ference to `__cxa_end_cleanup'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle.cpp.o):(.ARM.extab.text._ZN2ot3Mle3Mle11SendMessageERNS_7
    MessageERKNS_3Ip67AddressE+0x0): undefined reference to `__gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle.cpp.o): In function `ot::Crypto::AesCcm::~AesCcm()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/crypto/aes_ccm.hpp:57: undefined re
    ference to `__cxa_end_cleanup'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle.cpp.o):(.ARM.extab.text._ZN2ot3Mle3Mle16HandleUdpReceiveE
    RNS_7MessageERKNS_3Ip611MessageInfoE+0x0): undefined reference to `__gxx_persona
    lity_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle_router.cpp.o): In function `ot::Mle::MleRouter::RestoreCh
    ildren()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle_router.cpp:3511: undefin
    ed reference to `otPlatSettingsGet'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle_router.cpp.o): In function `ot::Mle::MleRouter::RemoveSto
    redChild(unsigned short)':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle_router.cpp:3540: undefin
    ed reference to `otPlatSettingsGet'
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle_router.cpp:3546: undefin
    ed reference to `otPlatSettingsDelete'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle_router.cpp.o): In function `ot::Mle::MleRouter::StoreChil
    d(unsigned short)':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle_router.cpp:3573: undefin
    ed reference to `otPlatSettingsAdd'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_mle_router.cpp.o): In function `ot::Mle::MleRouter::RefreshSt
    oredChildren()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/thread/mle_router.cpp:3583: undefin
    ed reference to `otPlatSettingsDelete'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_netif.cpp.o):(.rodata._ZTIN2ot3Ip65NetifE[_ZTIN2ot3Ip65NetifE
    ]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_sha256.cpp.o):(.ARM.extab.text._ZN2ot6Crypto6Sha256D2Ev+0x0):
     undefined reference to `__gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_thread_api.cpp.o): In function `otThreadGetAutoStart':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/api/thread_api.cpp:453: undefined r
    eference to `otPlatSettingsGet'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_thread_api.cpp.o): In function `otThreadSetAutoStart':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/api/thread_api.cpp:470: undefined r
    eference to `otPlatSettingsSet'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_thread_netif.cpp.o):(.rodata._ZTIN2ot11ThreadNetifE+0x0): und
    efined reference to `vtable for __cxxabiv1::__si_class_type_info'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_aes_ecb.cpp.o):(.ARM.extab.text._ZN2ot6Crypto6AesEcbD2Ev+0x0)
    : undefined reference to `__gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_coap.cpp.o):(.rodata._ZTIN2ot4Coap4CoapE+0x0): undefined refe
    rence to `vtable for __cxxabiv1::__class_type_info'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_coap_secure.cpp.o):(.rodata._ZTIN2ot4Coap10CoapSecureE+0x0):
    undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_dataset.cpp.o): In function `ot::MeshCoP::Dataset::Clear(bool
    )':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset.cpp:64: undefined r
    eference to `otPlatSettingsDelete'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_dataset.cpp.o): In function `ot::MeshCoP::Dataset::Restore()'
    :
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset.cpp:439: undefined
    reference to `otPlatSettingsGet'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_dataset.cpp.o): In function `ot::MeshCoP::Dataset::Store()':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset.cpp:452: undefined
    reference to `otPlatSettingsDelete'
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset.cpp:456: undefined
    reference to `otPlatSettingsSet'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_dtls.cpp.o): In function `ot::MeshCoP::Dtls::HandleMbedtlsExp
    ortKeys(unsigned char const*, unsigned char const*, unsigned int, unsigned int,
    unsigned int)':
    C:\nRF5_SDK_for_Thread_v0.10.0_e1c3d11\external\openthread\project\lib\openthrea
    d\ftd\armgcc/../../../../openthread/src/core/meshcop/dtls.cpp:363: undefined ref
    erence to `__cxa_end_cleanup'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_dtls.cpp.o):(.ARM.extab.text._ZN2ot7MeshCoP4Dtls23HandleMbedt
    lsExportKeysEPKhS3_jjj+0x0): undefined reference to `__gxx_personality_v0'
    C:/NRF_workspace/nrf_sensor_coap/external/openthread/lib/gcc/libopenthread-ftd.a
    (libopenthread_ftd_hmac_sha256.cpp.o):(.ARM.extab.text._ZN2ot6Crypto10HmacSha256
    D2Ev+0x0): undefined reference to `__gxx_personality_v0'
    collect2.exe: error: ld returned 1 exit status
    C:/NRF_workspace/nrf_sensor_coap/components/toolchain/gcc/Makefile.common:153: r
    ecipe for target '_build/nrf52840_xxaa.out' failed
    make: *** [_build/nrf52840_xxaa.out] Error 1
    

    I'm using library with software encryption.

  • Hi Wojtek, Thanks for adding more logs.

    Could you check your version of GCC (arm-none-eabi-gcc -v) and give me information about linux distribution? I would suggest to use gcc version from here: developer.arm.com/.../downloads (and export bin folder to your PATH).

    Are you able to build and run OpenThread cli example (from examples/apps/cli)?

    Some of the errors would suggest, that you didn't add libopenthread_platform_utils.a library to the project.

Related