Author Topic: RFM69HW range test!  (Read 51329 times)

Drae

  • Newbie
  • *
  • Posts: 3
RFM69HW range test!
« on: September 03, 2013, 02:36:17 PM »
I finally got these modules soldered, debugged and running in a project as well as the old RFM12B's I was using, and finally managed to perform the same range test with the existing modules.

The results are impressive, ~540 meters range @38400kbps with lots of trees and one or two buildings inbetween. ;p

I could likely manage more range at a lower bitrate and different sensitivity sessions, but the ~4ms send time is quite important for the network design of the current project.

Thanks for taking the time to release the RFM69  library code Felix, it's been very helpful!

Here's a map I threw together plotted from various points when the signal dropped off. I sadly don't have anywhere nearby that has >700 meters of direct uninterrupted line of sight, but the local park was a good test of range with obstacles and people (trees)


« Last Edit: March 10, 2014, 12:42:12 PM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5385
  • Country: us
    • LowPowerLab
Re: RFM69HW range test!
« Reply #1 on: September 03, 2013, 06:54:13 PM »
Nice, thanks for sharing and for taking the time to walk out there and put this together.
I've done a few park tests and it's quite time consuming. I ran out of space at around 350m in open air with no obstacles, the signal still around 85dBm. At 540m with obstacles that is still very good.

Another user reported getting a 1.5 mile range at 1200baud! See his post here.

hneiraf

  • Newbie
  • *
  • Posts: 16
Re: RFM69HW range test!
« Reply #2 on: October 11, 2013, 08:06:49 AM »
Very nice!

I'm doing the same kind of test with some RFM69W radios.
Can you share with us your RFM69 library Config?

REG_BITRATEMSB
REG_BITRATELSB
REG_FDEVMSB
REG_FDEVLSB
RF_RXBW_MANT_
RF_RXBW_EXP_
RF_PACKET2_RXRESTARTDELAY_

I want to do some test with 38.4kbps but I'm afraid I don't have the right configuration.

Thank you in advance!

HN

anthonywebb

  • Newbie
  • *
  • Posts: 10
Re: RFM69HW range test!
« Reply #3 on: October 11, 2013, 06:30:59 PM »
I would be interested in this config as well.  Moteinos will soon be on the way and I would like to really make them sing.  The details findings would make a good blogpost for people really wanting to push some distance out of their hardware.

Drae

  • Newbie
  • *
  • Posts: 3
Re: RFM69HW range test!
« Reply #4 on: October 12, 2013, 04:12:26 AM »
Funnily enough, the settings are mostly all default; I haven't yet played with them to see which ones give more range (Until I finish some handheld units for indoor use over multiple floors)

I'm sure a few more meters range could be gotten with someone who understands how all these settings affect signal reception.

Also, as a disclaimer I have modified a good few parts of the library for my project (and use external logic for managing packet queues/acks), here are some which adds overhead for me, and may affect the amount of packets and range you'll manage at smaller packetsizez/slightly faster responses:
  • acks and retries are done in a method closer to how TCP/IP works
  • packet queueing system for fixed-window broadcast slices, requiring timesync between nodes (anti-collision method for 8+ nodes transmitting 4-5 rangefinding packets per second)
  • receiveDone() overridden to grab & process packet RSSI for distance averaging and calculation between nodes (adds time taken to process each packet)
  • packet structure modified to a fixed 13 byte format (<source>, <dest>, <8bytes command-dependent code>, <rf69 hardware crc>)

