Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHow to configurate LoRa for best distance? #90
Comments
This comment has been minimized.
This comment has been minimized.
First step is getting a better antenna. The stub and wires these usually come with are rubbish. I used a proper 800-850MHz and that increased my range significantly (828 meters so far). In that same test I had the following settings. Bandwidth: 250E3 (less might have been better) I tried a follow up test but it didn't work at all due to not taking transmission time into account. So something to keep in mind, the longer your range, the longer you need to wait between TXes. Here's a handy spreadsheet to calculate On Air Time. |
This comment has been minimized.
This comment has been minimized.
Oh, CRC was disabled too. |
This comment has been minimized.
This comment has been minimized.
Hi, |
This comment has been minimized.
This comment has been minimized.
Looks like 125kHz is the default. |
This comment has been minimized.
This comment has been minimized.
OK Bw is let to chip default setting.Thanks.
… Le 25 janv. 2018 à 16:15, morganrallen ***@***.***> a écrit :
Looks like 125kHz is the default.
http://www.mouser.com/ds/2/761/sx1276-944191.pdf <http://www.mouser.com/ds/2/761/sx1276-944191.pdf> Page 113
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#90 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAmBa8o0TWPHFB1TVifGl_98m7EE73VUks5tOJqZgaJpZM4Rpzod>.
|
This comment has been minimized.
This comment has been minimized.
Excellent morganrallen, many thanks! Bandwith: If reduce the bandwith at minimum, lets say 7.8E3, am I going to have better distance? If anybody could answer this parameters for distance would be awesome |
This comment has been minimized.
This comment has been minimized.
Spread factor is going to be the one that determines distances the most (bandwidth second?). Higher = longer range AND longer TX time. All the other params will mostly affect transmission time. |
This comment has been minimized.
This comment has been minimized.
Thanks @morganrallen! I'm closing as answered for now. |
This comment has been minimized.
This comment has been minimized.
@MauriPastorini - the answers provided are not quite complete. Please download and play with the Semtech "Lora Calculator Tool" that you can download from their website (Windows only). It will clearly show you how the spreading factor (SF), Bandwidth (BW) and coding rate (CR) affect time-on-air (affects power consumption) and receiver sensitivity (affects distance). If you don't care about time on air/power consumption, set the bandwidth to a minimum and SF to maximum. You'll get an incredible link budgets with line of sight communication of 100km or more. Check out Andreas Spiess' Youtube videos on Lora for a test he did over very large distances. The antenna had very little impact. |
This comment has been minimized.
This comment has been minimized.
@MauriPastorini - One additional detail that is often overlooked - the lower the bandwidth, the more stable of a clock you need driving the Semtech chipset. For example, a number of Hope RF modules use a crystal oscillator with 10ppm drift, which means you cannot select bandwidths of less than 41.7 kHz (31.25 kHz may work) or you will not be able to demodulate any packets. Note that operation in high G environments will affect clock drift as well. In general, if you are designing strictly based on link budget (receiver sensitivity), choose the higher bandwidths (more immune to clock drift). For example, SF 10, BW 500 kHz and CR 4/5 yields a receiver sensitivity of -126 dBm with an on-air time of approx. 100ms for a 32-byte packet (6 byte preamble) but SF 9, BW 250 kHz and CR 4/5 also yields a receiver sensitivity of -126dBm with a similar on-air time (around 109ms). The latter allows for a maximum crystal drift of 72ppm whereas the 500kHz bandwidth will allow 144ppm drift. Therefore, for the same link budget, I would choose the wider bandwidth (500kHz) and and corresponding larger spreading factor (10) (less prone to interference than SF 9). Hope this helps. |
This comment has been minimized.
This comment has been minimized.
Thanks for this more detailed response, this would be extremely useful as a footnote in the docs if you feel like writing up a "Quick Guide to Range Considerations". |
This comment has been minimized.
This comment has been minimized.
@morganrallen - one of the best presentations on LoRa that I have come across is from Matt Knight at Bastille Networks - Reversing Lora. Skip to "Introducing LoRa". A couple more comments on this, you recommended in a previous post to set the C/R to 8 (ref. C/R Denominator: 8), this effectively sends your message twice and doubles your on-air-time (and doubles current-consumption). If it is important to have your message received at the other end within a certain period of time, consider sending data more frequently. E.g. if your receiver needs to see data ever 30 seconds, send data every 15 seconds. This has the benefit of providing more up-to-date data (rather than send two copies of the same data with C/R 8) and you space the packets in time (possibly avoiding temporal interference). In the event you are using LoRa modulation outside of a gateway configuration (e.g. communication from node to node in a broadcast to all configuration), the longer the on-air-time the more collisions you will encounter (multiple nodes talking at the same time). I personally don't use any C/R above 6 for that reason alone. There have been comments about whether CRC checks should be turned on. These should always be turned on even when you have an application-level checksum. What is the sense of having the LoRa modem send you a garbage packet? In addition, the cost of sending you the garbage packet is not zero. In many cases, the LoRa modem is connected by UART (or I2C) and at speeds of 57600, the cost of sending you a bad packet can be tens of milliseconds and then you have to instruct the modem to restart the listening process and during this whole process you are missing out on receiving other packets. Turn it on. Always. |
This comment has been minimized.
This comment has been minimized.
I recently learned another reason to leave CRC on. Even if the CRC check fails, the data is still available. From SX1276 datasheet page 30.
In the case of sending "human consumable data" like a text message, even a corrupt data can be useful. |
This comment has been minimized.
This comment has been minimized.
@morganrallen - Yes, excellent point. |
This comment has been minimized.
This comment has been minimized.
@saedelman This is really valuable information! Would like to encourage you to post this findings to the FAQ! |
This comment has been minimized.
This comment has been minimized.
please update readme and faq for better distance settings |
This comment has been minimized.
This comment has been minimized.
The following table is based on midband frequency of 915MHz (North America - you'll get better results when using 868MHz) and sender and receiver isotropic antenna gains of 1 (e.g. a whip antenna without any gain) Distance - SF/BW Although there are other possible combinations of SF/BW possible to achieve the indicated distances, the above table is based on minimizing time-on-air (and therefore minimal power consumption and maximum data rate). The above table is strictly based on free space path loss and therefore distances must be line-of-sight. Note that it is not just a matter of the tips of your send/receive antenna seeing each other without obstructions, there is a so-called Fresnel zone that needs to be entirely clear of obstructions. This zone is shaped like a "blimp" suspended between the tips of the transmit/receive antennas. The maximum diameter of the "blimp" is a function of distance. There are many good tools out there to plot the Fresnel zones between two geographic points - see https://www.loxcel.com/3d-fresnel-zone (not free - no affiliation). |
This comment has been minimized.
This comment has been minimized.
Please can you provide reference for these calculations as I want to experiment with different SF/BW and different ISM band (868 MHz) to understand possible communication range. |
This comment has been minimized.
This comment has been minimized.
Hi guys, #define PA_OUTPUT_RFO_PIN 0 Note: in my case, I'm only transmitting 32 bytes but I need max range-reliability(who doesn't) :) |
Hi, I was wondering how can we configurate the LoRa with the library for the best distance? Something like changing the data rate, baud rate and modulation. And how to request which values had been set for confirmation.
Thank you