I am using nrf52840 as PTX and nrf24l01+ as PRX. The application I am working on requires me to send 30 bytes from PTX to PRX at a 2 kHz packet rate. If both devices are near each other on my desk, it works very well. However if I pick up the transmitter and hold it far away from the receiver, I start to see a lot of packets be dropped. It completely stops working at a distance of about 1 meter.
For the transmitter I am using a Particle Boron (with the onboard chip antenna). The receiver, with the nrf24, is a custom board that is known to have about 20-30 ft range when used as PTX. It uses a big SMA antenna, so I'm not sure why this could be happening.
These are the settings on the PTX (nrf52)
uint8_t base_addr_0[4] = {0xE7, 0xE7, 0xE7, 0xE7}; uint8_t base_addr_1[4] = {0xC2, 0xC2, 0xC2, 0xC2}; uint8_t addr_prefix[6] = {0xE7, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6}; // nrf24 has 6 pipes nrf_esb_config_t esb_cfg = NRF_ESB_LEGACY_CONFIG; esb_cfg.protocol = NRF_ESB_PROTOCOL_ESB_DPL; esb_cfg.mode = NRF_ESB_MODE_PTX; esb_cfg.event_handler = radio_callback; esb_cfg.bitrate = NRF_ESB_BITRATE_2MBPS; esb_cfg.crc = NRF_ESB_CRC_8BIT; esb_cfg.tx_output_power = NRF_ESB_TX_POWER_4DBM; esb_cfg.retransmit_delay = 500; esb_cfg.retransmit_count = 3; esb_cfg.tx_mode = NRF_ESB_TXMODE_MANUAL; esb_cfg.radio_irq_priority = 1; esb_cfg.event_irq_priority = 2; esb_cfg.payload_length = 32; esb_cfg.selective_auto_ack = true; nrf_esb_init(&esb_cfg); nrf_esb_set_base_address_0(base_addr_0); nrf_esb_set_base_address_1(base_addr_1); nrf_esb_set_prefixes(addr_prefix, 6); // 6 pipes nrf_esb_set_rf_channel(26); uint8_t pipe_mask = 1; // enable pipe 0 nrf_esb_enable_pipes(pipe_mask);
And I configure the settings of nrf24 at boot as so:
CONFIG: 3B EN_RXADDR: 01 RF_SETUP: 0E SETUP_RETR: 1F EN_AA: 01 FEATURE: 06 DYNPD: 01
I have checked the RPD register of the nrf24, and although sometimes the register returns a value of 01, more often than not the value will be 0. I have also tested the PTX by using a nrf52840 dk as PRX (with no antenna) and checking the RSSI. If the devices are close to each other on the desk, the receiver will indicate RSSI around -45 dBm, and about -86 dbM at 4 feet and already seeing dropped packets. I have tried many channels, including 2, 26, and 80, and always see the same problem. Not sure what else to try. Thank you in advance!