-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
RF24 HARDWARE FAIL: after first write #6
Comments
Did you clone the repository or is NPM install? |
By the time I created the issue I had only tried "npm install". Checking out master with git results in ALL packets failing with the "RD24 HARDWARE FAIL" message. Even the first one (which works fine and I can see it's received on the other end when using "npm install"). Another difference is that git version seems to print additional debugging info after configuring the interface. |
Yes, the master has test traces for debugging on config. The behavior you describe is very strange as this error is typically issued with HW and wiring problems. But if a cpp program using the library works the node module should work also as it simply call library. Could you better describe your set-up, test code and output? I can try to replicate your problem in my RPi3. I use dietPi though but I think this is not the soruce of the problem. Regards, |
I've tried checking out several commits from git in an attempt to isolate the issue, but all I could come up with is this: commits from 8635de7 to 220d766 -> fail to build |
About my setup: Raspberry Pi 3 model b. I'm using a nRF24L01+ module with embedded antenna both in this raspberry and in the arduino receiver. The only difference with the pinout in your readme is that I'm using pin 25 for CE (instead of 22). My test program reads lines of text and sends them. These lines contain only 4 characters that can be either 0 or 1. Upon receipt of a message, the arduino will enable / disable 4 relays based in those 4 characters. Here's the code for reference:
And this is the output I get from this test program using the "npm install" version of the library:
Please note that even though the program prints "Sent KO", meaning the transmission failed, it's actually received on the other end and the relays are updated successfully. Using git version I get the error messages right after entering the first message and the message is not received. I tried using node-red node for rf24, based on this library, and I get the same problem: first message works, further messages enter an infinite loop of errors, freezing the node-red instance until I kill the process. Is there anything else I could do to help debug this? |
I will try to use your code to test it. To have addtional trace on the init of the radio you can:
On the other hand: Did you compile and install the RF24 Library with the script in this repo? Have you reboot after installing the lib in SPIDEV mode? The library for node-red will fail if this fails. So is better to isolate the problem the use it in node-red. |
The "npm install" version of the library doesn't seem to support a second parameter in the .config() call. This is the result running it with git master:
1000 is the string I'm trying to send (enable first relay, disable the other three). As you can see, it's just 4 characters. I did install the RF24 when prompted by the install script from this project, yes.
Running these test programs as root doesn't make any difference. And I know SPIDEV is enabled because I have /dev/spidev* files that weren't there before:
Also, the C++ version of this test program works flawlessly on the same machine. That's why I think the hardware / linux kernel config setup is fine. |
And just for reference, this is the C++ version of the program and it's output. The program:
Output:
|
thx, I will try to reproduce this. |
Hi, I'm using very similar configuration: I can't figure why it fails on your setup. The main difference of the cpp code and the js code is that that in the library perform several actions during begin & configure (in fact it mask irq and also startlisteing for short period) but for transmitting it uses a simple Write call to the library. Nothing special. Read this nRF24/RF24#205 about similar problems with the library. The problem you are having is due to timeout waiting for the status after write to the radio. The radio is not responding as expected. You can try several things:
|
Thanks! That post was very helpful when I had wiring issues (I connected the CE and CSS pins backwards initially), but that's something I fixed before I wrote my own test program. Hardware modifications to fix a software issue are not acceptable (besides, adding a capacitor between GND-VCC results in lots of packets lost in my experience). Nor is changing the operating system. I'll have to either fix it myself or write my own wrapper around the C++ library. Whatever turns out to be faster to do. |
Ok. If you find the source of the problem PR are welcome. I suspect that the key would be in the config method as it try to reset the radio.maybe commenting the all the lines but stopListening in _resetState() method inside rf24_setup.cpp. Cap is not a HW solution for a software problem. Capacitor are not needed if your supply is good at reacting to variable loads. With NRF24L01 radios currents spikes are typical during transmission of each packet if the power line can't cope with this spikes the radio can fail (this spikes are worst in clones). This happens also when the radio changes from tx to rx. In principle rpi3.3v pins should be sufficient but there are reports where not. So capacitors needed to solve a hw problem. Software can have as they can treat stress the hw. |
This an old issue but just a question. |
First write works fine and is received at the other end. But any write after that blocks forever in an infinite loop of "RF24 HARDWARE FAIL: Radio not responding, verify pin connections, wiring, etc." error messages.
This happens with my own test program in js, with test/test_RF24.js (when invoked with parameter "1") and also when used from NodeRed.
The C++ test program from the RF24 library works fine using the exact same version of the C++ lib running in the same hardware. And so does the C++ version of my test program. They can send as many transfers as needed with no error.
I'm using a RaspberryPi3 running raspbian, kernel 4.4.38-v7+ and using SPIDEV.
The text was updated successfully, but these errors were encountered: