The nrf24l01+ module

am having trouble using this module.
I have two main problems.

No. 1:
I'm running the code for a simple transmission and receiver link between two nrf modules. On the tranmitting end I am sending a tructure which looks like this:

typedef struct {
int a;
byte b;
byte c;
byte d;
byte e;
}
typedef Data;

the receiver end successfully checks radio availability however the radio.read function fails to adequately read the data. please help with this.

No. 2:

How do i connect two nrf modules to a single arduino nano or uno board?
the radio pins that are defined for the R24 module can only be defined once.
The compiler gives an error when i try and redefine the pins. please help

Have a look at this Simple nRF24L01+ Tutorial.

You should not need to connect 2 nRF24 modules to the same Arduino, and if you do I suspect they will interfere with each other. If you provide a full description of your project it will be much easier to help.

...R

Robin2:
You should not need to connect 2 nRF24 modules to the same Arduino, and if you do I suspect they will interfere with each other.

I'm with you on the "You should not need to connect 2 nRF24 modules to the same Arduino",
but do you have any proof of the suspected interference ?

(given they are configured to different channels far enough apart)

Whandall:
but do you have any proof of the suspected interference ?

(given they are configured to different channels far enough apart)

None. I just try to avoid creating problems for myself.

...R

The project is basically a large city wide wireless communication type for which I'm building a POC.
In the actual design we have two different type of communicators the nrf and the LoRa WAN for now we are just testing our algorithms with two nrf modules instead as we have yet to receive the LoRa WAN. Due to the different distances both cover I am very sure i need both of them in that particular unit just looking at the possibility if i can connect them to the same arduino micro-controller or would have to hook two different arduino boards.

thanks for your prompt responses by the way really appreciate it however yet to see a possible solution.
What would be your suggestion on the structure issue? Also I've already watched that video and a couple a dozen others. And yeah your right structures do seem to move with those same commands I've recreated the code even literally typed in word for word from those videos still not seeing data on the receiving end despite it passing the radio availability check

Muhammad_Ali_Murad:
And yeah your right structures do seem to move with those same commands I've recreated the code even literally typed in word for word from those videos still not seeing data on the receiving end despite it passing the radio availability check

Have you tried the examples in my nRF24 Tutorial? They do work and have been tried by other Forum members.

I am not clear about what you plan to use the nRF24s for and what you plan to use the LoRa modules for.

...R

Look the project is my FYP, so not really eager to air out all design details.
So I'm only gonna describe things vaguely, we basically have a large number of say unit a, b and c
unit a is the primary unit and is present in abundance it uses the nrf module to convey information.
the unit b receives this info. from multiple unit a's. finally the unit c receive the info from a large number of unit b's the unit c is situated approximately a kilometer away from the unit b's which means we require a LoRa WAN for that piece to work properly.

Muhammad_Ali_Murad:
Look the project is my FYP, so not really eager to air out all design details.

That is your prerogative.

But this is an Open Source forum and if you are not prepared to be open ....

...R

Muhammad_Ali_Murad:
Look the project is my FYP

So you should work that out, shouldn't you?

True enough and the design is my own. I just wanted a second opinion on things. Just answer this. is it possible to attach 2 nrf modules to a single arduino board other things I'll work out on my own

Yes, it is possible to attach two (or more) NRF24L01+s to a single Arduino.

Maybe you should lookup SPI, which you should have done already, since you want to use it.

indeed however I am talking about simultaneously operating both. There are indeed SPI pins available. but in the nrf library before radio transmission or reception begins u have to define the radio pins. and then start with the radio.begin commands. When i try to redefine these pins the program gives an error. So I can only use switching statements before the defining step. which means only one nrf will work at a time which defeats the point of having two in operation. I have already done this. Can you send me the program you Are using to operate both nrf modules simultaneously?

Muhammad_Ali_Murad:
Can you send me the program you Are using to operate both nrf modules simultaneously?

No, I never did that, but it is absolutely possible, while very uncommon and rarely useful.

Muhammad_Ali_Murad:
When i try to redefine these pins the program gives an error.

The following does not generate an error.

#include <RF24.h>

RF24 one(7, 8);
RF24 two(9, 10);

void setup() {
  one.begin();
  two.begin();
}
void loop() {}

Thank-you for all your responses. That error just solved itself when i deleted and reinstalled my IDE.
Once I work things out I'll be sure to post my project and related codes after my staff supervisor gives me the go ahead.