NRF24L01 wierd numbers

So iam using the NRF24L01 transiver as an alarm system. Iam using 2 which both work but on the one serial monitor now and then a randon number will appear ? Just asking what this could be ?

 :1048576

Only that.

Receiver=

#include <FastLED.h>
#include <RF24.h>
#include <RF24Network.h>
#include <SPI.h>
const int buzzer = 7; //buzzer to arduino pin 9
const int led=2; //led pin
const int LED_PIN=6;

const uint64_t pipe[1]= {0xF0F0F0F0E1LL};

#define NUM_LEDS 5
#define DATA_PIN 6
 CRGB leds[NUM_LEDS];
 
RF24 radio(10, 9);  // nRF24L01 (CE,CSN)
RF24Network network(radio);// Include the radio in the network

const uint16_t this_node = 01;   // Address of our node in Octal format ( 04,031, etc)

void setup() {
  Serial.begin(9600);
   SPI.begin();
    radio.begin();
   delay(10);
   
 FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
 pinMode (buzzer, OUTPUT);
 pinMode(led, OUTPUT);
 
  radio.setAutoAck(true);
  radio.enableAckPayload();
  radio.enableDynamicPayloads();
  radio.openReadingPipe(1,pipe[0]);
  radio.startListening();
  radio.setRetries(15,15);
  
   network.begin(90, this_node); //Frequncy
  
}

void loop() {
  network.update();
  while ( network.available() ) {     // Is there any incoming data?
    RF24NetworkHeader header;
    unsigned long buttonState;
    network.read(header, &buttonState, sizeof(buttonState)); // Read the incoming data



Serial.print("    button1 :");Serial.println(buttonState); 
delay(50);


noTone(buzzer);
fill_solid( leds, NUM_LEDS, CRGB(0,0,0));


if(buttonState==20){
fill_solid( leds, NUM_LEDS, CRGB(200,100,0));
  FastLED.show();
delay(500);
tone(buzzer,1000);
fill_solid( leds, NUM_LEDS, CRGB(0,0,0));
  FastLED.show();
delay(500);
noTone(buzzer);
fill_solid( leds, NUM_LEDS, CRGB(200,0,0));
  FastLED.show();
delay(500);
tone(buzzer,1500);
fill_solid( leds, NUM_LEDS, CRGB(0,0,0));
  FastLED.show();
delay(500);
noTone(buzzer);
}else{
fill_solid( leds, NUM_LEDS, CRGB(0,0,0));
  FastLED.show();
 noTone(buzzer);
}
if(buttonState==30){
fill_solid( leds, NUM_LEDS, CRGB(0,0,200));
  FastLED.show();
  noTone(buzzer);
delay(500);
fill_solid( leds, NUM_LEDS, CRGB(0,200,0));
  FastLED.show();
  delay(500);
  fill_solid( leds, NUM_LEDS, CRGB(0,0,0));
  FastLED.show();
  delay(500);
}

}}

Transmitter =

#include <RF24Mesh.h>
#include <RF24Mesh_config.h>

#include <RF24.h>
#include <RF24Network.h>
#include <nRF24L01.h>
#include <SPI.h>
const int button3=7;
const int button2=6;
const int button=5;
const int buzzer=4;

int but2=0;   //Button inputs 
int but3=0;
int but1=0;
int Number=0;   // Varabel


RF24 radio(10, 9);               // nRF24L01 (CE,CSN) pins
RF24Network network(radio);      // Include the radio in the network
const uint16_t this_node = 00;   // Address of this node in Octal format ( 04,031, etc)
const uint16_t node01 = 01;   //Each node 
const uint16_t node02 = 02;  
const uint16_t node03 = 03;
const uint16_t node04 = 04;  
const uint16_t node05 = 05;

int beater=0;

const uint64_t pipe[1] = {0xF0F0F0F0E1LL};

void setup() {
  
   Serial.begin(9600);
   radio.begin();
   delay(10);
     SPI.begin();
   pinMode(button, INPUT_PULLUP);
   pinMode(button2, INPUT_PULLUP);
   pinMode(button3, INPUT_PULLUP);

  
network.begin(90, this_node);  //(channel, node address)Therfor 2400+(channel)= frequncy===== 2.400+90= 2490 
radio.stopListening(); 


radio.setAutoAck(true);
  radio.enableAckPayload();
  radio.enableDynamicPayloads();
  radio.openWritingPipe(pipe[0]);
  radio.setRetries(15,15);
}

void loop() {
  


  
  but1=digitalRead(button);  //Finding state of buttons 
  if(but1==0){
    Number=0;
  }
  but2=digitalRead(button2);  //Finding state of buttons 
  Serial.print("    Button2 :");Serial.println(but2); 
    if(but2==0){
    Number=20;
  }
  but3=digitalRead(button3); //Finding state of buttons 
  Serial.print("     Button3     :");Serial.println(but3); 
    if(but3==0){
    Number=30;
  }
Serial.print("    Number                  :");Serial.println(Number);  //Writing values to serial monitor
delay(50);

  network.update();
  unsigned long buttonState = Number;
  RF24NetworkHeader header(node01);    // (Address where the data is going)
  RF24NetworkHeader header2(node02); //Other nodes
  RF24NetworkHeader header3(node03);
  RF24NetworkHeader header4(node04);
  RF24NetworkHeader header5(node05);
  bool ok = network.write(header, &buttonState, sizeof(buttonState)); // Send the data
  bool ok2 = network.write(header2, &buttonState, sizeof(buttonState));  //Sending the button state to each node 
  bool ok3 = network.write(header3, &buttonState, sizeof(buttonState));
   bool ok4 = network.write(header4, &buttonState, sizeof(buttonState));
    bool ok5 = network.write(header5, &buttonState, sizeof(buttonState));
 delay(50);
 
}

Why don't you look at the program that wrote that number and see where it comes from?

Paul

DutchOrange:
So iam using the NRF24L01 transiver as an alarm system. Iam using 2 which both work but on the one serial monitor now and then a randon number will appear ?

You will have to explain that in a lot more detail, including how things are connected, when the numbers appear, whether they are always the same (and if not provide some samples) and what the correct data should be.

...R
Simple nRF24L01+ Tutorial

So iam using the same setup as this website

The data iam looking for is only 3 numbers
0 or 20 or 30 which triggers lights for my own use.
The number that appears is very random but is the same number each time.
As is seems the numbers has disapered.
Iam guessing it is noise from around the area.

Thanks for the help

DutchOrange:
So iam using the same setup as this website

I have no experience with that.

Wireless problems can be very difficult to debug. If my Tutorial has any value for you and if you run into a problem with it I will be glad to try to help. The examples are as simple as I could make them and they have worked for other Forum members.

...R

What / where is your tutorial or is it the same one as that link.?

DutchOrange:
What / where is your tutorial or is it the same one as that link.?

Yes, the link in Reply #2.

I presume you have already looked at it rather than wait for this Reply.

...R

PS ... weird is not spelled "wierd". It is one of the many examples that do not follow the i before e rule