Tiny84+Nrf24l01

Hi
Ive exhausted possibly all avenues searching for a working example of the ATiny84 and Nrf24l01 radio module.

I have the above working fine with the uno/mega328/mega2560 setups and want to move to a tiny84 but have,nt yet found an example that will compile or function correctly for the tiny.

If you know or have a working RX/TX example please assist.

Essef 8)

Have you tried GitHub - nRF24/RF24: OSI Layer 2 driver for nRF24L01 on Arduino & Raspberry Pi/Linux Devices ?

It supports just about everything, from ATTiny to RPi and (hopefully soon) Galileo boards.

I've tested it on ATTiny85 and have been advised from 84 users that it is working as well. An example is included in the library.

Yes i tried yours earlier today without success but as your the author and can assist me further ill do a clean install tomorrow and post my findings, providing thats acceptable ?.

T.I.A

Essef 8)

Yeah, I can try to help. Its usually just a matter of getting the right pins connected with ATTiny

Hi
After a clean 1.06 Arduino install i downloaded the https://code.google.com/p/arduino-tiny/ files and installed in the hardware directory.

I then installed your github.com/TMRh20/RF24 files into the libraries folder.

Firstly i attempted to run a previously compiled sketch for the UNO (which utilizes the original rf24 set) and this failed to compile, this is an issue id had previously and simply returned to the original setup to compile.

Heres the test sketch and the error detail.

#include <SPI.h>
#include “RF24.h”

int msg[1];

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10

//SCK → 13
//MISO → 12
//MOSI → 11
//CSN → 10
//CE → 9

//RF24 radio(3,4); //CE/CSN PINS WITH NRF SHEILD
//RF24 radio(9,10); //CE/CSN PINS WITH UNO OR BREADBOARD
RF24 radio(11,12); //CE/CSN PINS FOR ATTINY84

int LEDpin1 = 5;

const uint64_t pipes[2] = { 0xF0F0F0F000LL, 0xF0F0F0F0FFLL};

void setup(void){
radio.begin();
radio.setDataRate(RF24_1MBPS); //
radio.setChannel(100); //
radio.setRetries(15,15); //
radio.openWritingPipe(pipes[0]); //
radio.openReadingPipe(1, pipes[1]); //
radio.startListening(); //

pinMode(LEDpin1, OUTPUT);

}

void loop(void){
if (radio.available()){
bool done = false;
while (!done){
done = radio.read(msg, 1);
if (msg[0] == 2 ){
digitalWrite(LEDpin1, HIGH);
delay(50);
digitalWrite(LEDpin1, LOW);
delay(10);
}}}}

Arduino: 1.0.6 (Windows XP), Board: “Arduino Uno”
C:\AVR\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\AVR\Arduino\hardware\arduino\cores\arduino -IC:\AVR\Arduino\hardware\arduino\variants\standard -IC:\AVR\Arduino\libraries\SPI -IC:\AVR\Arduino\libraries\RF24

error: In function ‘void loop()’:
error: void value not ignored as it ought to be

Essef 8)

Next i attempted a compile of the rf24ping85 sketch from the examples folder which again failed to compile with the following error details.

Arduino: 1.0.6 (Windows XP), Board: "Arduino Uno"
C:\AVR\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\AVR\Arduino\hardware\arduino\cores\arduino -IC:\AVR\Arduino\hardware\arduino\variants\standard -IC:\AVR\Arduino\libraries\RF24 C:\DOCUME~1\BQP\LOCALS~1\Temp\build8489863026367883027.tmp\rf24ping85.cpp -o C:\DOCUME~1\BQP\LOCALS~1\Temp\build8489863026367883027.tmp\rf24ping85.cpp.o

In file included from C:\AVR\Arduino\libraries\RF24/RF24.h:18,
from rf24ping85.ino:58:
C:\AVR\Arduino\libraries\RF24/RF24_config.h:88:19: warning: SPI.h: No such file or directory
C:\AVR\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\AVR\Arduino\hardware\arduino\cores\arduino -IC:\AVR\Arduino\hardware\arduino\variants\standard -IC:\AVR\Arduino\libraries\RF24 -IC:\AVR\Arduino\libraries\RF24\utility C:\AVR\Arduino\libraries\RF24\RF24.cpp -o C:\DOCUME~1\BQP\LOCALS~1\Temp\build8489863026367883027.tmp\RF24\RF24.cpp.o

