LowPowerLab Forum

Hardware support => General topics => Topic started by: BigTaro on September 03, 2015, 06:24:56 AM

Title: Issue with LoRa long range modes and RFM95/RFM96
Post by: BigTaro on September 03, 2015, 06:24:56 AM
Hi,

I am using two Moteino Megas with the RFM95 boards (came with RF96 chips).  I have gotten communication at 915mhz up to around 300 feet (at 13dBm, the cutoff is where RSSI becomes around 91 and drops) with Bw125Cr45Sf128 mode, but it doesn't seem to work on any of the other modes with the reliable datagram demo.  Does anyone have any tips on getting the long range modes working? I am really interested in Bw125Cr48Sf4096.

Thanks!
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Felix on September 03, 2015, 09:41:24 AM
Hi BigTaro,

Please note that RFM96 is a packaging marking. These are actually "RFM95" radios, they are marked as such on the bottom and are the 915mhz variant of the LoRa range of radios from HopeRF. All of RFM95-98 chips have this "RFM96" marking, it's the same silicon chip inside, just the radio network matching on the PCB is tuned to different frequencies.

For the moment RadioHead is the library that is recommended since I have no better alternative. It's a relatively new product, and LoRa is a different technology than FSK and RFM69. I cannot really speak for RadioHead range other than that it works with the defaults for testing purposes. I would point you to RadioHead support/forums (if any) at the moment. I hope to be able to improve on this in the near future, not meaning to just delegate here, it's just that I don't have a proprietary library for these myself yet and am not very knowledgeable with RadioHead. For now the hardware is provided by LowPowerLab because of demand, and the recommended library is RadioHead at the moment.
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: WhiteHare on December 01, 2015, 06:52:25 AM
@BigTaro,

Were you able to improve on your range at all?  I just received my Moteino LR's and now have them ping-ponging back and forth using the Client and Server examples that Felix provided.  I look forward to doing some meaningful range testing soon.  I haven't yet dug into the code at all yet, but I suppose one obvious thing to try is to boost the Tx power from the default 13Dbm up to 20dbm.  If you do that, then the datasheet says you need to provide at least 2.4v to the radio.
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: lie on December 08, 2015, 06:10:25 AM
I gave it a quick go around my home which is mostly single / double story suburban houses.  I was able to get around 1-1.5 km with default settings from the RadioHead lib.  I did increased the Tx power to 20.  My understanding is that the range you can reach really depends on the environment you are in.  Anecdotally, I found that if I was on relatively level ground to my house where the server was, the signal was pretty consistent and I was getting reliable signals up to 1.5+ Km.  However, if I was at the bottom of a hill then the signal is pretty bad.  In some places, less than 1KM.  Note: this is from a quick try and I didn't record any signal strength measurements.   
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: WhiteHare on December 23, 2015, 08:26:25 PM
I tried out the Bw125Cr48Sf4096 settings in combination with cranking the Tx power up to 80mw.  For some reason the example client/server code only half-way worked:  the client would transmit a packet to the server just fine, but it wouldn't receive back the packet the server sent in response.  As a check, I reversed which moteino was client and which was server, but the same result.  At the moment, I'm not sure what's up with that.  Anyhow, I planted the client in a second story window and walked around with the server.  Doing that I got about 1000+ feet reception radius around the house before it  got iffy.  I'm in a hilly area, and I'm sure that was a factor in limiting the range.
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Felix on December 23, 2015, 08:52:21 PM
:) ... Anyone interested in writing a library for LoRa?
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: WhiteHare on December 24, 2015, 07:28:12 PM
Yes, that would be nice.    :)  For instance, it would be nice to have wireless programming working.  Is there any reason to think that a straightforward port  of the RFM69 OTA wireless programming code to the RFM95 platform wouldn't work?

BTW, I also just tried out the Bw31_25Cr48Sf512 setting, also at 80mw.  I found it had roughly comparable range (maybe slightly better) than the Bw125Cr48Sf4096 configuration.

Anyhow, I'm curious what it might take to double the range of what I'm currently getting (which is already pretty good, but double the range would be fantastic).
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: WhiteHare on December 27, 2015, 01:06:25 PM
I found a handy "LoRa Modem Calculator Tool" on the Semtech website.  Using that, it looks as though increasing the spreading factor will yield a much higher link budget, so I'll try to configure the LoRa module for that and then test to see if I in fact do get the predicted improvement.
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Felix on December 28, 2015, 08:57:04 AM
Quote from: WhiteHare on December 24, 2015, 07:28:12 PM
Anyhow, I'm curious what it might take to double the range of what I'm currently getting (which is already pretty good, but double the range would be fantastic).
Just a few that come to mind:

Antenna gain and polarization
Output gain
Elevation
Bitrate
Bandwidth
Spreading factor
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: ryanrs on September 09, 2016, 07:24:08 PM
The answer, 1 year late: turn on LowDataRateOptimize, bit 0x04 in register 0x26, when the symbol length exceeds 16ms. Here are the settings I used on my Adafruit Feather M0 with 900MHz RFM95 radio:

put this just after you call init():

RH_RF95::ModemConfig modem_config = {
  0x78, // Reg 0x1D: BW=125kHz, Coding=4/8, Header=explicit
  0xc4, // Reg 0x1E: Spread=4096chips/symbol, CRC=enable
  0x0c  // Reg 0x26: LowDataRate=On, Agc=On
};
rf95.setModemRegisters(&modem_config);

This seems to work, with longer range than than the default settings. With a 3 inch wire for an antenna, I am seeing range on the order of thousands of feet, vs just a couple hundred feet with the default settings. But I just got it working today, so there is still much to experiment with.

