No Rx from nrf24l01+ module on Uno(MISO working)

Problem: No Rx from nrf24l01+ module on Uno(Transmission is working, but it doesn't show it received ack packet nor does it receive anything), but everything is working fine when used the same program and connections and module with nano. Test conditions: Testing communication between Raspberry Pi and Uno/Nano with default pingpair testbench with few options changed(250kbps, power level low for testing since modules are close, not using irq). Possible reasons with debugging performed: Maybe SCK isn't working, but then transmission or printdetails wouldn't be working(there is one thing though, the pin 13 led on Uno isn't blinking when sck is sending clock to the module whereas it did on Nano for all the time SCK was being used for the clock, the led isn't bad checked it many times by blinking it, can understand if there is low light during transmission since sck will be used only for some part of time but when receiving it should be lighting view-ably bright since the module is read continuously to check if any packets are available) Maybe MISO isn't working, but then printdetails wouldn't have printed the correct details.(Checked RF24.cpp, printdetails uses MISO for reading registers, so that proves MISO is working atleast for that much time) Thought maybe for some weird reason the voltage or Uno's reception on MISO might not be correct after printdetails so used an LED to see the signal on irq(active low, goes low when it receives the ack packet or when the module transmits or receives data), and i found that the module is generating IRQ on transmission but there is nothing on the IRQ for ack packet or when its in receiving mode and raspberry pi is transmitting, which tells me that the module isn't getting any reception which is really weird because like i said earlier 'everything' is working properly with Nano(getting proper IRQs for ack or tx or rx) which means there is nothing wrong with the module. (UNO is UNO-R3, both Nano and Uno have atmega328P)

So what might be going wrong here?

This problem has really been bugging me, any help will be appreciated :D Thank you for your time

Try this Simple nRF24L01+ Tutorial - it does work

...R

Robin2: Try this Simple nRF24L01+ Tutorial - it does work

...R

Sorry but i do know how these work already, i am confused as to why they are working properly with Nano, but not receiving data with Uno.

iamnotgoogle: Sorry but i do know how these work already, i am confused as to why they are working properly with Nano, but not receiving data with Uno.

Debugging wireless is complex and it is easier to help you with code that is familiar to me.

In any case you have not posted your own code.

...R

Robin2:
Debugging wireless is complex and it is easier to help you with code that is familiar to me.

In any case you have not posted your own code.

…R

Quoting my own sentences from the main post:
“Test conditions: Testing communication between Raspberry Pi and Uno/Nano with default pingpair testbench with few options changed(250kbps, power level low for testing since modules are close, not using irq).”
“everything is working fine when used the same program and connections and module with nano”.

Coming back to your sentence:
There is no wireless debugging needed here because “if the link wasn’t working it wouldn’t work with Nano either”.
The pingpair and pingpair_dyn examples are already included in the default package my friend(Since its available with the default package i didn’t bother putting it here). If you still want them here you go:
Raspberry Pi(pingpair_dyn):

#!/usr/bin/env python
from __future__ import print_function
import time
from RF24 import *
import RPi.GPIO as GPIO
irq_gpio_pin = None
radio = RF24(22, 0);
def try_read_data(channel=0):
   if radio.available():
       while radio.available():
           len = radio.getDynamicPayloadSize()
           receive_payload = radio.read(len)
           print('Got payload size={} value="{}"'.format(len, receive_payload.decode('utf-8')))
           radio.stopListening()
           radio.write(receive_payload)
           print('Sent response.')
           radio.startListening()

pipes = [0xF0F0F0F0E1, 0xF0F0F0F0D2]
min_payload_size = 4
max_payload_size = 32
payload_size_increments_by = 1
next_payload_size = min_payload_size
inp_role = 'none'
send_payload = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ789012'
millis = lambda: int(round(time.time() * 1000))

print('pyRF24/examples/pingpair_dyn/')
radio.begin()
radio.setChannel(108)
radio.setRetries(15,15)
radio.setPALevel(RF24_PA_MAX)
radio.setCRCLength(RF24_CRC_16)
radio.setDataRate(RF24_250KBPS)
radio.enableDynamicPayloads()
radio.printDetails()

print(' ************ Role Setup *********** ')
while (inp_role !='0') and (inp_role !='1'):
   inp_role = str(input('Choose a role: Enter 0 for receiver, 1 for transmitter (CTRL+C to exit) '))

if inp_role == '0':
   print('Role: Pong Back, awaiting transmission')
   if irq_gpio_pin is not None:
       GPIO.setmode(GPIO.BCM)
       GPIO.setup(irq_gpio_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
       GPIO.add_event_detect(irq_gpio_pin, GPIO.FALLING, callback=try_read_data)

   radio.openWritingPipe(pipes[1])
   radio.openReadingPipe(1,pipes[0])
   radio.startListening()
else:
   print('Role: Ping Out, starting transmission')
   radio.openWritingPipe(pipes[0])
   radio.openReadingPipe(1,pipes[1])
while 1:
   if inp_role == '1':
       radio.stopListening()
       print('Now sending length {} ... '.format(next_payload_size), end="")
       radio.write(send_payload[:next_payload_size])
       radio.startListening()
       started_waiting_at = millis()
       timeout = False
       while (not radio.available()) and (not timeout):
           if (millis() - started_waiting_at) > 500:
               timeout = True
       if timeout:
           print('failed, response timed out.')
       else:
           len = radio.getDynamicPayloadSize()
           receive_payload = radio.read(len)
           print('got response size={} value="{}"'.format(len, receive_payload.decode('utf-8')))
       next_payload_size += payload_size_increments_by
       if next_payload_size > max_payload_size:
           next_payload_size = min_payload_size
       time.sleep(0.1)
   else:
       if irq_gpio_pin is None:
           try_read_data()
       else:
           time.sleep(1000)

Arduino(pingpair_dyn):

/*
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.
*/
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
RF24 radio(9,10);
const int role_pin = 5;
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };
typedef enum { role_ping_out = 1, role_pong_back } role_e;
const char* role_friendly_name[] = { "invalid", "Ping out", "Pong back"};
role_e role;
const int min_payload_size = 4;
const int max_payload_size = 32;
const int payload_size_increments_by = 1;
int next_payload_size = min_payload_size;

char receive_payload[max_payload_size+1];

void setup(void)
{pinMode(role_pin, INPUT);
 digitalWrite(role_pin,HIGH);
 delay(20);
 if ( digitalRead(role_pin) )
   role = role_ping_out;
 else
   role = role_pong_back;
 Serial.begin(115200);
 
 Serial.println(F("RF24/examples/pingpair_dyn/"));
 Serial.print(F("ROLE: "));
 Serial.println(role_friendly_name[role]);
 radio.begin();
 radio.setChannel(108);
 radio.setPALevel(RF24_PA_LOW);
 radio.setDataRate(RF24_250KBPS);
 radio.setCRCLength(RF24_CRC_16);
 radio.enableDynamicPayloads();
 radio.setRetries(5,15);
 if ( role == role_ping_out )
 {
   radio.openWritingPipe(pipes[0]);
   radio.openReadingPipe(1,pipes[1]);
 }
 else
 {
   radio.openWritingPipe(pipes[1]);
   radio.openReadingPipe(1,pipes[0]);
 }
 radio.startListening();
 radio.printDetails();
}

void loop(void)
{
 if (role == role_ping_out)
 { static char send_payload[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ789012";
   radio.stopListening();
   Serial.print(F("Now sending length "));
   Serial.println(next_payload_size);
   radio.write( send_payload, next_payload_size );
   radio.startListening();
   unsigned long started_waiting_at = millis();
   bool timeout = false;
   while ( ! radio.available() && ! timeout )
     if (millis() - started_waiting_at > 500 )
       timeout = true;
   if ( timeout )
   {
     Serial.println(F("Failed, response timed out."));
   }
   else
   { uint8_t len = radio.getDynamicPayloadSize();
     if(!len){
       return; 
     }
     radio.read( receive_payload, len );
     receive_payload[len] = 0;
     Serial.print(F("Got response size="));
     Serial.print(len);
     Serial.print(F(" value="));
     Serial.println(receive_payload);
   }
   next_payload_size += payload_size_increments_by;
   if ( next_payload_size > max_payload_size )
     next_payload_size = min_payload_size;
   delay(100);
 }
 if ( role == role_pong_back )
 { while ( radio.available() )
   { uint8_t len = radio.getDynamicPayloadSize();
     if(!len){
       continue; 
     }
     radio.read( receive_payload, len );
     receive_payload[len] = 0;
     Serial.print(F("Got response size="));
     Serial.print(len);
     Serial.print(F(" value="));
     Serial.println(receive_payload);
     radio.stopListening();
     radio.write( receive_payload, len );
     Serial.println(F("Sent response."));
     radio.startListening();
   }
 }
}

(Removed the comments to fit reply, you can see the examples at https://github.com/TMRh20/RF24/blob/master/examples_linux/pingpair_dyn.py and https://github.com/TMRh20/RF24/blob/master/examples/pingpair_dyn/pingpair_dyn.ino ; the changes that are there are mentioned in main post and also in the above examples)

I thought i had made the main post clear enough with all the details and all the debugging i have performed but guess not, please do let me know if anything else is needed. Thank you.

To reduce this to its essentials ...

Are you saying that you have a program working on a Nano that communicates with an RPi using nRF24 transceivers? And are you saying that the exact same program will not work using the exact same nRF24 device when tried on an Uno?

OR

Are you saying that you are trying to communicate between an RPi and an Arduino and it is not working properly?

...R

Robin2: To reduce this to its essentials ...

Are you saying that you have a program working on a Nano that communicates with an RPi using nRF24 transceivers? And are you saying that the exact same program will not work using the exact same nRF24 device when tried on an Uno?

OR

Are you saying that you are trying to communicate between an RPi and an Arduino and it is not working properly?

...R

Quoting my sentence from main post: "Problem: No Rx from nrf24l01+ module on Uno(Transmission is working, but it doesn't show it received ack packet nor does it receive anything), but everything is working fine when used the same program and connections and module with nano." (I have written bigger and simpler programs for communicating with the nrf24 modules between rpi and nano/uno but like i said its receiving ack and/or data properly on nano but not on uno, but transmission is working fine on both of them, for the sake of simplicity in debugging i have used the pingpair_dyn examples here but i really doubt that the program is of any fault here considering same thing works on nano, and from the tests i have performed the pins of uno seem to be working properly and the module too since the same thing works with nano properly which is why i am frustrated as to what might be causing the problem)

I was hoping for something like Yes, Yes and Not relevant. (or whatever is appropriate)

It is not too late to answer my questions.

...R

Robin2: To reduce this to its essentials ...

Are you saying that you have a program working on a Nano that communicates with an RPi using nRF24 transceivers?

Yes

And are you saying that the exact same program will not work using the exact same nRF24 device when tried on an Uno?

Yes

I don't have a Nano so I am not aware if it has any idiosyncrasies. I have always assumed it is just a small Uno.

My example code certainly works with an Uno (and Mega and Leonardo).

Can you make simple pencil diagrams showing how everything is connected for both the Nano and the Uno and post photos of the drawings.

Do you have a 10µF capacitor across Vcc and GND for the nRF24L01+. However, while I need it on my breadboard projects I have not needed it on my Uno. Is yours a genuine Uno?

...R

[OT]

Robin2: I don't have a Nano

Get some dirt cheap clones from China. ;)

[/OT]

Whandall: [OT]

Get some dirt cheap clones from China. ;)

[/OT]

OT

WHY ?

/OT

:)

...R

I like the builtin USB, the size, the price, the cheap prototype adapter, they work fine with NRFs ;) , ...

Whandall: I like the builtin USB, the size, the price, the cheap prototype adapter, they work fine with NRFs ;) , ...

I don't disagree with any of that. I just have no requirement at the moment for any more Arduino boards :) I have several Atmega 328s and several Attiny 1634s. :)

...R

Hello Iamnotgoogle and the rest,

After several days of searching, this forum entry describes very closely the same problem I have. I saw that this forum has gotten off topic in the last few posts, however, did anybody find a solution for this problem?

In my case I get a working system with NRF24 module and a nano. Not only the examples, but basic scripts like driving a tank, controlled with a joystick and multiple buttons etc. (similar to this, but i did not use this how to http://www.learningaboutelectronics.com/Articles/Arduino-2-axis-thumb-joystick.php)

However, I cannot get the NRF module and arduino UNO to work. I have tried several arduino uno's, I have swapped all the NRF-modules etc.

Tonight I am going to tinker around with it again. I'll post my findings if it's worthwile. Any help would be appreciated though.

Regards, T

TuK: However, I cannot get the NRF module and arduino UNO to work. I have tried several arduino uno's, I have swapped all the NRF-modules etc.

Are you trying to communicate between two Arduinos with nRF24L01+ modules? If so, have you tried the examples in the tutorial linked in Reply #1?

If you are trying to communicate between an RPi and Arduino post the programs you are using together with clear diagrams (NOT Frizting, thank you) showing how everything is connected.

Start with the simplest possible program - for example sending "Hello World"

...R

I have NRF24L01s running on

  • Nano
  • Pro-Mini 5V/16MHz
  • Pro-Mini 3.3V/8MHz
  • Mega
  • Uno
  • Mega128 did not hook up the Due, 328PB-Uno or Micro yet, but I bet they work too. ;)

Hello Robin2 and Whandall,

Yes, I only use arduino's, no RPi. The strange thing is, I think I know how to use the NRF24 modules since I have them working from arduino nano to arduino nano. But as said, exactly the same programs will not work with "arduino uno to arduino nano" or "arduino uno to arduino uno".

This weekend I will check the wiring for the hundredth time and try the examples mentioned in reply#1 However, I would think that using the pingpair example coming with the TMRh20 library would be simple enough to start with (also because it does work with nanos).

Regards, T

using the pingpair example coming with the TMRh20 library would be simple enough to start with

I deliberately made my examples simpler :)

If you have communication working between two nanos and it won't work between one of those nanos and an Uno it means there is a problem with the Uno program or the wiring.

Have you got 10µF capacitors connected between Vcc and GND for the nRf24s? Sometimes that is essential.

...R

Hello Robin2

Sorry, my reply took a bit longer than I expected. firstly: yes, I do have capacitors soldered between all the nrf24s that I have.

The output of the serial monitor of the two scripts is shown below, but this is in short what I have found:

1/ when using the gettingstarted script (TMRh20 library) with: a/ UNO transmitting, Nano receiving: -Nano receives and sends back, Uno reports 'Failed, response timed out.' b/ Nano transmitting, UNO receiving: -Uno reports nothing and Nano reports 'Failed, response timed out.' 2/ when using the SimpleTx.ino and SimpleRx.ino with: a/ UNO transmitting, Nano receiving -first few (sometimes 3, sometimes 10 etc) sendings registerd as ' Acknowledge received' then 'Tx failed' b/ Nano transmitting, UNO receiving - Forgot to write down what happened (..... :/) but I think I remembered that there was no communication at all

However, The Uno works when using the NRF24 in combination with the special NRF adapter (https://opencircuit.nl/Product/10517/NRF24L01-adapter-module)

I am glad I found a way to get the UNO working with the NRF, but why do I need the adapter? I guess it has nothing to do with better power management (eg. a larger capacitor over GND and Vcc) since that would influence the sending, not te receiving (or is that a wrong assumption). So what is it, could I have forseen this?

Thanks, T


output of serial monitor below here


UNO transmitting, nano receiving

Uno:

RF24/examples/GettingStarted *** PRESS 'T' to begin transmitting to the other node *** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK Now sending failed Failed, response timed out. Now sending failed Failed, response timed out. *** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK

Nano:

RF24/examples/GettingStarted *** PRESS 'T' to begin transmitting to the other node Sent response 21636440 Sent response 22868868


Nano transmitting, uno receiving:

Uno:

nothing

Nano:

*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK Now sending failed Failed, response timed out. Now sending


with the simpletX, simpleRx:

when UNO master:

SimpleTx Starting Data Sent Message 0 Acknowledge received Data Sent Message 1 Acknowledge received Data Sent Message 2 Acknowledge received Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed Data Sent Message 3 Tx failed