RF24 library problem

I am trying to compile the program nRF24L01_Test_Node_0 from GitHub - RalphBacon/nRF24L01-transceiver: Use your Arduino to transmit (and receive) data reliably with this easy to use module. See the accompanying video here: https://www.youtube.com/c/RalphBacon having installed the RF24 library in C:\Users\Edward\Documents\Arduino\libraries\RF24 but using Arduino IDE 1.8.5 I get the following error on verifying:-

In file included from C:\Users\Edward\Documents\Arduino\Sketches\sketch_nov06a\sketch_nov06a.ino:2:0:

C:\Users\Edward\Documents\Arduino\libraries\RF24/printf.h: In function 'void printf_begin()':

C:\Users\Edward\Documents\Arduino\libraries\RF24/printf.h:31:29: error: 'fdevopen' was not declared in this scope

fdevopen( &serial_putc, 0 );

^

exit status 255
Error compiling for board PIC32 Pinguino.

Any ideas on the problem?

What is a "PIC32 Pinguino"? It sounds like it is not a regular Arduino. Is there any reason to assume that the example program will work on that hardware?

Have a look at this Simple nRF24L01+ Tutorial.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

...R

I use this very comprehensive library (recommended by Adafruit) for these modules:

http://www.airspayce.com/mikem/arduino/RadioHead/

Give the included example code a try.

+1 for Robin2's tutorial. Very simple to use to and, at least, make sure that the modules work before going to more complex code. One thing that is mentioned in the tutorial that is important is to remove power and reconnect each time you upload code. Resetting the processor is not enough to reset the rf24 modules.

Robin,

Thanks for the tip to use the example code but still no luck.

I deleted all instances of the RF24 library with the IDE closed. I then downloaed the RF24_master library from TMr20 as suggested. I renamed the library asRF24 and put it in C:\Users\Edward\Documents\Arduino\libraries\RF24
I then loaded the IDE and loaded the Getting started sketch. It still won't verify giving the following error message:

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::print_status(uint8_t)':

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp:362:11: error: 'printf_P' was not declared in this scope

);

^

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::print_observe_tx(uint8_t)':

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp:373:11: error: 'printf_P' was not declared in this scope

);

^

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::print_byte_register(const char*, uint8_t, uint8_t)':

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp:385:38: error: 'printf_P' was not declared in this scope

printf_P(PSTR(PRIPSTR"\t ="),name);

^

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::print_address_register(const char*, uint8_t, uint8_t)':

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp:400:38: error: 'printf_P' was not declared in this scope

printf_P(PSTR(PRIPSTR"\t ="),name);

^

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::printDetails()':

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp:562:102: error: 'printf_P' was not declared in this scope

printf_P(PSTR("Data Rate\t = " PRIPSTR "\r\n"),pgm_read_word(&rf24_datarate_e_str_P[getDataRate()]));

^

exit status 255

I feel that it isn't seeing the RF24 library but ......

PS the Pinguino is Arduino compatible Microchip 32 board with many good feature. I have used it on other projects without any problems.

Many thanks for your help do far.

Charlie

Charlie_abb:
I feel that it isn't seeing the RF24 library but ......
Charlie

Seems it must be since it's calling out the relevant file in the error message:

C:\Users\Edward\Documents\Arduino\libraries\RF24\RF24.cpp

Try compiling for a more standard board (like Uno) and see what happens.

I tried the examples with Arduino MKR Fox 1200 and they both compiled.

I am not sure why they won't work with the PIC32 Pinguino. I have been able to compile all other examples with that board.

Thanks for your help.

Charlie_abb:
I am not sure why they won't work with the PIC32 Pinguino.

You need to study the source code for the library. IIRC it has options for different boards and maybe does not have an option for your relatively unusual board. If that is the problem maybe a small change to the library code is all that is needed.

...R

The PIC32 Pinguino, very cool. Google it.

It has a main / setup / loop thing, otherwise, from the adafruit website:

…it isn't an Arduino, isn't supported by the Arduino team or forums, and doesn't work with the Arduino IDE . It isn't guaranteed to work with any libraries or shields.

so just what are you up to and with what tool chain?

a7

Robin, thanks for the tip. I'll check out the library.