I'm just dropping this note here for the benefit of other search engine visitors. Once I get my radios running well, I'll see about merging the changes into the RadioHead library.
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Felix on September 12, 2016, 08:46:55 AM
@ryanrs, thanks for sharing!
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Russ Hedger on September 12, 2016, 05:53:17 PM
I have just managed to get a pair of rfm95w modules to talk to each other using the Radiohead libraries on Arduinos. I used the modem config suggested by ryanrs and get good range:

1/4 wavelength wire antennas.
Rural setting with gently rolling fields so even without buildings and trees, there is no direct LOS. However, there is woodland, hedges and buildings obstructing the LOS.
Good connection at 800m - beyond that, the road goes down into a valley and I lose the signal.
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Russ Hedger on November 26, 2016, 07:15:51 PM
I have had some time to experiment further. This is part of a home automation project - most of the sensors are inside or close to the house, the furthest is in a garage about 120m from the house with a few brick houses blocking the line-of-sight. When using ryanrs's custom register settings for my LoRa hub, I get worse figures for packet RSSI on all sensors. Looking at the SX1276 datasheet (which is much clearer and complete than the RFM95W datasheet), the LNA is set to maximum gain by default, and activating AGC as per ryanr's settings may reduce gain, which I suspect is causing the lower RSSI. I am using 125 kHz bandwidth as the crystal on the RFM95W is reported to have too much drift to be reliable below this. I haven't needed to increase the spread factor over the default of 2^7, so the symbol length is not even close to 16ms - I tried turning on LowDataRateOptimize, but it made no difference for me. Basically, the default settings work fine for me, and turning on AGC makes things worse.

By far the biggest effect is the antenna. For the indoor sensors, which I have tried to keep compact, I used normal mode helical antennas according to this specification: https://github.com/OpenHR20/OpenHR20/wiki/2.1)--433-MHz-and-868-MHz--Antenna-Design-Examples (https://github.com/OpenHR20/OpenHR20/wiki/2.1)--433-MHz-and-868-MHz--Antenna-Design-Examples). They are good enough in the house and 20 m away in the garden, but drop 20 dB RSSI compared with a basic quarter wave antenna without a ground plane. A helical antenna gave a very unreliable connection for the garage sensor, but a quarter wave is rock solid.

Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Felix on November 27, 2016, 09:56:44 PM
@Hugh, thanks for your valuable input!
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: ziplockk on December 09, 2016, 03:35:59 PM
Drive test using @ryanrs settings, much better than default settings. Each pin has the RSSI as the name.

https://drive.google.com/open?id=12vI3PnjeG13AG1kmrALuhNTNDzw&usp=sharing

The green pin is the static radio, inside a house. The moving radio was inside a car. Neither were in anything like optimal positions.

Pretty good and some other testing I've done shows much greater LOS range . . . will share more as I can - have had >5Km LOS so far and expect more.

Using a couple of rocketscream mini ultra pros with RFM95 and a proper antenna (I'll get my moteinos up and running shortly - should be identical).

Fd
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: ziplockk on December 09, 2016, 03:48:45 PM
What I find interesting from the data collected is the RSSI very quickly drops to about -100dBm and stays there despite quite big changes of range . . . The moving radio pulls GPS location from a GPS receiver and sends this as its payload back to the static radio which logs the position and RSSI. Putting this onto google maps is simple enough.
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Russ Hedger on December 10, 2016, 08:38:36 PM
ziplockk, could you try with the AGC turned off to see if that affects your RSSI?

RH_RF95::ModemConfig modem_config = {
  0x78, // Reg 0x1D: BW=125kHz, Coding=4/8, Header=explicit
  0xC4, // Reg 0x1E: Spread=4096chips/symbol, CRC=enable
  0x08  // Reg 0x26: LowDataRate=On, Agc=Off
};
rf95.setModemRegisters(&modem_config);

Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: ziplockk on December 11, 2016, 06:07:52 PM
Good idea, will try and report.

Fd
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: steve v on February 08, 2017, 03:35:24 PM
For the RFM95 radios I find they always seem to work well using the off the shelf  sf128, and give me an open air range of better than 100 meters.

But when I switch over to the wider / slower configuration,   Bw31_25Cr48Sf512  some of the radios don't talk amongst the group.

When I investigate further  I found that the radios that do talk have the nominal  frequency of 915.000Mhz  +/-  3Khz

The radios that weren't talking in the group had a frequency of 915.00x   where the offset was greater than 4 Khz off

The solution to making everyone work was to measure the transmit frequency  with an accurate rf freq counter and then add the offset to the frequency in the sketch.

To get the RFM to transmit a steady CW frequency,  I just wrote a loop that on transmits a packet, with no pause for receive or acknowledge.  Doing this enables the frequ counter to lock onto the center frequency.

Now all of my Moteino RFM95 radios work with  an actual f of 915.000  +/-   1Khz   and the range is > 600 meters in a suburban setting with a 3 1/8 in ch wire antenna

Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Felix on February 09, 2017, 08:43:14 AM
steve, thanks for the knowledge sharing, any code snippet to support this solution you could illustrate?
Title: Re: Issue with LoRa long range modes and RFM95/RFM96
Post by: Russ Hedger on March 18, 2017, 07:27:06 PM
Looking at steve v's configuration, I notice that the bandwidth is being set to 31.25 kHz. The crystals used in the RFM95W are reported to have too poor a tolerance to be reliable below 125 kHz. His manual calibration seems to work though!