I'm prototyping out a board with temperature, humidity, windspeed sensors, and using an NRF2401+ board to send values to a Raspberry Pi base station that will record the data.
Using a Leonardo clone board, I'm able to successfully run the pingair_dyn sketch to send test payloads to the RPi and receive acks. (So I know the RPi can send and recieve OK.)
Moving the same NRF2401+ to a breadboard setup with an ATMEGA328P-PU, the same sketch can send payloads which are received on the RPi, but always hits the timeout trying to get the ack (which the RPi is dutifully sending).
In fact when running pingair_dyn as a receiver, it just spins in the loop waiting for radio.available() to return true, which it never does.
The immediate problem is that radio.available() is always returning false. So basically I can send but can't receive.
I have checked my wiring several times, and I'm mostly confident that it's right.
- CE - physical pin 14 (arduino digital pin 8 )
- CSN - physical pin 13 (arduino digital pin 7)
- SCK - physical pin 19, per atmega328 datasheet
- MOSI - physical pin 17, per datasheet
- MISO - physical pin 18, per datasheet
In the software, I construct the RF24 instance:
Any ideas? I tried swapping CE <--> CSN, then nothing worked. Is there some wiring problem that would cause XMIT to work but RECV to fail?
I've tried putting a 2.2 uF capacitor across the 3.3V - GND as I've seen mentioned in other threads, but no difference.
Any suggestions on what is useful information to dig out of the RF24 library to give some idea of what's going on?
Here is the RF24 debug info from the mega328
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0 RX_ADDR_P0-1 = 0xf0f0f0f0d2 0xf0f0f0f0e1 RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6 TX_ADDR = 0xf0f0f0f0d2 RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00 EN_AA = 0x3f EN_RXADDR = 0x02 RF_CH = 0x4c RF_SETUP = 0x07 CONFIG = 0x0f DYNPD/FEATURE = 0x3f 0x04 Data Rate = 1 MBPS Model = nRF24L01+ CRC Length = 16 bits PA Power = PA_MAX
Here is the debug info from the base station (Raspberry Pi): pyRF24/examples/pingpair_dyn/
================ SPI Configuration ================ CSN Pin = CE0 (PI Hardware Driven) CE Pin = Custom GPIO22 Clock Speed = 8 Mhz ================ NRF Configuration ================ STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0 RX_ADDR_P0-1 = 0xe7e7e7e7e7 0xc2c2c2c2c2 RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6 TX_ADDR = 0xe7e7e7e7e7 RX_PW_P0-6 = 0x00 0x00 0x00 0x00 0x00 0x00 EN_AA = 0x3f EN_RXADDR = 0x03 RF_CH = 0x4c RF_SETUP = 0x07 CONFIG = 0x0e DYNPD/FEATURE = 0x3f 0x04 Data Rate = 1MBPS Model = nRF24L01+ CRC Length = 16 bits PA Power = PA_MAX