Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radio.write(...) always returns false #432

Closed
NoeelMoeskops opened this issue Apr 30, 2018 · 18 comments
Closed

radio.write(...) always returns false #432

NoeelMoeskops opened this issue Apr 30, 2018 · 18 comments
Labels

Comments

@NoeelMoeskops
Copy link

Hi,

I can't seem to get my NRF24L01+PA/LNA to work. When i upload the gettingstarted script it always fails to write on the pipeline. radio.write( &start_time, sizeof(unsigned long) ) always returns false. I quadruple hextuple checked my wireing, but everything seems to be in order. I use an external power supply for the RF24 and my host in an Arduino Nano. Please note that I also tried maniacbugs lib with the same result. So it might be hardware related but I really don't know where to look.

@Avamander
Copy link
Member

What kind of external power supply are you using? A linear 3.3V regulator from 5V?

@NoeelMoeskops
Copy link
Author

NoeelMoeskops commented Apr 30, 2018

yes, 5v to 3.3v using a adjustable power supply to a breadboard power supply to get a steady 3.3v (also tried two AA battery's) , also radio.printDetails(); returns:

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	 = 0x27
CONFIG		 = 0x0e
DYNPD/FEATURE	 = 0x00 0x00
Data Rate	 = 250KBPS
Model		 = nRF24L01+
CRC Length	 = 16 bits
PA Power	 = PA_MAX

@NoeelMoeskops
Copy link
Author

NoeelMoeskops commented Apr 30, 2018

When I change the CE and CSN pin to 9 and 10. One node fails to write, but the other node still receives incoming messages (other way around does not work tho.)

@Avamander
Copy link
Member

Try decoupling the power bus a bit more, see if that changes things.

@NoeelMoeskops
Copy link
Author

I added two 100uF capacitors in parallel but no effect...

@Avamander
Copy link
Member

Okay, try disabling auto-ACK, lowering the power (PA) to minimum, and disable dynamic payloads.

@NoeelMoeskops
Copy link
Author

oke, i disabled auto-ACK and set the PA to min (also tried low) and disabled dynamic payloads but the message just won't arrive. It's fine sending now tho, it just fails on timeout (increased to 5 sec). I also tried it with an ATmega2560 but no luck.

@Avamander
Copy link
Member

Are you modifying the examples in any other way? Did you make sure the radio numbers are different?

@NoeelMoeskops
Copy link
Author

NoeelMoeskops commented May 2, 2018

the only modifications I have made are:

  Serial.println(radioNumber);
  radio.setPALevel(RF24_PA_MIN);
  radio.disableDynamicPayloads();
  radio.setAutoAck(false);
  radio.setRetries(15, 15);
  printf_begin();
  radio.printDetails();

I also tried a different power source (power from the ATmega and mobile charger) and uploading directly from the arduino IDE instead of using PlatformIO. And using release 1.3.1 instead of pulling from master but the results are all the same.
The radio numbers are indeed different.

@Avamander
Copy link
Member

Avamander commented May 2, 2018

The radio might just be broken. Though, if you had an oscilloscope you could check the power rail for any fluctuations. But just for your own sake, are you sure that you're using the right pins? Arduino Mega's SPI pins differ compared to Arduino Uno, this is literally the most common and probable error.

@NoeelMoeskops
Copy link
Author

NoeelMoeskops commented May 2, 2018

I got an oscilloscope and the 3.3v is an extremely flat line. I could also check the output of the RF24 but i don't know what to look for so instructions would be nice :)
Please note that i use an Arduino Nano and not an Uno.
The connection on the Mega is as follows:
SCK - 52
MOSI - 51
MISO - 50

I used the pin-out as described in the documentation.
is the pin-out of my RF24 correct?

I also shielded my RF24 for better signal

@sergiokoval
Copy link

sergiokoval commented May 8, 2018

hi, just started playing with those modules.

Got the same issue so decided to start from scratch.
My setup is based on two arduino nano boards.
First sample I tried is to use one way communication.
Didn't work till I connected RF24 modules to external 3.3V supply with good filter capacitor at the output > 500uF.
Now playing with two way communication, and seems at this stage things working out well.
Working sample is here - https://github.com/sergiokoval/eskate/tree/feature/two-way-comm
Master branch contains simple one-way comm, and two-way comm is in feature branch.

I'd suggest to start from simple in order to figure out where it starts failing for you.
Hope this somehow helps

image
image

@NoeelMoeskops
Copy link
Author

@sergiokoval Thanks for your comment. I tried your repo, but no luck. Did it with 300uF (for both RF24's) tho. Gonna see if I can get my hands on a bigger one. Is that 1000uF you got in the picture really necessary?

@Avamander
Copy link
Member

Avamander commented May 17, 2018

@NoeelMoeskops Pretty much, I've even gone 10000uF with a module or two.

@nygma2004
Copy link

I have a similar issue. I have to nano with nRF24L01. On the sender, I am using the extra board with a separate 5V->3.3V regulator and extra caps. I have only one writing pipe open. The other nRF24L01 is also on a nano, running off the nano 3.3 line with a cap.
The sender says transmit failed for all packets, but the receiver receives all of the messages. If I turn off the acknowledgement, nothing is received on the receiver.
Shall I just simply ignore radio.write return code in this case? I am planning a one way communication anyway.

@JoseAntonio86
Copy link

Tengo el mismo problema con mis módulos NRF24l01 y 2 arduino Uno, al parecer "radio.write" sólo me da como respuesta "False", lograron solucionarlo?

void loop(void)
{
radio.stopListening();
unsigned long time = millis();
Serial.print("Enviando ");
Serial.println(time);
bool ok = radio.write( &time, sizeof(unsigned long) );

if (ok)
   { 
    Serial.println("ok...");
   }
else
   {
    Serial.println("failed");
   }

@YashiSharma98
Copy link

The main reason for this issue is 3.3V supply. For me, the 3.3V supply from Arduino Uno was causing trouble, but when I used the 3.3V supply from NodeMCU (ESP-12E Module), the issue was resolved.

@JoseAntonio86
Copy link

Finalmente decidí optar por los modulos Xbee (zigbee) para la comunicación inalámbrica de mi proyecto. Igualmente muchas gracias por la información, haré una prueba con los ESP.

@TMRh20 TMRh20 closed this as completed May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants