0

I am using a Raspberry Pi 2 with a NRF24L01 module to communicate with several Arduinos. It is all working very well... until some point within a few days or weeks. Then I get only the following error: RF24 HARDWARE FAIL: Radio not responding, verify pin connections, wiring, etc.

When that happens, restarting the program doesn't get the errors to stop - the only way to fix it is to reboot.

The software is written in Python and uses the RF24 library.

I know this isn't much information, but I don't know what else to say... It basically works until some (seemingly) random time. This is the part which is confusing me the most. I couldn't find any problem in the code or an error traceback or anything, all there is is the timeout error from the script, without me touching it.

Does anybody have an idea of what it may be, or any ideas on how to further debug?

4
  • Perhaps look at other questions to get an idea of the information you need to provide. Commented Dec 31, 2018 at 9:20
  • 1
    Welcome to the Raspberry Pi flavoured corner of the Stack Exchange network - you may wish to take the tour to get a better idea of how things are suppose to work around here! Do you have a link to the datasheet for the NRF24L01 you could put up (by updating/editing your question)? Commented Dec 31, 2018 at 12:36
  • There is no generic tip about how to write bug-free software. Commented Jan 7, 2019 at 9:51
  • 2
    Some non genuine nRF24L01 are known to lock up and require a reset by removing power from time to time. Commented Oct 25, 2019 at 10:38

1 Answer 1

0

As for having a have to turn it off and on again I've had that sort of problem when the device that the Raspberry Pi is talking to is set or gets into a bogus state (for me it was a 16x2 LCD module with an PFC8574/74A backpack to provide an I2C interface).

If your problem is really that infrequent, you cannot find out why it is happening and you can detect when it has gone down - then it may be worthwhile arranging for a relay in the power supply to the NRF24L01 that can be operated by the Raspberry Pi. You will want the supply to be wired via the COMM and NC connections so that power flows to the unit when the relay is off. This means that when you detect a problem, you energise the relay for a short time to power down the unit and then de-energise the relay so the unit turns back on and then you can reinitialise it as necessary from the Raspberry Pi. This has the advantage that you only power the relay for a tiny proportion of the time.

One thing that crosses my mind about the conditions that might be causing this is that it is actually from outside of your setup. Perhaps it is a glitch in the powering or electro-magnetic interference from something else in the building? Does it happen when you switch a nearby fluorescent light on or off or a microwave or the central heating boiler lights up? Do you have long and unscreened wires between the Raspberry Pi and the NRF24L01 device? Does the power drop too much when the RPi system is loaded heavily or does your location get brown-outs? etc. etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.