Pressing button stops listening on nrf24l01 I have been tinkering for 2 days to manage send and receive between 2 arduinos. My code is bellow:

Arduino 1:

#include &lt;SPI.h&gt;
#include &lt;RF24.h&gt;
#include "printf.h"
#define LED 2
#define RF_CS 8
#define RF_CSN 9
RF24 radio(8,9);
String datargb = "rgb: 000000005";
char chartosend;
char inchar;
String inradio;
int endchar = '~';
void check_radio(void);
void setup() {
  // put your setup code here, to run once:
Serial.begin(115200);
  printf_begin();
  radio.begin();
  radio.setRetries(15,15);
  radio.openWritingPipe(0x080C600C01LL);
  radio.openReadingPipe(1,0x080C600C71LL);
  radio.setPALevel(RF24_PA_MAX);
  radio.setAutoAck(true);
  radio.printDetails();
  attachInterrupt(0, check_radio, FALLING);
  radio.stopListening();
}

void loop() {
  // put your main code here, to run repeatedly:
int lnth = datargb.length();
  for(int i=0; i&lt;lnth; i++){
      chartosend=datargb.charAt(i);

      while(!radio.write( &amp;chartosend, sizeof(chartosend) )){}

      Serial.println("sent");
  }
  radio.write(&amp;endchar,1);
}
void check_radio(void){

  bool tx,fail,rx;
  radio.whatHappened(tx,fail,rx);

  if(rx){
    Serial.println("interrupt!!");
radio.startListening();
    radio.read( &amp;inchar, sizeof(inchar) );
    inradio+=inchar;
    Serial.println(inchar);
    if(inradio.endsWith("~")){
      Serial.println(inradio);

      if(inradio.startsWith("rgb: ")){
        analogWrite(6,inradio.substring(5,8).toInt());
        analogWrite(9,inradio.substring(8,11).toInt());
        analogWrite(5,inradio.substring(11,14).toInt());
      }
      inradio = "";
      radio.stopListening();
    }
  }
}


Arduino 2:

#include &lt;SPI.h&gt;
//#include &lt;nRF24L01.h&gt;
#include &lt;RF24.h&gt;
#include "printf.h" 
//#include &lt;RF24_config.h&gt;
RF24 radio(8,10);
char data;
char chartosend;
char endchar = '~';
String inradio;
void check_radio(void);
String datargb = "To mounti tis manas tou nrf24";
void setup() {
  // put your setup code here, to run once:
  pinMode(9, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, INPUT);
  attachInterrupt(1, check_radio, FALLING);
  Serial.begin(115200);
  printf_begin();
  radio.begin();
   //radio.setRetries(2,15);
    // open pipe for writing
    radio.openReadingPipe(1,0x080C600C01LL);
    radio.openWritingPipe(0x080C600C71LL);
    radio.setPALevel(RF24_PA_MAX);
    radio.startListening();
    radio.printDetails();
    radio.setAutoAck(true);
}

void loop() {
  // put your main code here, to run repeatedly:
if(digitalRead(7)==HIGH){
  radio.stopListening();
  for(int i=0; i&lt;28; i++){
      chartosend=datargb.charAt(i);
      while(!radio.write( &amp;chartosend, sizeof(chartosend) )){}
      //Serial.println("sent");
  }
  radio.write(&amp;endchar,1);


  while(digitalRead(7)==HIGH){}
  radio.startListening();
}
}
void check_radio(void){

  bool tx,fail,rx;
  radio.whatHappened(tx,fail,rx);

  if(rx){
    Serial.println("interrupt!!");
//radio.startListening();
    radio.read( &amp;data, sizeof(data) );
    inradio+=data;
    Serial.println(data);
    if(inradio.endsWith("~")){
      Serial.println(inradio);

      if(inradio.startsWith("rgb: ")){
        analogWrite(6,inradio.substring(5,8).toInt());
        analogWrite(9,inradio.substring(8,11).toInt());
        analogWrite(5,inradio.substring(11,14).toInt());
      }
      inradio = "";
      //radio.stopListening();
    }
  }
}


Arduino 2 receives all data from ar1 but when I press the button attached to the pin 7 arduino 2 stops listening and only sends the first character of the string.
@Gerber remarked:

There is probably a death-lock situation where both arduino's are trying to send data the the other, while both aren't listening. So both are waiting for the other to ack. Like I said at your previous question. Why not send all rgb data in one packet. Also, there is no need to call radio.stopListening.

You send one char, and wait for and ACK. Then you send the next char and wait for an ACK. If the other unit doesn't process the message, the buffer will will up after 3 messages, and it will no longer send an ACK (because the buffer is full), and you while loop will hang