In file included from C:\AVR\Arduino\libraries\RF24\RF24.cpp:10:
C:\AVR\Arduino\libraries\RF24/RF24_config.h:88:19: warning: SPI.h: No such file or directory
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::csn(bool)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:23: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp:24: error: 'SPI_MODE0' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp:25: error: 'SPI_CLOCK_DIV2' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::read_register(uint8_t, uint8_t*, uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:101: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::read_register(uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:134: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::write_register(uint8_t, const uint8_t*, uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:172: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::write_register(uint8_t, uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:207: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::write_payload(const void*, uint8_t, uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:223: error: 'rf24_min' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp:267: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::read_payload(void*, uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:337: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::spiTrans(uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:378: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::setChannel(uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:482: error: 'rf24_min' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::setPayloadSize(uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:489: error: 'rf24_min' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::begin()':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:650: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'uint8_t RF24::getDynamicPayloadSize()':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:1046: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::toggle_features()':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:1246: error: 'SPI' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp: In member function 'void RF24::writeAckPayload(uint8_t, const void*, uint8_t)':
C:\AVR\Arduino\libraries\RF24\RF24.cpp:1314: error: 'rf24_min' was not declared in this scope
C:\AVR\Arduino\libraries\RF24\RF24.cpp:1335: error: 'SPI' was not declared in this scope

Essef :o

Obviously my setup is amiss here ?.

From a beginners perspective i believe the following points would assist in getting operational without the frustration of trolling through the plethora of current and redundant info which is available.

Include all the cores/forks/docs you,ve used within one download then the user knows their using a working formula.

Include built hexes for the various targets that way you can easily separate hardware and software issues, this also alleviates any compile issues when faced with nil backward compatibility

Put your name to it "in lights" so the user knows which examples their currently attempting to use

Essef 8)

Ill add more as i progress :o hopefully

Ps Thanks fro your willingness to assist

Update

After 2/3 hours and several file/folder/fork attempts im unable to compile any example sketches using this Fork, replacing it with the Mbug original resumes normal service albeit without the at84 platform.

Essef 8)

I'm not sure why you would try to compile a sketch designed for ATTiny with the IDE set to an UNO?

The LED sketch was written by maniacbug, and has not been modified. It demonstrates the only compatibility difference between the two libraries, because in my lib, radio.available() will always return 1 if data is available. The mainiacbug fork will not.

My apologies.
Id attempted the build with the attiny84 selected firstly and it failed so switched to the uno to test other sketches which also failed to compile and inadvertently posted the UNO fail.

Heres the rfping84 build attempt using your fork and associated tiny/hardware.

Arduino: 1.0.6 (Windows XP), Board: "ATtiny84 @ 8 MHz (internal oscillator; BOD disabled)"
C:\AVR\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=attiny84 -DF_CPU=8000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -IC:\AVR\Arduino\hardware\arduino\cores\tiny -IC:\AVR\Arduino\libraries\RF24 C:\DOCUME~1\BQP\LOCALS~1\Temp\build3056903207309672161.tmp\rf24ping85.cpp -o C:\DOCUME~1\BQP\LOCALS~1\Temp\build3056903207309672161.tmp\rf24ping85.cpp.o

In file included from C:\AVR\Arduino\libraries\RF24/RF24.h:18,
from rf24ping85.ino:58:
C:\AVR\Arduino\libraries\RF24/RF24_config.h:63:22: warning: Arduino.h: No such file or directory
In file included from C:\AVR\Arduino\libraries\RF24/RF24_config.h:167,
from C:\AVR\Arduino\libraries\RF24/RF24.h:18,
from rf24ping85.ino:58:
c:/avr/arduino/hardware/tools/avr/lib/gcc/../../avr/include/stdio.h:655: error: declaration does not declare anything
In file included from C:\AVR\Arduino\libraries\RF24/RF24.h:18,
from rf24ping85.ino:58:
C:\AVR\Arduino\libraries\RF24/RF24_config.h:193: error: 'byte' does not name a type
rf24ping85:62: error: 'byte' does not name a type
rf24ping85.ino: In function 'void setup()':
rf24ping85:71: error: 'addresses' was not declared in this scope
rf24ping85.ino: In function 'void loop()':
rf24ping85:83: error: 'micros' was not declared in this scope
rf24ping85:84: error: 'boolean' was not declared in this scope
rf24ping85:84: error: expected `;' before 'timeout'
rf24ping85:88: error: 'timeout' was not declared in this scope
rf24ping85:94: error: 'timeout' was not declared in this scope
rf24ping85:100: error: 'delay' was not declared in this scope

Essef :8)

Heres todays update.

I re-installed all files again to be sure no conflicts existed, and noted the Attiny options were not in my ide,s board listing, heres a snippet from the included read me and the reason why there absent.


After extracting, the following files / folders should exist...

C:\Projects\Arduino\hardware\tiny\avr\license.txt
C:\Projects\Arduino\hardware\tiny\avr\platform.txt
C:\Projects\Arduino\hardware\tiny\avr\Prospective Boards.txt
C:\Projects\Arduino\hardware\tiny\avr\README
C:\Projects\Arduino\hardware\tiny\avr\bootloaders
C:\Projects\Arduino\hardware\tiny\avr\cores\

The following folder should contain the source files for the Arduino-Tiny
core...

C:\Projects\Arduino\hardware\tiny\avr\cores\tiny\


Which should be (in my case) otherwise the Attiny are,nt listed

C:\Avr\Arduino\hardware\tiny\license.txt
C:\Avr\Arduino\hardware\tiny\platform.txt
C:\AvrArduino\hardware\tiny\Prospective Boards.txt
C:\Avr\Arduino\hardware\tiny\README
C:\Avr\Arduino\hardware\tiny\bootloaders
C:\Avr\Arduino\hardware\tiny\cores\

C:\Avr\Arduino\hardware\tiny\cores\tiny\

The last sub folder "AVR" as been removed.

I then just renamed "prospective.boards" txt to "boards.txt".
The next directive is:


In the "boards.txt" file, change the "upload.tool" entries to the
appropriate value for your setup.


But the "upload.tool" entries dont exist in the newly created boards.txt file unless the user writes them in (not an easy thing to do for a beginner !) unless the IDE,s board.txt fulfills this function ?.

Ok so now i am able to select an attiny option
l then attempted to compile the rftiny example and others within the examples folder none of which compile successfully !.

Additionally previous compiles now fail also.

Essef :8)
As previously stated reverting back to the Mbug RF24 restores sanity ?.
******************** used to highlight the included read me snippets

Ive also learned you have a positive following with this Fork which points to my setup being at fault but finding the issue for a beginner is both time consuming and frustrating.

My posts in no way shape or form are to be read in a derogatory manner they are posted here as a record of my progress and hopefully may assist others with similar teething issues.

Essef :8)
Thanks Again for your Input

Np, but I am kind of stumped, but I think it may have to do with the ATTiny core you are using, since it seems not to like including Arduino.h, in might be a bit older and be expecting the old WProgram.h or something.

The ATTiny core I use is found here https://arduino-tiny.googlecode.com/files/arduino-tiny-0150-0020.zip

I also tend to use the 1.5.8 beta version of the IDE, but the examples also compile for me in the main IDE. If you are trying to compile RF24 examples other than the rf24ping85 example, you generally want to remove all references to SPI and Serial.write/read.

Hi

a) Me to im at a loss as to why i have these issues its as if your fork is being ignored by the compiler.

b) Yes this is the same core set i have.

c) Surely if offering examples for mcu,s with small memory you're going to ensure they fit the intended target otherwise a successful compile is pointless. (generalization)

d) "trying to compile RF24 examples other than the rf24ping85 example" ,by this you mean local to your fork

Essef 8)

I think maybe you should work some more with the ATTiny before trying to include radios into the mix. The ATTiny examples etc. were written by contributors who also developed methods to run the ATTiny on 3 and 4 pins within this library, so I don't think the problems are with the library in this case.

I agree the library isnt the issue, but my project is nrf orientated so i must continue to look for a solution.

Thanks for your help so far.

Essef :8)

Latest

A slight change in direction here ive installed a Mirf/Nrf Stanley Seow fork, but this also failed to compile for the included attiny84 example.

So i removed the 1.06 ide and installed the 1.5.8 version, the example now compiles correctly.
Also the folder and sub folder FAIL mentioned earlier (see below) is now correct and functions as it should, i now have a testable Attiny84/Nrf example.


After extracting, the following files / folders should exist...

C:\Projects\Arduino\hardware\tiny\avr\license.txt
C:\Projects\Arduino\hardware\tiny\avr\platform.txt
C:\Projects\Arduino\hardware\tiny\avr\Prospective Boards.txt
C:\Projects\Arduino\hardware\tiny\avr\README
C:\Projects\Arduino\hardware\tiny\avr\bootloaders
C:\Projects\Arduino\hardware\tiny\avr\cores\

The following folder should contain the source files for the Arduino-Tiny
core...

C:\Projects\Arduino\hardware\tiny\avr\cores\tiny\


After testing ill hopefully get your fork operational.

Essef :8)
Jta: Previous uno/mega builds wont compile with the SS rf24 fork in place, so my library is an hybrid at the moment.