NRF24L01 not transmitting consistently

I am having issues getting the NRF24L01 to reliably transmit data. I am building a project for a one way road leading into a camp. The idea is for there to be 5 sensors along the road that have IP66 HC-SR04 IP66 ultrasound sensors on them. They will transmit back to a single node, which can also communicate with another node. The other 2 nodes will have LEDs on them outlining stop signs so when a vehicle comes into the property, a stop sign on the other side lights up telling people to not enter. (It is a one-lane road that has high fences on both sides for about 500 ft, backing up is difficult, so thus the warning system.)

I took a RF24 test and an Ultrasonic HC-SR04 codes and mashed them together. The idea is that each sensor will transmit when it detects something in its path (the road being about 450 [15 ft] across), so it transmits data when the received distance is between 45 cm and 300cm, and other times not transmit. Each sensor when it transmits that data, will include an array of 3 items. The sending units node number, the distance in centimeters and the transmit millis time. The array is set as an unsigned long array, and the Arduinos are Nano. Each Arduino will be powered by a Solar charge controller and a 3.7V 5000mAh battery (connected to a 6 watt solar panel).

This seems like it should be easy.... but I am having trouble even getting this to transmit across a rather short distance with both Nanos attached to my laptop.

Testing everything at the moment, this node will eventually be 011, but for now, I am marking it 00.

#include <RF24.h>
#include <RF24Network.h>
#include <SPI.h>

RF24 radio(10, 9);              // nRF24L01 (CE,CSN)
RF24Network network(radio);     // Include the radio in the network
const uint16_t this_node = 00;  // Office Base node
const uint16_t node01 = 01;     // Inside Stop Sign
const uint16_t node011 = 011;   // Inside First Sensor
const uint16_t node012 = 012;   // Inside Second Sensor
const uint16_t node013 = 013;   // Middle Sensor
const uint16_t node014 = 014;   // Outside Second Sensor
const uint16_t node015 = 015;   // Outside First Sensor
const uint16_t node02 = 02;     // Outside Stop Sign

const unsigned long interval = 25; //How often to send data to the other unit (ms)
unsigned long last_sent;

unsigned long transmitData[] = {0, 0, 0}; // 1st is contents of distance, 2nd is location, 3rd is time sent

int transmit_node = 00; // Node doing transmission

#define debug // trigger debug serial monitor messages.

#define echoPin 2 // attach pin D2 Arduino to pin Echo of HC-SR04
#define trigPin 3 //attach pin D3 Arduino to pin Trig of HC-SR04
long duration; // variable for the duration of sound wave travel
int distance; // variable for the distance (centimeters) measurement
float distanceft; // variable for the distance (feet) measurement

int getMeasurement() {
  // Clears the trigPin condition
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  // Sets the trigPin HIGH (ACTIVE) for 10 microseconds
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  // Reads the echoPin, returns the sound wave travel time in microseconds
  duration = pulseIn(echoPin, HIGH);
  // Calculating the distance
  // Calculating the distance
  distance = duration * 0.034 / 2; // Speed of sound wave divided by 2 (go and back)
  distanceft = distance * 0.0328084;
}

void setup() {
  SPI.begin();
  radio.begin();
  network.begin(90, this_node);  //(channel, node address)
  radio.setDataRate(RF24_2MBPS);
  transmit_node = 0;

  pinMode(trigPin, OUTPUT); // Sets the trigPin as an OUTPUT
  pinMode(echoPin, INPUT); // Sets the echoPin as an INPUT
#ifdef debug
  Serial.begin(115200); // // Serial Communication is starting with 115200 of baudrate speed
  Serial.println("Ultrasonic Sensor HC-SR04 Test"); // print some text in Serial Monitor
  Serial.println("with Arduino Nano");
#endif
}

