I am new to the Arduino forum and I hope that I am posting at the right place. (I have red the post rules).
I have an issue when I am trying to work with the nRF24L01+ as a * transceiver *.
I did succeed transmitting with one unit and receiving with the second unit.
I am using 2 Arduino UNO Boards with ATmega328P chips on them.
I am also using the RF24 library and I am now in the process of trying to understand every line that you need to write there. (For example: what is: Buffer, payload, acknowledgement, what does the radio.setRetries mean? etc.)
I saw a lot of examples on the internet on how to operate the nRF24L01+ but no one has actually explained properly what each line does in its action and how does it exactly work. (A bit hard to understand.)
What I am doing is sending a command of a push button from the Tx unit to the Rx unit and light a red LED. --> Success!
What I am trying to do and ** didn't succeed ** is to light a green LED on the Tx unit that got an OK message from the Rx unit.
To explain more deeply: the Rx unit will now become the Tx unit and will let the Base Tx unit to know that it got the "lighting the red LED command completed successfully!" and with the command received on the Base Tx unit, the green LED will turn on.
I hope you understood me and know how to solve this issue...
In addition, if you could tell me exactly how does this whole thing of pipes, acknowledgements things are and how it works exactly it would be much appreciated.
Thank you very much in advance
the Rx unit will now become the Tx unit and will let the Base Tx unit to know that it got the "lighting the red LED command completed successfully!" and with the command received on the Base Tx unit, the green LED will turn on.
The autoacknowledge feature of the chip could be used for that,
it makes the sending device know whether the message was copied.
You can attach a maximum of 32 data bytes to the acknowledgment,
if there is more to report than just "I've copied your message".
As you have to have the autoack payload placed into the chip before it receives the request,
the information can not report a "I switched it on",
its more something like "I promise to switch it on" and/or
"there where no problems in executing the command(s) before this one".
You could send two messages per action,
the first (command) triggering the action and returníng the promise,
the second (status) could return the outcome of the action.
Using the chips in that fashion leaves the role-switching between rx and tx to the chipset,
so you do not have to struggle with changing between roles (synchronous in both stations) yourself.
You will find a description how that autoacknowledge feature works in the datasheet of the NRF24L01.
Thanks for your reply.
I think that the best way is for someone to post a code here (one for the Base Tx unit and second to the Rx unit) with working with the nRF24L01+ as a transceiver with a push button lighting a red LED and returning a command to the Base Tx unit to light there a green LED and of course to explain what each line does.
It doesn't matter if it's with a library usage or not.
I am sure such examples exist already, take a look at the Wireless category at www.yourduino.com and the HowTo section under the nrf24L01 modules there.
I didn't find something about what I wrote.
This site is just an ordering site.
Maybe you can be more specific about where to look?
What did you mean by: "Do not hesitate?"
And one more thing:
When you wrote: "The acknowledgement feature of the chip" - did you mean that I need to use the IRQ pin (pin 8)?
Although every program that I saw, there was someone that always said pin 8 is unused.
A funny thing is that when I uploaded my program that worked on the Arduino UNO board I must have used the IRQ - pin 8 but in the Arduino Nano board I didn't have to use the IRQ - pin 8 with the exact same program.
Do you know why this happens?
What did you mean by: "Do not hesitate?"
That you could/should do it yourself to enligthen all others?
O-mer we look forward to seeing how you present your 'homework'. I'm sure you will get a lot of help off the forum as you proceed, that's how we all learn.
Following instructable will get you started
Following link explains a lot of the lines of code used with nrf24L01
Enjoy & post what you achieve