I am using a Raspberry Pi 2 with a NRF24L01 module... to communicate with several Arduinos. It is working very well ... until some point... after days or weeks. Then I get only timeouts.

Not even a normal restart is fixing it. Only a complete shutdown and new system start can bring it back to life.

The software is written in Python 3 with the RF24 library.

I know this are not many informations. But I don't know what else I could provide. It is basically working... until some random time. This is what is confusing me most. I have no idea what it could be. I couldn't find any error notice or anything... just the timeout from the script. And finally the Message "RF24 HARDWARE FAIL: Radio not responding, verify pin connections, wiring, etc." shows up. But I haven't touched anything.

Does anybody have a hot tip? Or any idea how to debug further?

  • Perhaps look at other questions to get an idea of the information you need to provide. – joan Dec 31 '18 at 9:20
  • 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)? – SlySven Dec 31 '18 at 12:36
  • There is no generic tip about how to write bug-free software. – Dmitry Grigoryev Jan 7 at 9:51

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.