When this line is enabled radio.enableAckPayload(); I get to read the data but the radio stop working normally (as in write a command/ send a command to another unit to switch LED's on/off). In the 2nd section of the program attached I want to use the radio to switch LED's on/off.
When I disable the line // radio.enableAckPayload(); I am able to use the radio to switch the LED's on/off.
Whandall:
So you are doing something wrong in a program that evolved from some copied stuff?
If you don't want ackpayload, just don't use it, but it in no way hinders any other operation of an NRF24L01+.
Without seeing all of your code (tx and rx) it's a guessing game what you are doing wrong.
Yes it is copied from Robin2's nRF tutorial. I am curious if its possible to change the RF24.h file. Ive noticed that all pipes are either Ack enabled or disabled.
I am familiar with your work. I have read the swop roles sketch. My question is:
Is it possible to disableAckPayloads and return the radio to its normal function in this particular case? Can it be done by changing the cpp or h files?
ok, my mistake. Maybe I need to explain better. The Due(main brain) use a submenu. When You flick the menu to Data it should read the Ack data that is send from 2 Uno units.
When I flick the menu again I should be able to switch LED's on/off on another 2 Uno units.
Looks a little painful to switch back and forth. Why not just enable AckPayload for all units and ignore the payload you get from selective RX units in the TX?
gfvalvo:
Looks a little painful to switch back and forth. Why not just enable AckPayload for all units and ignore the payload you get from selective RX units in the TX.
Yes, I have tried doing that but the data to be send for the on /off is then send via AckPayloads. This data is not recognized as valid data( to do something/ perform a function).
The unit want to respond with a payload- in this case no payload is needed because its a switch.
If you use exactly four clients, the second and all the following packets with the same content
will be regarded as duplicate, which is determined by a 2 bit counter, the pipe and the packet crc.
Use a struct for sending packets and include a counter
that will guarantee different packet crc on the next polling round.
I think you problem is caused indirectly by the polling loop.
Whandall:
What are the stopListening() calls for? You never call startListening().
Why do you want to switch Ack and dynamic payloads?
Sending one byte of a one element int array seems rather convoluted and strange to me.
stopListening is called before write because its recommended in the cpp file. startListening is an auto response and no need to call in this instance.
It works just fine - all data is accounted for when in 'data' mode.
fnb111:
stopListening is called before write because its recommended in the cpp file. startListening is an auto response and no need to call in this instance.
Nope. Bad advice. Where do you get this stuff from?
Whandall:
If you use exactly four clients, the second and all the following packetswith the same content
will be regarded as duplicate, which is determined by a 2 bit counter, the pipe and the packet crc.
Use a struct for sending packets and include a counter
that will guarantee different packet crc on the next polling round.
I think you problem is caused indirectly by the polling loop.
I have done all that. I receive all the packages from both units. The issue is the on/off switch is not working while Ackpayloads are active