void loop() {
  getMeasurement();

  // Prints the distance on the Serial Monitor
  if (distance != 0) {
    // continue only if get a valid reading.
    if (distanceft > 15) {
      // Nothing in road
      #ifdef debug
      Serial.print(F("NO VEHICLE -- Distance: "));
      Serial.print(distance);
      Serial.print(F(" cm; "));
      Serial.print(distanceft);
      Serial.println(F(" feet"));
      #endif
    } else if (distance < 20) {
      // Something is too close
      #ifdef debug
      Serial.print(F("TOO CLOSE!! - Distance: "));
      Serial.print(distance);
      Serial.print(F(" cm; "));
      Serial.print(distanceft);
      Serial.println(F(" feet"));
      #endif
    } else {
      unsigned long now = millis();
      if (now - last_sent >= interval) {
        last_sent = now;
        // Sweet spot send data on network
        #ifdef debug
        Serial.print(F("Sweet Spot -- Distance: "));
        Serial.print(distance);
        Serial.print(F(" cm; "));
        Serial.print(distanceft);
        Serial.print(F(" feet"));
        #endif
        // distance from sensor to object is
        transmitData[0] = distance;
        transmitData[1] = transmit_node;
        transmitData[2] = now;
        network.update();
        RF24NetworkHeader header(node01);     // (Address where the data is going)
        bool ok = network.write(header, &transmitData, sizeof(transmitData)); // Send the data
        delay(250);
        #ifdef debug
        Serial.print(F(" -- Data sent ("));
        Serial.print(transmitData[2]);
        Serial.print(F(") "));
        #endif
        
        unsigned long now = millis();
        if (now - last_sent >= interval) {
          last_sent = now;
        }
        if (ok) {
          Serial.println(F("ACK Rec"));
        } else {
          Serial.println(F("TX Failed"));
        }
      }
    }
  }
  delay(2500);
}

Here is the receive node:

#include <RF24.h>
#include <RF24Network.h>
#include <SPI.h>

RF24 radio(10, 9);              // nRF24L01 (CE,CSN)
RF24Network network(radio);     // Include the radio in the network
const uint16_t this_node = 01;  // Office Base node
const uint16_t node011 = 011;   // Inside First Sensor
const uint16_t node012 = 012;   // Inside Second Sensor
const uint16_t node013 = 013;   // Middle Sensor
const uint16_t node014 = 014;   // Outside Second Sensor
const uint16_t node015 = 015;   // Outside First Sensor
const uint16_t node02 = 02;     // Outside Stop Sign

#define debug // trigger debug serial monitor messages.
int transmit_node = 01;

void setup() {
  SPI.begin();
  radio.begin();
  network.begin(90, this_node);  //(channel, node address)
  radio.setDataRate(RF24_2MBPS);

#ifdef debug
  Serial.begin(115200); // // Serial Communication is starting with 9600 of baudrate speed
  Serial.println("One Way Traffic Controller"); // print some text in Serial Monitor
  Serial.println("with Arduino Nano");
#endif
}

void loop() {
  network.update();
  while (network.available()) {
    RF24NetworkHeader header;
    unsigned long incomingData[] = {0,0,0};
    unsigned long Distance;
    unsigned int receiveNode;
    network.read(header, &incomingData, sizeof(incomingData));
    Serial.print(F("Incoming (from "));
    Serial.print(incomingData[1]);
    Serial.print(F("): "));
    Serial.print(incomingData[0]);
    Serial.print(F(" cm -- transmitted at: "));
    Serial.print(incomingData[2]);
    Serial.println(F(")"));


  }
}

Stop right here and tell us you have actually began this project by testing to ensure you can reliably receive data from each of the sites you have mentioned.

In a way yes, I started with a basic mock up with the Ultrasonic sensor and my laptop, then added the NRF24L01 to that code with a 2 unit setup. presently they are both on my workbench separated by about 2 ft. The plan when I got them working well was to add another and work my way up.

So to answer your question, I am still in the mock up stage.

You are wasting your time with that until you have proof you can receive consistently from those locations in the weather you will have when the system is in operation.

Do you have a suggestion for how I can go about this project? Am I barking up the wrong tree for equipment or sensors?

That is exactly why you must test your equipment to see if it will do what you are proposing to do with it. Don't create big projects from the top down. Do the basics one at a time so you have confidence for the next step. Planning is essential.

The critical test is to check the communications at your test road. Write a program for the remote Arduino to send a message once per second. The message will have some text and a single byte that will have the message number in it. Each time a message is transmitted, increment the message number. It will roll over to zero and that will be fine.

Then write a program for the local Arduino to receive the message and check for each message number to be greater than the previous number, except when the number is zero, meaning the count is starting over. Count the number of missing numbers and report that number.
Good luck.