Open sheinz opened 4 years ago
Hi, you can try
rfm.setFrequency(868UL*1000*1000); // set the frequency
Hi Pablo, I tried with no difference. I also tried setting frequency registers directly (without conversion):
// rfm.setFrf(0x4EC000); // 315MHz - works
// rfm.setFrf(0x6C8000); // 434MHz - works
// rfm.setFrf(0xE4C000); // 915MHz - doesn't work
// rfm.setFrf(0xd90000); // 868MHz - doesn't work
Is your CPU little endian?
It is Arduino Pro mini, ATmega328p 16MHz, 3.3v. The Internet says it is little endian.
Hmm, that is weird - I'm also using ATmega328p, RFM69@868MHz with no problem...
Setting baud rate for RFM69 module other than 4800 (which is default) fixed the problem.
// rfm.baud4800(); // doesn't work with 868MHz
// rfm.baud9600(); // works with 868MHz but with high packet loss
// rfm.baud153600(); // works with 868Mhz with no packet loss
rfm.baud300000(); // works with 868MHz with no packet loss
153600 and 300000 works reliably with 868MHz modules.
Hmm, I can definitely see setFrequency
failing, the signature is:
void setFrequency(uint32_t freq);
So any value about 32 bits will get truncated. I developed this library against the 315 or 434 MHz version... clearly. Does an arduino support uint64_t
s? Because if so we should probably just change the type, that should solve the issue? If anyone can test this and file a PR that'd be much appreciated, I don't have access to this hardware anymore.
@Pablo2048 , are you sure you are setting the frequency with setFrequency
on your 868 MHz unit? Because the default values for the register should be good on each unit, but setting them should cause problems :)
The setFrf
function should always work if the endianness of the cpu is right. It just copies the 3 relevant bytes from the input.
Setting baud rate for RFM69 module other than 4800 (which is default) fixed the problem.
Cool! Could have had something to do with needing a higher Fdev
or something at these higher frequencies. The carrier is now probably set by the default value in the register, which should be fine in general.
Ehm, sorry for confusing - I take a look into my code and i'm not calling setFrequency
...
Hi,
I've filed #13 , I cannot test this unfortunately. @Pablo2048 , @sheinz if you have time, could you give that branch a spin and see if that allows you to make a call to setFrequency
with a high number and end up with working communication?
Thanks!
Hi, I have RFM69CW 868MHz modules. Trying them with unchanged "MinimalInterruptUno" example works fine. But after changing frequency to 868MHz the example stops working.
Any help is much appreciated.