nrf24l01 mini module problems

Has anyone used these mini nrf24l01 modules
http://www.ebay.co.uk/itm/Mini-NRF24L01-SMD-1-27MM-wireless-transceiver-module-Small-Size-/400489040899

I am trying to use them with a ATTINY84 but getting nothing out of them, not even at v short range. I have successfully got the slightly larger modules to work, i.e. these ones
http://www.ebay.co.uk/itm/4pcs-NRF24L01-2-4GHz-Antenna-Wireless-Transceiver-Module-for-Arduino-New-JT1-/291029588078?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item43c2b7186e

The set up is identical - I am swapping between the two with the same circuit - but the larger one works and the smaller one doesn't. I have the capacitor across pins 1 and 2 that everyone recommends. I have triple checked the pinout (and connections) as shown in the first link, and as far as I can see from following the traces, and using a multimeter, the pinout diagram is correct. I am completely stumped and don't even know how to start diagnosing what might be going wrong, given that everything at the MCU end is identical.

Have you tried one (or both) of the small ones with a bigger one at the other end? Maybe only one of the small ones is bad?

Yes I am transmitting both big to big (works) and small to big (doesn't). I haven't tried the small ones as receivers.

On the eBay link, it says:

"Only need an external inductance when match antenna"

Now, I have no idea what that really means, but it may be that the smaller units can only talk to other smaller units unless you add inductance to match the antenna of the larger unit.

Totally guessing, you understand, but just thought it worth mentioning

Have you established communication with the module itself - that is, can you read back some of the module settings successfully?

I've tended to use the RF24 library which has a printDetails() function which reads the main module settings and prints them to the Serial output. Useful for making sure the Arduino can talk to the module OK...

howiem:
Have you established communication with the module itself - that is, can you read back some of the module settings successfully?

I've tended to use the RF24 library which has a printDetails() function which reads the main module settings and prints them to the Serial output. Useful for making sure the Arduino can talk to the module OK...

It's a bit trickier with the ATTINY84 but I think the next step must be to hook the new little units up to the Arduino Uno and see if I can do what you suggest. At least I can see whether the units themselves are working.

I suppose at a minimum you could just try setting the CRC value to something new, then try reading it back and flash an LED (or whatever) if all is OK...

howiem:
Have you established communication with the module itself - that is, can you read back some of the module settings successfully?

I’ve tended to use the RF24 library which has a printDetails() function which reads the main module settings and prints them to the Serial output. Useful for making sure the Arduino can talk to the module OK…

I’m trying to use the printDetails on the module which I know works, but I’m not getting anything out. I know that you have to include the printf which I’ve done, but do I need more? Here’s my code

//Transmits 1-6 in a cycle repeatedly


#include <Arduino.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
#include <printf.h>
int msg[1];
RF24 radio(9,10); 

const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void)
{
 Serial.begin(9600);
 radio.begin();
 radio.setDataRate(RF24_250KBPS);
 radio.openWritingPipe(pipe);

}

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

I think you need ...

printf_begin();

... in setup.

RogerRowland:
I think you need ...

printf_begin();

... in setup.

Hmm, just tried that, and it says 'printf_begin' was not declared in this scope.

Maybe we're using different RF24 libs then - so look what you have in the printf.h header and see if there is an initialisation function that needs to be called.

OK, I’ve tried something simpler - just trying to read something arbitrary - the PayLoadSize - from the nrf24l01. I’m getting a stream of “32” from it, which suggests that at least some communication is taking place. What next?

//Transmits 1-6 in a cycle repeatedly


#include <Arduino.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <SPI.h>
#include <printf.h>
int msg[1];
RF24 radio(9,10); 

const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void)
{
 Serial.begin(9600);

 radio.begin();
 radio.setDataRate(RF24_250KBPS);
 radio.openWritingPipe(pipe);

}

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

RogerRowland:
Maybe we’re using different RF24 libs then - so look what you have in the printf.h header and see if there is an initialisation function that needs to be called.

This is what’s in the printf.h that I have

/*
 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */
 
/**
 * @file printf.h
 *
 * Setup necessary to direct stdout to the Arduino Serial library, which
 * enables 'printf'
 */

#ifndef __PRINTF_H__
#define __PRINTF_H__

#ifdef ARDUINO

int serial_putc( char c, FILE * ) 
{
  Serial.write( c );

  return c;
} 

void printf_begin(void)
{
  fdevopen( &serial_putc, 0 );
}

#else
#error This example is only for use on Arduino.
#endif // ARDUINO

#endif // __PRINTF_H__

robertjenkins:
This is what’s in the printf.h that I have

/*

Copyright (C) 2011 J. Coliz maniacbug@ymail.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
*/

/**

  • @file printf.h
  • Setup necessary to direct stdout to the Arduino Serial library, which
  • enables ‘printf’
    */

#ifndef PRINTF_H
#define PRINTF_H

#ifdef ARDUINO

int serial_putc( char c, FILE * )
{
  Serial.write( c );

return c;
}

void printf_begin(void)
{
  fdevopen( &serial_putc, 0 );
}

#else
#error This example is only for use on Arduino.
#endif // ARDUINO

#endif // PRINTF_H

Yes, that’s what I have and you’re including it and I can see printf_begin there, so why can’t you call it in setup?
Can you post your setup function?

Maybe it’s the #ifdef ARDUINO - I’m running on a Uno, you?

Yes it's a Uno. The setup() is as posted above but with the addition of the printf_begin() that you suggested. (Sorry I would post it verbatim but have been kicked off the computer by Minecraft-addicted son.)
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?

robertjenkins:
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.

RogerRowland:
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.

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.

Yes, tried it with quotes and with the “<” symbol …
Thanks for your help … this is annoying (because it’s obviously something really simple)

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.