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

the module of the esb

Hi, 1. I have some puzzles,please give me some explanations,thank you! In my design,I use some 51822 devices as tags which can communicate with the host. The tags can send the temperature value to the host,and the host can receive the data and send some instructions to the tags.so I use the module of the esb with payloads.The configurations are as follows: void esb_init(void) { nrf_esb_set_channel(7) ; nrf_esb_set_output_power(NRF_ESB_OUTPUT_POWER_0_DBM); nrf_esb_set_datarate(NRF_ESB_DATARATE_1_MBPS); nrf_esb_set_crc_length(NRF_ESB_CRC_LENGTH_1_BYTE); nrf_esb_set_base_address_length(NRF_ESB_BASE_ADDRESS_LENGTH_4B);

} and I set the same configuration in the host,it can communicate. However,when I set the host channel of nrf_esb_set_channel(10) ;It can still communicate.I want to know if the channel can be different?or some mistakes I have made? 2.If one host can receive three or more devices,how can I distinguish the data from which device,how can I configure? please give me some explanations,thank you !

Parents
  • Beware that you can change the configuration of the ESB module only when it's disabled, so you should always make sure that you check the status returned by the functions. In your case, it might be that the new configuration isn't used at all, if you call this without first disabling ESB.

    As for the latter, you can for example configure each of the devices with their own pipe. You can then check the rx_pipe argument of your data_ready() callback function to know which device sent the data

    Another option could be to include some identification byte in the payload. This is particularly useful if you need to receive data from more devices than the number of pipes available.

  • Thank you for your answers. The first problem is that I set the channel before the (void)nrf_esb_init(NRF_ESB_MODE_PRX);so it doesn't work. The second problem is that all the devices use the same pipe.so I should use the different ID to distinguish them.However,I want to know if there are many devices,how the host to know which device the data are from? By the data_ready() callback function?

Reply
  • Thank you for your answers. The first problem is that I set the channel before the (void)nrf_esb_init(NRF_ESB_MODE_PRX);so it doesn't work. The second problem is that all the devices use the same pipe.so I should use the different ID to distinguish them.However,I want to know if there are many devices,how the host to know which device the data are from? By the data_ready() callback function?

Children
No Data
Related