-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ACK packets short range only, TX packets OK with NRF24L01+PA+LNA modules #77
Comments
Hi Barry, thanks for all the detail about the issue, it is a huge help. I had two ideas: increase the wait time between retries when sending ACK packets, or do not use the ACK feature of the radio and instead manually switch the radios to RX and TX mode as needed to send data back and forth. NRFLite doesn't expose the wait time setting so you'll need to edit your local https://www.sparkfun.com/datasheets/Components/SMD/nRF24L01Pluss_Preliminary_Product_Specification_v1_0.pdf In NRFLite I configure the radio to use 500us for the 1 and 2 Mbps bitrates and 1500us for 250Kbps, but maybe longer wait times will help improve the distance with the LNA+PA radio modules you're using. The wait time can be controlled in increments of 250us up to 4000us. If you find a higher wait time fixes the problem let me know and I will include the change in the library. For an example, to set a 750us wait time you would change the https://github.com/dparson55/NRFLite/blob/master/src/NRFLite.cpp#L382 If the wait time increase doesn't help then you can bypass using the automatic ACK feature of the radio and just do the data sends back and forth manually. It's not hard to do and the |
Hi Dave, I have been reading all your comments and the links you have provided. As I understand it the ARD sets the delay 'between' retries at the TX if an ACK has not been received, not a delay between the receipt of a packet and the transmit of the ACK by the RX. I will try increasing the ARD, but I do suspect that not using the ACK feature will be the way to go, so I can time the return data to always occur when the TX receiver is receiving properly. EDIT: |
Ok too bad that didn't help and sorry I didn't mention the specific timing setting you asked about doesn't exist, the only control we have over timings related to the ACK feature is the automatic retransmit delay. It's also correct that the ACK transmission part performed by the primary RX radio is not retried, that ACK send is a fire and forget type of transmission that is performed as quickly as the radio designers deemed possible. It seems like many PA+LNA versions of the radio are incompatible with the automatic ACK feature of the nRF24L01, maybe for the very hardware timing limitation you mentioned. Your observation about the ACK failing at ~500mm separation is interesting as well. With this additional information and the existing knowledge base of PA+LNA issues (#44, #56, #63, #66), I'm going to update the readme to mention the ACK feature of the radio probably won't work if using PA+LNA modules and suggest people consider RFM69 modules when needing longer range wireless capability. Thinking more through it, adding retry logic isn't super straightforward and could easily result in some very messy code. Maybe a dedicated example is warranted. Let me know if you get stuck and would like an example. |
Hi Dave, My initial range tests were through double glazing and I now know that it attenuates 2.5GHz considerably. This is the through glass test: The RX has two 8 relay opto-isolated boards attached with LEDs on each relay feed, so in the dark I could set up different light combinations to see the response at the RX and see a count incrementing at each loop of the RX on the LCD of the TX. (when in range!) Sketches are here: Many thanks for your work on NRFLite! Without it I would probably have given up. I still don't understand classes, so some of your code has me lost. structs were also totally new, I now grasp the concept, but don't understand why or if they need to be used in NRFLite. Pointers are another thing that was new but I am coping with them. Whether their use actually makes a difference for this application I don't know. |
Maybe the incompatibility can be resolved by keeping CE active (and hence PA+LNA) until transmission with ACK is finished, not just CE_TRANSMISSION_MICROS to trigger a single transmission. |
Hi,
I have been working on this project for some time, but only recently have the transmitter in a portable state for doing range checks. I am building a system for remote control of electronics mounted at the top of an amateur radio mast.
I am using two arduino nano mega328 (v3 I think - Chinese) with two NRF24L01 + LNA + PA.
I need about 100m reliable range line of sight outdoors which works fine on transmit, however the received ackdata dies at a few meters, so even high gain yagi beam antennas would probably not compensate.
Data rate is 2Mb/s and dropping this either makes no difference or seems worse.
I have checked the frequency in use with a scanning sketch and it is clear.
I wondered about receiver sensitivity at the transmitter, but after swapping the two transceivers over there is no improvement.
The transmitted data packet is one 32bit byte and the ackdata packet is one 8bit byte.
The ack is rock solid with the units side by side. I am not using the 2 pin system on the nanos.
Both NRF24L01 units have their own dedicated 3.3V regulators and extra decoupling on a main PCB as well as the proverbial 10uF chip capacitor between GND and Vcc on the NRF cards.
The transmitter is in a steel box with the antenna protruding through the top panel such that the SMA connector is just below the panel. I can't imagine that any significant RX noise will be picked up from the arduino. The TX is battery powered so mains borne noise cannot be an issue.
I have also tested with a basic (non-amplified) NRF24 at the RX end, with the same range issue albeit shorter on both TX and RX.
Sorry for the long preamble, but I wanted to explain in some detail what I have already tried.
After reading all the info that I can find related to these, my most recent thought is about TX/RX timing.
Is there any way to increase the delay between RX of the data packet and TX of the ack at the RX end? I have seen a discussion about this relating to the NRF24 library but not for NRFLite.
Maybe if the TX receiver takes time to become fully active then with such short packets, maybe the packet arrives back before the TX receiver AGC has settled. I'm now clutching at straws :) Possibly similar issue with the LNA switching on these cards?
I'm not too bothered about speed, more reliability :)
Any ideas would be appreciated and I can send the TX and RX sketches if you think they will help, although simplified test cases for each would probably make more sense, as it's a rather specialized application.
The text was updated successfully, but these errors were encountered: