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

[nRF52] ESB: one PTX, many PRX + frequency hopping. How to increase probability to of recived data?

In traditional approach to ESB communication we have many PTX device and one PRX device: image description

In my application, situation is inverted: I have only one PTX device and many PRX devices:

image description

Each PRX device have implemented Bluetooth and timeslot ESB.

Each PTX device has implemented only ESB protocol, and only transmit data – so the communication is only in one direction. So I did it, and it works very well, but i don't thing is the best way to do it.

PTX device sends payload with no ack:

payload->noack  = 1;

And later, send packed on 5 different channels: 4, 25, 42, 63 and 77 channel. For increase the probability of a chance of reaching the frame data to the PRX device I send each frame:

for ( i = 0 ; i < 10 ; i++ )
{	
  sendEsbDataOnChannelNr1();
  wait();
  sendEsbDataOnChannelNr2();
  wait();
  sendEsbDataOnChannelNr3();
  wait();
  sendEsbDataOnChannelNr4();
  wait();
  sendEsbDataOnChannelNr5();
  wait();
}

In the each PRX device I jumping through RX channel in interval 10ms:

nrf_esb_stop_rx();
nrf_esb_set_rf_channel( frequencyHopingTable[ channelIndex ] );
nrf_esb_start_rx();
channelIndex++;
if ( channelIndex > 4 ) channelIndex = 0;

So my question is:

  1. How to choose the best channel for frequency hopping?

  2. How to maximize probability to recive frame by PRX device? We have a few variable:

  • a total number of frequency hopping channel
  • number of burst transfer. Less is better - more energy efficiency. (one burst = transfer data ion each frequency hopping channel )
  • time and algorithm between how to jump between RX channel in PRX device? Random? What time between hop?

Mayby there are some books or article about this problems?

Parents
  • Firstly thanks for the answer! Secondly, let me summarize:

    PTX DEVICE:

    for ( i = 0 ; i < 10 ; i ++ ) // for example - do this 10 times - less is better
    {
    	for ( j = 0; j < 5 ; j ++ ) // total time send in one channel is ~5ms
    	{
    		sendEsbDataOnChannelNr1();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr2();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr3();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr4();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr5();
    		wait1ms();
    	}
    }
    

    PRX DEVICE:

    in every 1ms:

    channelIndex++;
    if ( channelIndex > 4 ) channelIndex = 0;
    nrf_esb_stop_rx();
    nrf_esb_set_rf_channel( frequencyHopingTable[ channelIndex ] );
    nrf_esb_start_rx();
    

    so all frequency hop have 5ms period.

    Please, let me know is that ok?

    I can't use ACK because I have many PRX device which have the same address and I want to trasmit data to all of them. So I can't synchronize frequency between PRX and PTX - so I think the only way to do this - is "stupid" burst data throught all the channels in PTX device and hope that all PRX devices will recive data :)

Reply
  • Firstly thanks for the answer! Secondly, let me summarize:

    PTX DEVICE:

    for ( i = 0 ; i < 10 ; i ++ ) // for example - do this 10 times - less is better
    {
    	for ( j = 0; j < 5 ; j ++ ) // total time send in one channel is ~5ms
    	{
    		sendEsbDataOnChannelNr1();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr2();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr3();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr4();
    		wait1ms();
    	}
    	for ( j = 0; j < 5 ; j ++ )
    	{
    		sendEsbDataOnChannelNr5();
    		wait1ms();
    	}
    }
    

    PRX DEVICE:

    in every 1ms:

    channelIndex++;
    if ( channelIndex > 4 ) channelIndex = 0;
    nrf_esb_stop_rx();
    nrf_esb_set_rf_channel( frequencyHopingTable[ channelIndex ] );
    nrf_esb_start_rx();
    

    so all frequency hop have 5ms period.

    Please, let me know is that ok?

    I can't use ACK because I have many PRX device which have the same address and I want to trasmit data to all of them. So I can't synchronize frequency between PRX and PTX - so I think the only way to do this - is "stupid" burst data throught all the channels in PTX device and hope that all PRX devices will recive data :)

Children
Related