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

NRF52840 Thread example power down 10 mins after USB disconnect

Hello,

I am trying the Thread Cloud COAP Client

<InstallFolder>\examples\thread\experimental\cloud_coap_client

on a NRF52840 PDK. I'm using Thread SDK v0.10.0. The example works as described.

However, when I unplug the board from USB, it goes into some kind of power down mode in approx. 10 minutes and loses connection to the Thread network. I can see LED1 is still on, but it is extremely faint. It is flickering, so trying to connect to the network, but it cannot do so. After a further 5-6 minutes of this, LED1 goes completely off.

I had a few questions about this behaviour:

  1. Where in the code can I set the time between USB disconnect and going in power-down mode?
  2. I know that the NRF52840 has System ON and System OFF power modes. Where in the code can I set which mode it should go in?
  3. Is the behaviour of it not being able to connect to the Thread network when in low power mode expected? If so, can I change this behaviour or is there a fix planned?

Thanks in advance!

Regards

Andy

  • Right now the roles are automatically assigned. I have a network of three NRF52840s, where one of them is a NCP attached to Raspberry Pi and the others are nodes. When a node is joined, I can see in the Thread Topology Manager that it is a end node initially, but after a few seconds becomes a router. Making the node a sleepy end device is a good idea - could you tell me how I can force a node to become a sleepy end device? Some changes in the code?

  • Thanks, I'll have a look at that! Can I ask another question about the same Thread Cloud Coap client example? Basically, the example sends data to thethings.io cloud when I press button 1 and 2. I now want to establish communication in the other direction. So, have a button widget in the things dashboard which when pressed sends a value to the NRF52840. Could you tell me if there is some example available about how to do this?

  • I'm not aware of such an example. I'm not sure if it is trivial or not. If you want me to, I can check with the developers if they see any problem with implementing a "cloud coap server"?

  • Thanks for checking. An update from my side - I managed to get a bit further in receiving value on the NRF52840. Basically I use otCoapHeaderInit(&header, OT_COAP_TYPE_NON_CONFIRMABLE, OT_COAP_CODE_GET); to create a message and send that using otCoapSendRequest(p_instance, p_request, &message_info, cloud_data_request_callback, p_instance);. Here, cloud_data_request_callback is the callback function that is executed when the cloud responds with data. I execute this on Button press 3, which works, the cloud returns the JSON string for the requested resource. However, this is the NRF52 kind of polling. Instead, I would like the callback function to be executed when the value on the cloud is changed. For that, I checked and saw there is an "observor" option that can be set using otCoapHeaderAppendObserveOption. In this function, I don't understand the second parameter aObserve Observe field value. I tried various values but they don't work. So it would be great if you could check with the developers about this issue!

Related