I initially was not clear on what the radio.available() function really does and made first tests with a NodeMCU without a radio, that is, without the nRF24L01 board, or with one present, but powered down. This always resulted in a "Soft WDT Reset". That is, a crash, and not what I expected, a false return value from the function.
It seems that the function really checks for radio data, not the radio itself.
Is there no way just to check that the radio board is present and powered up - I mean, without crashing the ESP8266? I think that the reason of the reset is that there is a loop somewhere that takes too long - but even if this were true, I wouldn't know how to fix the problem.
Robin2:
The second function in the RF24 library datasheet is isChipConnected(). Maybe that would work?
Yes, it does; thank you very much.
(I started my experiments with the RF24 library not with the datasheet, but with a number of "Getting Started" code examples and tutorials. I now find it odd that none of those included a call to radio.isChipConnected(), but, instead, started with radio.available(). I mean, if you only call radio.available() and it returns false (if it returns at all), you won't know whether the reason is no radio data or a problem with the radio chip.)
In all my applications the nRF24 is always connected. I suspect that is true for most people.
There is nothing to prevent you taking a copy of the RF24 library and modifying the code to meet your needs. Just be sure to give the modified library a different name so there is no doubt which version you are using. Unfortunately TMRh20 did not change the library name when he evolved his version from the earlier ManiacBug version and that causes a lot of confusion.