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

Openthread COAP Client Server device reconnection failure

Hello,

I am having hard time using openthread NCS examples. Recently I was handed over a project based on NCS COAP client server example to resolve a issue but I am not able solve the issue.

Issue: We have 2 FTD device one running COAP client example which is basically reading data from sensor and sending values to COAP server. The sensor update is basically automated using zephyr kwork with delay so we don't have to press button instead it will submit kwork at fixed intervals. Now COAP server is just receiving data and printing data on terminal. 

That's it. Nothing new has been done if I compare with Nordic demo examples. At the start everything works fine. Both server and client are able to communicate with eachother but after say nealry 30-35 hours my COAP client device gets disconnected and not able to reconnect to my COAP server. And if I restart my COAP client device it gets connected. So what's really the issue here ? When I ask the same question on Google Open Thread group they advised me this could be possible issue with radio drivers. So I would like to know what's really the issue here ? And how to resolve this issue ?

When we started developing at my company, we decided to select openthread as mesh communication protocols because of it's benefits over other protocols and Nordic SOC because of it's production ready examples. But it's seems both selection are letting me down.

Also I would like to ask in COAP examples I have seen this lights, provisioning on which we are COAP client is sending turn on off commands. So in this examples does this light act as topic or what ? Also suppose if I have 2 COAP Clients interfaced with different sensors, now if I have to send data to server should I use 2 different topics (something like light1, light2 or sensor 1 and sensor2) instead of sending data on the same light services ? 

Parents
No Data
Reply
  • Okay lets proceed with Scenario 1 Is there examples available of creating multiple URI paths on Server. I haven't found any such examples on forum also. 

    Here is my understanding:

    1. Client1 runs coap_client, it has Sensor1, Sensor1 control resource Led1 on Server1 to turn on and off.

    2. Client2 runs coap_client, it has Sensor2, Sensor2, control resource Led2 on Server1 to turn on and off.

    3. Server1 runs coap_server, it has Led1 and Led2 as resources. 

    Can you provide me with some sort of demo example for the above scenario.

    DEBUGGING OUTPUT

    Also i have faced this issue as described below when i debug the device  joins the network. When i remove the device from debug, device isn't able to join the network.

    Also i would like to bring in notice that on some devices, when i debug a project the device is able to connect a existing network. But when i remove device out of debug and run it is not able to join the existing network. Have you came across such an situation. What can be the possible reasons and how to deal with it.

    Also sometimes i have seen the following error logs appearing alternatively  "E: Error appending to otMessages" when i set update time of 200ms.

    DEBUG LOG of Setup: Multiple Clients with Single Server

    I have created sensor examples using your client repeated example but with 200ms update interval In my setup currently there are 3 client devices sending to server and below i have attached the logs of first 16 hours, i have commented out  LOG INFO related to multicast message sent to avoid unwanted log The device is running and i can see sensor data on server but i got few errors logs too, E: Error while appending to otMessage , E: Failed to reserve net pkt
    I wasn't able to find this text in project (openthread.c file) but when i searched in google it https://github.com/sifive/riscv-zephyr/blob/master/subsys/net/l2/openthread/openthread.c the function openthread_send throws error  E: Error while appending to otMessage when not able to append packets. While ot_receive_handler gives error of Failed to reserve net pkt.

    Can you suggest what could be the possible reason of this error ? And will it have any effect if my end device will be battery powered, like will it hault the execution of sending data or the proccess execution will restart by itself?

    DEBUG LOG

    : nRF5 802154 radio initialized
    I: 8 Sectors of 4096 bytes
    I: alloc wra: 4, c20
    I: data wra: 4, 524
    I: State changed! Flags: 0x101fc310 Current role: 0
    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    I: *****Start LSM6DSOX  node  ACC x y z *****
    I: I2C: Device driver found.
    
    I: Start CoAP-client sample
    I: ***** LSM6DSOX  Init end *****
    D: CoAP socket receive thread started
    I: OpenThread version: OPENTHREAD/gf460532d4; Zephyr; Jul 22 2021 17:41:01
    I: Network name: ot_zephyr
    I: State changed! Flags: 0x0100103d Current role: 1
    I: State changed! Flags: 0x000010e4 Current role: 2
    I: State changed! Flags: 0x00000200 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    I: State changed! Flags: 0x00000400 Current role: 3
    I: State changed! Flags: 0x00000800 Current role: 3
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    I: State changed! Flags: 0x00000400 Current role: 3
    I: State changed! Flags: 0x00000800 Current role: 3
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Failed to reserve net pkt
    E: Failed to reserve net pkt
    E: Error while appending to otMessage
    I: State changed! Flags: 0x20003264 Current role: 2
    I: State changed! Flags: 0x00000064 Current role: 3
    E: Error while appending to otMessage
    
     

Children
Related