problem with nrf24l01 + socket + arduino

Description: Hi guys, I am trying to make an arduino controller. However, I can not receive any data from transmitter. I used 2 joysticks, 2 arduino nanos (for transmitter and receiver), 2 nrf24l01 and 2 nrf sockets to protect nrf from damaging. To resolve the problem i tried different libraries, replaced the sockets and nrf24l01.

PIN connections:

2 joysticks are connected to pins A0, A1, A2, A3. (pins 14-17)
D13 - SCK
D12 - MI
D11 - MO
7 - CE
8 - CSN
5v - VCC

TRANSMITTER CODE:

#include "nRF24L01.h"
#include <RF24.h>
#include <SPI.h>

int joystickX1 = 16;
int joystickY1 = 17;
int joystickX2 = 14;
int joystickY2 = 15; 

const uint64_t radioPipe = 0xE8E8F0F0E1LL; 


RF24 radio(7, 8); 
                   

struct dataToBeSend {
  byte dataOfJoystickX1;
  byte dataOfJoystickX2;
  byte dataOfJoystickY1;
  byte dataOfJoystickY2;
};

dataToBeSend sendData;

void setup() {

  Serial.begin(9600);
  radio.begin();
  radio.openWritingPipe(radioPipe);
  radio.setPALevel(RF24_PA_MIN);
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.stopListening();

  pinMode(joystickX1, INPUT);
  pinMode(joystickY1, INPUT);
  pinMode(joystickX2, INPUT);
  pinMode(joystickY2, INPUT);
  sendData.dataOfJoystickX1 = 127;
  sendData.dataOfJoystickX2 = 127;
  sendData.dataOfJoystickY1 = 127;
  sendData.dataOfJoystickY2 = 127;
}

void loop() {

  sendData.dataOfJoystickX1 = map(analogRead(joystickX1), 0, 1024, 0, 255);
  sendData.dataOfJoystickX2 = map(analogRead(joystickX2), 0, 1024, 0, 255);
  sendData.dataOfJoystickY1 = map(analogRead(joystickY1), 0, 1024, 0, 255);
  sendData.dataOfJoystickY2 = map(analogRead(joystickY2), 0, 1024, 0, 255);
  
  if(radio.write(&sendData, sizeof(dataToBeSend))){

    Serial.print("X1 ");
    Serial.println(sendData.dataOfJoystickX1);
    Serial.print("Y1 ");
    Serial.println(sendData.dataOfJoystickY1);
    Serial.print("X2 ");
    Serial.println(sendData.dataOfJoystickX2);
    Serial.print("Y2 ");
    Serial.println(sendData.dataOfJoystickY2);
    Serial.println("----------------------------------------------------"
  } else {
    Serial.println("not send");
  }
}

RECEIVER CODE:

#include "nRF24L01.h"
#include <RF24.h>
#include <SPI.h>

const uint64_t radioPipe = 0xE8E8F0F0E1LL; 
                                         

RF24 radio(7, 8); 

struct receivedData {
  byte dataOfJoystickX1;
  byte dataOfJoystickX2;
  byte dataOfJoystickY1;
  byte dataOfJoystickY2;
};

receivedData data;

void setup() {

  Serial.begin(9600);
  radio.begin();
  radio.setPALevel(RF24_PA_MIN);
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.openReadingPipe(1, radioPipe);
  radio.startListening();
}

void loop() {

  if( radio.available()){
    radio.read(&data, sizeof(receivedData));

    Serial.print("X1 ");
    Serial.println(data.dataOfJoystickX1);
    Serial.print("Y1 ");
    Serial.println(data.dataOfJoystickY1);
    Serial.print("X2 ");
    Serial.println(data.dataOfJoystickX2);
    Serial.print("Y2 ");
    Serial.println(data.dataOfJoystickY2);
    Serial.println("----------------------------------------------------");
    
  } else {
    Serial.println("no data");
  }
}

and also I attached outputs of COM6 (TRANSMITTER) and COM7 (RECEIVER)

Have a look at this Simple nRF24L01+ Tutorial.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

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

There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.

...R