Anyhoo, here's the current settings:
Transmitting at 869.xmhz (haven't specifically checked which . yet)

REG_BITRATEMSB  0x3
REG_BITRATELSB   0x41

REG_FDEVMSB 0x03 (50k, can't recall why I set it away from the default 5k)
REG_FDEVLSB  0x33

RF_RXBW_MANT_
RF_RXBW_EXP_ - 
RF_RXBW_DCCFREQ_010 | RF_RXBW_MANT_16 | RF_RXBW_EXP_2


RF_PACKET2_RXRESTARTDELAY_
REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_2BITS | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF

EDIT: Full list here! http://draelen.co.uk/g/rgm69regs.txt
« Last Edit: October 12, 2013, 04:26:04 AM by Drae »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5385
  • Country: us
    • LowPowerLab
Re: RFM69HW range test!
« Reply #5 on: October 12, 2013, 09:15:04 AM »
Thanks all for continuing this discussion, all good stuff.
I'll include the reg list here if you don't mind, just in case the file goes away on Drae's server.

By the way, if someone has nice results or wants to share another driver (maybe Drae with the TCP/IP-ish approach?) and is willing to do a writeup, I would be more than happy to post it on the blog.

Code: [Select]
  const byte CONFIG[][2] =
  {
    /* 0x01 */ { REG_OPMODE, RF_OPMODE_SEQUENCER_ON | RF_OPMODE_LISTEN_OFF | RF_OPMODE_STANDBY },
    /* 0x02 */ { REG_DATAMODUL, RF_DATAMODUL_DATAMODE_PACKET | RF_DATAMODUL_MODULATIONTYPE_FSK | RF_DATAMODUL_MODULATIONSHAPING_00 }, //gaussian, bt=1.0
    /* 0x03 */ { REG_BITRATEMSB, RF_BITRATEMSB_38400}, //default:4.8 KBPS
    /* 0x04 */ { REG_BITRATELSB, RF_BITRATELSB_38400},
    /* 0x05 */ { REG_FDEVMSB, RF_FDEVMSB_50000}, //default:5khz, (FDEV + BitRate/2 <= 500Khz)
    /* 0x06 */ { REG_FDEVLSB, RF_FDEVLSB_50000},

    /* 0x07 */ { REG_FRFMSB, (freqBand==RF69_315MHZ ? RF_FRFMSB_315 : (freqBand==RF69_433MHZ ? RF_FRFMSB_433 : (freqBand==RF69_868MHZ ? RF_FRFMSB_869 : RF_FRFMSB_915))) },
    /* 0x08 */ { REG_FRFMID, (freqBand==RF69_315MHZ ? RF_FRFMID_315 : (freqBand==RF69_433MHZ ? RF_FRFMID_433 : (freqBand==RF69_868MHZ ? RF_FRFMID_869 : RF_FRFMID_915))) },
    /* 0x09 */ { REG_FRFLSB, (freqBand==RF69_315MHZ ? RF_FRFLSB_315 : (freqBand==RF69_433MHZ ? RF_FRFLSB_433 : (freqBand==RF69_868MHZ ? RF_FRFLSB_869 : RF_FRFLSB_915))) },
   
    // looks like PA1 and PA2 are not implemented on RFM69W, hence the max output power is 13dBm
    // +17dBm and +20dBm are possible on RFM69HW
    // +13dBm formula: Pout=-18+OutputPower (with PA0 or PA1**)
    // +17dBm formula: Pout=-14+OutputPower (with PA1 and PA2)**
    // +20dBm formula: Pout=-11+OutputPower (with PA1 and PA2)** and high power PA settings (section 3.3.7 in datasheet)
    ///* 0x11 */ { REG_PALEVEL, RF_PALEVEL_PA0_ON | RF_PALEVEL_PA1_OFF | RF_PALEVEL_PA2_OFF | RF_PALEVEL_OUTPUTPOWER_11111},
    ///* 0x13 */ { REG_OCP, RF_OCP_ON | RF_OCP_TRIM_95 },       //over current protection (default is 95mA)
   
    // RXBW defaults are {RF_RXBW_DCCFREQ_010 | RF_RXBW_MANT_24 | RF_RXBW_EXP_5} (RxBw: 10.4khz)
    /* 0x19 */ { REG_RXBW, RF_RXBW_DCCFREQ_010 | RF_RXBW_MANT_16 | RF_RXBW_EXP_2 }, //(BitRate < 2 * RxBw)
    /* 0x25 */ { REG_DIOMAPPING1, RF_DIOMAPPING1_DIO0_01 },     //DIO0 is the only IRQ we're using
    /* 0x29 */ { REG_RSSITHRESH, 220 },                         //must be set to dBm = (-Sensitivity / 2) - default is 0xE4=228 so -114dBm
    ///* 0x2d */ { REG_PREAMBLELSB, RF_PREAMBLESIZE_LSB_VALUE } // default 3 preamble bytes 0xAAAAAA
    /* 0x2e */ { REG_SYNCCONFIG, RF_SYNC_ON | RF_SYNC_FIFOFILL_AUTO | RF_SYNC_SIZE_2 | RF_SYNC_TOL_0 },
    /* 0x2f */ { REG_SYNCVALUE1, 0x2D },                        //attempt to make this compatible with sync1 byte of RFM12B lib
    /* 0x30 */ { REG_SYNCVALUE2, networkID },                   //NETWORK ID
    /* 0x37 */ { REG_PACKETCONFIG1, RF_PACKET1_FORMAT_FIXED | RF_PACKET1_DCFREE_OFF | RF_PACKET1_CRC_ON | RF_PACKET1_CRCAUTOCLEAR_ON | RF_PACKET1_ADRSFILTERING_OFF },
    /* 0x38 */ { REG_PAYLOADLENGTH, MAX_DATA_LEN },             //in variable length mode: the max frame size, not used in TX
    //* 0x39 */ { REG_NODEADRS, nodeID },                       //turned off because we're not using address filtering
    /* 0x3C */ { REG_FIFOTHRESH, RF_FIFOTHRESH_TXSTART_FIFONOTEMPTY | RF_FIFOTHRESH_VALUE }, //TX on FIFO not empty
    /* 0x3d */ { REG_PACKETCONFIG2, RF_PACKET2_RXRESTARTDELAY_2BITS | RF_PACKET2_AUTORXRESTART_ON | RF_PACKET2_AES_OFF }, //RXRESTARTDELAY must match transmitter PA ramp-down time (bitrate dependent)
    /* 0x6F */ { REG_TESTDAGC, RF_DAGC_CONTINUOUS },            // run DAGC continuously in RX mode
    {255, 0}
  };

john k2ox

  • Full Member
  • ***
  • Posts: 110
Re: RFM69HW range test!
« Reply #6 on: October 12, 2013, 02:55:04 PM »
This one's free.

Set reg 0x58 to 0x2D

It increases the sensitivity by 2-3db by enabling the low noise pre-amp.

Good for more distance!

englund

  • Newbie
  • *
  • Posts: 30
Re: RFM69HW range test!
« Reply #7 on: October 15, 2013, 08:26:00 AM »
Nice john! Will you merge this into the library Felix?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5385
  • Country: us
    • LowPowerLab
Re: RFM69HW range test!
« Reply #8 on: October 15, 2013, 10:26:10 PM »
The datasheet mentions this. I will give it a try and probably merge it on github when I get some time to test it. Thanks!

john k2ox

  • Full Member
  • ***
  • Posts: 110
Re: RFM69HW range test!
« Reply #9 on: October 16, 2013, 09:45:33 AM »
You need to be careful using it.  The idea is that if the signal is weak it adds a couple db of sensitivity.  Good for long distance.

On the other hand it should not be used when they are close together.  The rx will overload at least 10db lower than with it off.

BTW, that's why it isn't 'on' all the time.  It adds 2 db to the bottom end and takes off 10 db at the top.  That means the 'dynamic range' has  been reduced by 8 db.
Just like the saying goes, you don't get something for nothing.

If you plan to use radio in a non fixed location application (i.e. remote controlled lawn mower) you would probably want to turn the pre amp on when
the RSSI is less than -70dbm and off when above -40dbm.

jbeale

  • Jr. Member
  • **
  • Posts: 62
Re: RFM69HW range test!
« Reply #10 on: October 16, 2013, 03:15:26 PM »
I gather the Tx power is settable? At expense of some code complexity, you could imagine a Tx-Rx handshake where the Tx side adjusts its power up or down depending on either its own RSSI from the Rx's ACK, or the Rx side's observed RSSI reported back to Tx as a data field in the ACK. The result is you reduce the total dynamic range the receiver needs to handle. I think something like that is done in cellphone networks.  If the preamp gain is only 2 dB in SNR, maybe that is not a dramatic help in range, but might help your Tx side battery life if you don't transmit with more power than needed.
« Last Edit: October 16, 2013, 03:29:24 PM by jbeale »

pko

  • Newbie
  • *
  • Posts: 12
Re: RFM69HW range test!
« Reply #11 on: October 17, 2013, 12:48:11 AM »
dB is not a linear scale.  It is a logarithmic unit.  So from memory back in the old uni student day, 2 dB is actually a significant increase.  John will be in a better position to tell us how it translate to real world distance improvement.  Have to find my old textbook and refresh my knowledge in this area.

jbeale

  • Jr. Member
  • **
  • Posts: 62
Re: RFM69HW range test!
« Reply #12 on: October 17, 2013, 10:16:04 AM »
+3 dB is a doubling in power. However a doubling in effective range requires 4x the power (+6 dB), because the radio strength falls off as 1/r^2 where r is distance between Tx and Rx. Put another way, if power goes up by x, range goes up by square root of x.  So improving your signal 2 dB means it is 10^(2/10) or 1.58x stronger,  which means a range increase of sqrt(1.58) = 1.26 so your range goes up by 26%, which maybe useful but not a huge amount.

Adjusting the elevation, orientation, and geometry of your Tx and Rx antennas can change your total signal budget by much more than 2 dB, so that's the most important thing to optimize, if at all possible.

Another point of reference, the difference in Tx power between RFM69W and -HW is 7 dB or 5x, while the receive sensitivity is the same (-120 dBm @ 1.2 kbps). So in theory a pair of -HW modules should have 2.2x greater range than a pair of the -W modules, other things being equal. 

The older RFM12B has only +5 dBm output and the receive sensitivity is also 10 dB worse (-110 dBm @ 1.2 kbps) so a pair of RFM12B modules has 18 dB less link budget than RFM69W, that is quite a bit, only 12.6% of the range of the RFM69W if those numbers are right.

RFM12B:   +5 dBm output (3.1 mW)  (into 50 ohm load, at 915 MHz)
RFM69W:  up to +13 dBm output (20 mW)  settable -18 to +13 dBm
RFM69HW: up to +20 dBm output (100 mW) settable -18 to +20 dBm

http://www.hoperf.com/upload/rf/RFM12B.pdf
http://www.hoperf.com/rf/module/fsk/RFM69W.htm
http://www.hoperf.com/rf/module/fsk/RFM69HW.htm
http://www.hoperf.com/upload/rf/RFM69HW-V1.1.pdf

With mile-plus range into a dipole antenna at +20 dBm, it's worth thinking about using the variable output power of the RFM69 modules to reduce range to cover just what's needed. For example, if you're just working inside your house, no point in covering that size of a neighborhood (pi.r^2 => 3 square miles) with RF noise.
« Last Edit: October 17, 2013, 03:36:23 PM by jbeale »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5385
  • Country: us
    • LowPowerLab
Re: RFM69HW range test!
« Reply #13 on: October 17, 2013, 09:34:14 PM »
Many thanks jbeale for explaining this so plainly, yet detailed and easy to understand.

Cabe

  • Newbie
  • *
  • Posts: 15
Re: RFM69HW range test!
« Reply #14 on: November 04, 2013, 11:05:53 AM »
Excellent work all round I say.

It also introduced me to Moteino, my projects will be pleased  ::)
« Last Edit: January 04, 2014, 11:40:31 AM by Felix »