RFM69NEW library [SOLVED]

Started by K1JOS, October 30, 2014, 11:29:41 PM

K1JOS

John or Felix,

I am trying to get your library from last year -  RFM69NEW - up working and hope you can advise.  I installed the files in a sub folder called RFM69NEW in my Arduino IDE library folder - same folder where Felix's RFM69 subfolder sits with all the other libraries.  I added the Library to the IDE and then opened you example but when I compile I get the following error:

In file included from C:\Program Files\Arduino105\libraries\RFM69\RFM69NEW.cpp:12:
C:\Program Files\Arduino105\libraries\RFM69/RFM69NEW.h:21: error: 'SPI_CS' was not declared in this scope

Any help would be very much appreciated.

Felix

Let's keep topics separated, sticky topics are special because of their content.
You should not add another RFM69 library clone to your Arduino/Libraries folder, this is a common pitfall. If you need to replace it, remove/move the old version and only keep 1 RFM69 library in Arduino/libraries, otherwise you will get compile errors.
I'm not really sure what RFM69New library you are referring to, can you give more detail?

K1JOS

Hi Felix,

I posted in in the thread on Temperature and Frequency correction started by John K2OX and my question was about his add on to your library that provide the routines to do these corrections.  Putting my question here is likely to confuse or be ignored more.  But maybe you have some advice on my question :-)




K1JOS


Felix

Ok I think i remember now, John probably shared some files that he wrote for himself and he might have called it RFM69New. One issue with integrating such code is that the polynomial he came up with for the temp correction is tuned for a certain frequency band and the response curve will show a different characteristic for a different band. The frequency drift is a lot more dramatic at higher frequencies. I'm not even sure if this was for 433/915mhz without reading through the entire thread..

K1JOS

I would like to use this freq correction as my Gateway is indoors while my node/remote will be outdoors a few hundred feet away and through wall structures.  My application is an 'on-demand' so I turn on the Gateway and node for only a few hours each day.  During our New England winters it will be working for weeks to months at freezing and below freezing temps.   Since outdoor winter temps don't swing too wildly too quickly, I thought to read the outdoor remote NODE RFM69 chip temp, Freq and FEI at power-up and adjust the Gateway frequency rather than the node.  After reading Johns various comments, I have been reading through the HOPERF RFM69 documentation and if I understand correctly, to measure FEI at the node, the Gateway needs to be sending some packet data continuously as the FEI measurement requires the node to receive a "Preamble-modulated input signal".  Jophn said he used a CW signal generator but that puzzles me as it would not be able to provide this digital "preamble".

I am trying to see how this works by using your struct_send and struct_receive RF69 examples.  I only have add to the struct_receive the following in the loop:

// adding Freq and FEI
    
    if (input == 'q') // get Freq
    {
      unsigned long frf = 0x10000UL * radio.readReg(REG_FRFMSB);
      frf += 0x100UL * radio.readReg(REG_FRFMID);
      frf += radio.readReg(REG_FRFLSB);
      unsigned long freq = frf * FSTEP;
      Serial.print("Frf Registers = 0x");
      Serial.println(freq,HEX);
      Serial.print("Radio Freq is ");
      Serial.println(freq);
    }  
    
    if (input == 'f') // Get FEI
    {
     //Start FEI measurement by setting bit 7 high on reg 0x1E (RegAfcFei)
      radio.writeReg(REG_AFCFEI,RF_AFCFEI_FEI_START);
   
     //do nothing while measurement taken  - Register 6 (0-7) bit = 1 (TRUE) when DONE
      while ((!radio.readReg(REG_AFCFEI) & RF_AFCFEI_FEI_DONE)); // stay in loop while bit6 = zero
  
      //get LSB and MSB of FEI
      unsigned long fei_msb = radio.readReg(REG_FEIMSB);
      unsigned long fei_lsb = radio.readReg(REG_FEILSB);
      Serial.print("FEI MSB, FEI LSB =");
      Serial.print(fei_msb); Serial.print(", ");Serial.println (fei_msb);
      fei = ( ((fei_msb * 0x10000UL)) + fei_lsb) * FSTEP;
      Serial.println(fei);
      
    } 

For testing I  have the gateway and Node indoors on my workbench at same temperatures.  I find that FEI MSB and LSB are very variable but always identical , eg MSB always equals LSB which I find an odd coincidence.  MSB and LSB ranges from any random number from 0 to 255.

Any advice would be appreciated.



Felix

My only other thought would be that I've not had a need to do temp correction. I have my mailbox notifier out there in bitter cold and it just works day in day out. If you do this out of precaution you may discover its not really necessary after all. I would start with the easy path and add complexity if it's really needed.

K1JOS

whats your typical February temperatures?  I like to keep it as simple as possible, although I love learning how things work and digging into the RFM69 registers is kind of fun except when I dont understand some of the results :-)

Felix

Well its starting to get cold now. But last winter it was the worst winter in decades here in MI. It was below freezing for months and nights were regularly -20 F.