-
Notifications
You must be signed in to change notification settings - Fork 395
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
nRF52840 with RFM69 errors #162
Comments
Only for those who use the issue templates and/or read the wiki :P See https://github.com/jgromes/RadioLib/wiki/Debug-mode -16 is SPI write fail - real value of some SPI register after writing doesn't match the expected one. Enable debugging mode (both debug and verbose level), and it will show all the details in Serial monitor, post the output here. |
Thanks Jan, Here's the output: [RF69] Initializing ... Found RF69! (match by RF69_REG_VERSION == 0x24) address: 0x7 address: 0x8 failed, code -16 |
It looks like the module refuses SPI writes to RF69_REG_FRF_MSB and RF69_REG_FRF_MID. I've seen this on a couple RFM69 modules before, when I tried to set frequency other than 915 MHz. It looks like some RFM69 modules are "locked" into a particular frequency value (0xe4c000, which corresponds to 915 MHz). Try setting the frequency in begin() method to 915 MHz. That will bypass the error, though you won't be able to change the frequency of that module. |
Hi Jan radio.begin(915); and the error messages goes away. thanks for your help |
Weird. I've just found the exact same issue on the 433MHz version of this Adafruit module. I was getting the very same error when setting frequency other than 915MHz (yes, 915, no 433).
Output:
There has to be something else, because I'm able to use this 433 module with RadioHead. I double checked with a 915 (green dot on the package) and 433 (red dot on the package) module and I get the same behavior from RadioLib. |
@phretor can you independently verify the RadioHead code actually transmits at 433 MHz (e.g. with an SDR)? RadioHead doesn't verify SPI writes, so if it failed the same way, the module would still be at 915 MHz, you just wouldn't know. |
Please hold on; I'm working on a more thorough test. |
I confirm the bug is not there for the 433 module I was testing. Was a glitch in the connections. |
So the module is transmitting at 433 MHz with RadioHead and returning SPI fails with RadioLib? Or is it working correctly with both? |
It’s working correctly with both.
…________________________________
From: Jan Gromeš <notifications@github.com>
Sent: Tuesday, July 14, 2020 6:29:45 PM
To: jgromes/RadioLib <RadioLib@noreply.github.com>
Cc: Federico Maggi <federico.maggi@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [jgromes/RadioLib] nRF52840 with RFM69 errors (#162)
So the module is transmitting at 433 MHz with RadioHead and returning SPI fails with RadioLib? Or is it working correctly with both?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#162 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AABPCNHEBS3AFRCY6T4W7EDR3SBXTANCNFSM4OS47TBQ>.
|
OK, thanks - so I guess some of the modules really are "locked" into 915 MHz. |
Oh yes.
…________________________________
From: Jan Gromeš <notifications@github.com>
Sent: Tuesday, July 14, 2020 6:46:57 PM
To: jgromes/RadioLib <RadioLib@noreply.github.com>
Cc: Federico Maggi <federico.maggi@gmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [jgromes/RadioLib] nRF52840 with RFM69 errors (#162)
OK, thanks - so I guess some of the modules really are "locked" into 915 MHz.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#162 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AABPCNCVPHV77RYOR4KNV4TR3SDYDANCNFSM4OS47TBQ>.
|
Hi, I'm having 2 Adafruit Feather 32u4 with RFM69. Both are 433 MHz versions and transmitting just fine with RadioHead Library in 433 MHz, I have checked with SDR, but I put 433 MHz in RadioLib it's showing error -16. When I put 915, the error goes away but the module is neither transmitting in 433 nor 915, again I've confirmed with SDR, but it's showing "successfully transmitted" in serial port... The board is having Red dot on it which means it is a 433 MHz module. Here is the details when I set in 433 MHz. address: 0x8 failed, code -16 |
This issue is popping up way too often to be just coincidence - maybe it's the verification mechanism itself that's causing the problem (though I'm not sure why or how). @rifath-shaarook could you try if using just a simple register write will resolve this? Go to RadioLib/src/modules/RF69/RF69.cpp and change lines 385 - 389 from int16_t state = _mod->SPIsetRegValue(RF69_REG_FRF_MSB, (FRF & 0xFF0000) >> 16, 7, 0);
state |= _mod->SPIsetRegValue(RF69_REG_FRF_MID, (FRF & 0x00FF00) >> 8, 7, 0);
state |= _mod->SPIsetRegValue(RF69_REG_FRF_LSB, FRF & 0x0000FF, 7, 0);
return(state); to _mod->SPIwriteRegister(RF69_REG_FRF_MSB, (FRF & 0xFF0000) >> 16);
_mod->SPIsetRegValue(RF69_REG_FRF_MID, (FRF & 0x00FF00) >> 8);
_mod->SPIsetRegValue(RF69_REG_FRF_LSB, FRF & 0x0000FF);
return(ERR_NONE); |
Thank you so much... It just worked like a charm and transmitting at the correct frequency... i.e. 433 Mhz |
It indeed looks like some RF69 modules just don't like the RF frequency registers being read. As far as I can tell, the datasheet mentions nothing about this. Usually I would be hesitant about disabling a safety feature, but in this particular case I'm more than happy to make an exception - this issue was reported a couple of times already. |
Setup:
Feather nRF52840 Express
FeatherWing RFM69HCW 900MHz
RadioLib 3.7.0
Arduino 1.8.12
I trying to get the example RF69_Transmit.ino to run and I get the following error message:
"[RF69] Initializing ... failed, code -16"
The RFM69HCW wiring is as per Adafruit's guide (CS = 5, IRQ = 10, RST = 6) and has been visually checked and continutity checked. Code has been modified as follows:
RF69 rf = new Module(5, 10, 6);
Any suggestions for what could be wrong?
Are there any options to enable further debugging?
Tony
The text was updated successfully, but these errors were encountered: