jpbarraca / pynrf24

Python port of the RF24 library for NRF24L01+ radios.
GNU General Public License v2.0
152 stars 84 forks source link

radio.isAckPayloadAvailable() not working #30

Open HoracioDos opened 7 years ago

HoracioDos commented 7 years ago

radio.isAckPayloadAvailable() always returns false when sending a message with dynamic payload size Sender code.

radio.write(message)
if radio.isAckPayloadAvailable():
   ack = []
   radio.read(ack)
   print ack

Receiver code

recv_buffer = []
radio.read(recv_buffer)
ack_buffer = [1]
radio.writeAckPayload(1,ack_buffer, len(ack_buffer))
MilesBDyson commented 4 years ago

i am having this issue as well, i have been trying to get the ackpayload to work with zero results, has any one figured out a work around, dynamicpaylod on or off it seams i can not get it working.

lafila93 commented 4 years ago

I did some testing myself and got it to work in the end. isAckPayloadAvailable() seems to return False even though available() does return True when exspecting an Ack Payload. So I'd recommend just using available() for now. Mentionworthy remark that did cost me some time to debug: do not call startListening() after writing if you want to read the Ack Payload - this functions clears the buffer and the Ack Payload gets lost. Dynamic and Ack Payload works very well together on my side.

MilesBDyson commented 4 years ago

thank you this worked for me.