Go Down

Topic: nrf24l01 mini module problems (Read 5470 times) previous topic - next topic

RogerRowland

I wonder whether my printf.h is in the right folder? It's currently deep inside one of the RF24 examples folders - should it be somewhere else?  
In all the RF24 examples, a copy of printf.h is in the folder containing the sketch. So, make sure you have a copy in your sketch too (it may be that the #include is resolving it elsewhere, which may explain the discrepancy).
I know from experience, that if you don't call printf_begin(), then you won't get any output from the radio.printDetails() call.

robertjenkins

In all the RF24 examples, a copy of printf.h is in the folder containing the sketch. So, make sure you have a copy in your sketch too (it may be that the #include is resolving it elsewhere, which may explain the discrepancy).
I know from experience, that if you don't call printf_begin(), then you won't get any output from the radio.printDetails() call.

Damn I thought that (putting a copy of printf.h in the sketch folder) was going to work, but it doesn't.

groundFungus

Have you tried #include "printf.h"?  The compiler looks in different places for the file with the quotes.  I seem to remember that that helped when I had trouble with the rf24 lib.

robertjenkins

Yes, tried it with quotes and with the "<" symbol ...
Thanks for your help ... this is annoying (because it's obviously something really simple)

robertjenkins

Tried something else - a call to isPVariant() which apparently tells whether the hardware is an nRF24L01+ or not. It says it is ...
Also, out of the blue, and for the first time, the unit managed to transmit a single digit, which is sort of promising, though it hasn't happened again.

robertjenkins

#20
Jan 11, 2015, 06:40 pm Last Edit: Jan 11, 2015, 06:41 pm by robertjenkins
OK, printDetails is now working (I managed this by the unbelievably clunky method of editing one of the examples - which compiled OK - until it was the sketch I wanted.) My sketch is

Code: [Select]
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"


int msg[1];
RF24 radio(9,10);

const uint64_t pipe = 0xE8E8F0F0E1LL;


void setup(void)
{
  Serial.begin(57600);
  printf_begin();
  radio.begin();
  radio.setDataRate(RF24_250KBPS);
  radio.openWritingPipe(pipe);
  radio.printDetails();
}

void loop(void)
{
  for (int txdigit=0; txdigit<7; txdigit++) {
    Serial.println();
    radio.printDetails();
    msg[0] =txdigit;
    radio.write(msg, 1);
    delay(3000);
  }
}



This is what I'm getting (for some reason I can't copy/paste from the com window, sorry):



It doesn't mean much to me...



RogerRowland

Looks ok to me - those are the defaults that the lib uses.

The reason why you can't copy/paste is because printDetails incorrectly puts some nulls in the strings, which messes it up. Otherwise it looks fine ..... so it's working as well as it should ....


robertjenkins

Right, so I think the next step is to test your idea that the rx/tx units need to be paired (so maybe the small units will only transmit to other small units - though I can't see why that would be so).

robertjenkins

#23
Jan 12, 2015, 08:04 pm Last Edit: Jan 12, 2015, 08:07 pm by robertjenkins
Update - the small units seem to be happy receiving (from the larger units) but will not transmit (either to another small unit or to a larger unit).

Any suggestions as to why this might be or what diagnostic tests I could do to get to the bottom of it?

DerHarst

I'm sorry to dig up this relatively old thread, but I'm experiencing exactly the same problems as described here and was wondering whether anybody has found the problem with these mini modules?

I'm able to transmit
Large --> Small
Large --> Large

but

Small --> Small
small --> large
fail.

 I've put a 100uF ELKO across the power supply (a MCP1700 voltage regulator), and I've had the large modules running for some month now in the same setup, so I'm pretty sure it's not a power supply bug...

robertjenkins

I got it sorted when I posted in another topic - see here
http://forum.arduino.cc/index.php?topic=292193.0
Hope it works for you

Go Up