gr-lora_sdr

tappareljGPL-3.0更新放缓

用 GNU Radio 实现的完整 LoRa 收发机,包含低信噪比下也能正常工作的接收链路,适合做 LoRa 物理层研究和 SDR 实验。

This is the fully-functional GNU Radio software-defined radio (SDR) implementation of a LoRa transceiver with all the necessary receiver components to operate correctly even at very low SNRs. This work has been conducted at the Telecommunication Circuits Laboratory, EPFL.

暂无版本1,020star145fork同步于 2026-11-07 07:29 UTC

怎么上手

由 README 提炼,执行前请确认
conda install -c tapparelj -c conda-forge gnuradio-lora_sdr
硬件要求按 README 说明

README 未说明具体显存或 CPU 要求;需配合 USRP 等 SDR 硬件收发,也可用 apps/simulation 下的仿真框架做纯软件仿真。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

GNU Radio 的完整 LoRa 收发器模块,可在极低信噪比下做物理层实验

用 GNU Radio 实现的完整 LoRa 收发机,包含低信噪比下也能正常工作的接收链路,适合做 LoRa 物理层研究和 SDR 实验。

核心能力

  • 提供 Tx/Rx 分层块,覆盖加白、汉明编码、交织、Gray 映射与调制
  • 接收端含包同步、STO/CFO 估计与校正、解调及 CRC 校验
  • 可配置扩频因子 5-12、编码率 0-4、显式/隐式头与同步字
  • 支持软判决译码与低数据率优化模式
  • 可与 USRP 及 RFM95、SX1276、SX1262 商用模块互通

容易踩的坑

需 GNU Radio 3.10、python3、cmake、libvolk、boost、UHD、gcc>9.3.0、pybind11 等依赖;从源码更新后若块参数变化,需先 make uninstall 和 make clean 再重装;块未出现在 gnuradio-companion 时需在 ~/.gnuradio/config.conf 配置 local_blocks_path;扩频因子 5、6 与 SX126x 不兼容。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    GitHub last commit gnuradio version arXiv Build conda package License: GPL v3

    Summary

    This is the fully-functional GNU Radio software-defined radio (SDR) implementation of a LoRa transceiver with all the necessary receiver components to operate correctly even at very low SNRs. The transceiver is available as a module for GNU Radio 3.10. This work has been conducted at the Telecommunication Circuits Laboratory, EPFL.

    In the GNU Radio implementation of the LoRa Tx and Rx chains the user can choose all the parameters of the transmission, such as the spreading factor, the coding rate, the bandwidth, the sync word, the presence of an explicit header and CRC.

    • The module contains convenient hierarchical blocks for both Tx and Rx.
    • In the Tx chain, the implementation contains all the main blocks of the LoRa transceiver: the header- and the CRC-insertion blocks, the whitening block, the Hamming encoder block, the interleaver block, the Gray demapping block, and the modulation block.

    tx_flow

    • On the receiver side there is the packet synchronization block, which performs all the necessary tasks needed for the synchronization, such as the necessary STO and CFO estimation and correction. The demodulation block follows, along with the Gray mapping block, the deinterleaving block, the Hamming decoder block and the dewhitening block, as well as a CRC verification block.

    rx_flow

    • The implementation can be used for fully end-to-end experimental performance results of a LoRa SDR receiver at low SNRs.
    • A simple simulation framework is available in the apps/simulation folder.

    Functionalities

    • Sending and receiving LoRa packets between USRP-USRP and USRP-commercial LoRa transceiver (tested with RFM95, SX1276, SX1262).

    • Parameters available:

      • Spreading factors: 5-12*
      • Coding rates: 0-4
      • Implicit and explicit header mode
      • Payload length: 1-255 bytes
      • Sync word selection (network ID)
      • Verification of payload CRC
      • Verification of explicit header checksum
      • Low datarate optimisation mode
      • Utilisation of soft-decision decoding for improved performances

    * Spreading factors 5 and 6 are not compatible with SX126x.

    Reference

    Original publication

    J. Tapparel, O. Afisiadis, P. Mayoraz, A. Balatsoukas-Stimming and A. Burg, "An Open-Source LoRa Physical Layer Prototype on GNU Radio," 2020 IEEE 21st International Workshop on Signal Processing Advances in Wireless Communications (SPAWC), Atlanta, GA, USA, 2020, pp. 1-5. IEEE Xplore link, arXiv link

    Updated publication

    J, Tapparel and A. Burg, "Design and Implementation of LoRa Physical Layer in GNU Radio". Proceedings of the GNU Radio Conference, Knoxville, TN, USA, 2024. GNU Radio Proceedings

    If you find this implementation useful for your project, please consider citing the aforementioned paper.

    Prerequisites

    • Gnuradio 3.10
    • python 3
    • cmake
    • libvolk
    • boost
    • UHD
    • gcc > 9.3.0
    • gxx
    • pybind11

    Installation

    The out of tree module gr-lora_sdr can be installed from source or directly as a conda package.

    From source

    • Clone this repository
      git clone https://github.com/tapparelj/gr-lora_sdr.git
      
    • Go to the cloned repository
      cd gr-lora_sdr/
      
    • You can optionally install the required dependencies using the provided conda environment, or directly install the dependencies independently and bypass the use of conda. You can follow this tutorial or simply following:
      • First download the latest release of conda, for example:
        wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
        
      • Now run the downloaded file which is the Anaconda Installer script
        bash Miniconda3-latest-Linux-x86_64.sh
        
      • And reload the Shell
        source ~/.bashrc
        
      • Now copy our environment to install all the dependencies of the module automatically
        conda env create -f environment.yml
        
      • Start the conda environment GNU Radio 3.10 you just created
        conda activate gr310
        
    • To build the code, create an appropriate folder and go in it:
      mkdir build
      cd build
      
    • Run the main CMakeLists.txt
      cmake .. -DCMAKE_INSTALL_PREFIX=<your prefix> # default to usr/local, CONDA_PREFIX or PYBOMB_PREFIX if no install prefix selected here
      
    • Finally compile the custom GNU Radio blocks composing the LoRa transceiver.
      (sudo) make install -j$(nproc)
      
    • If you installed as sudo run
      sudo ldconfig 
      
    • Now you should be able to run some codes. For example, open the GNU Radio Companion user interface and check if the blocks of gr-lora_sdr are available on the blocks list (e.g. under LoRa_TX).
      gnuradio-companion &
      
    • A final verification of the transceiver functioning can be made by executing the following script, transmitting a frame every two seconds:
      python3 examples/tx_rx_functionality_check.py 
      
    Usage
    • An example of a LoRa transmitter and receiver can be found in gr-lora_sdr/examples/ (both python and grc).
    • The .grc files can be opened with gnuradio-companion to set the different transmission parameters.
    • The python file generated by grc can be executed with python3 ./{file_name}.py

    From conda

    Thanks to Ryan Volz this OOT module can also directly be installed as a Conda package. Note that gnuradio will also be installed in the conda environment.

    • Create or activate the conda environment you want to install this module in. Refer to the conda getting start guide if you are not familiar with it already.
    • Install the module from the anaconda channel tapparelj with:
      conda install -c tapparelj -c conda-forge gnuradio-lora_sdr
      
    • Depending on your needs you might want to install complementary packages for gnuradio with:
      conda install -c conda-forge gnuradio
      
    • The gnuradio metapackage installs all of the following subpackages:
      • gnuradio-grc
      • gnuradio-iio
      • gnuradio-qtgui
      • gnuradio-soapy
      • gnuradio-uhd
      • gnuradio-video-sdl
      • gnuradio-zeromq
    • If you don't want all of those and their dependencies, you can install the ones you'd like individually with:
      conda install -c conda-forge gnuradio-uhd
      
    Usage
    • Example gnuradio-companinon flowgraphs are installed with the package and can be found in:
      • (Linux/macOS) $CONDA_PREFIX/share/gr-lora_sdr/examples
      • (Windows) %CONDA_PREFIX%\Library\share\gr-lora_sdr\examples

    Frequent issues:

    • Fail to make after pulling a new version from git
      • If the parameters of a block have changed in the new version, you need to first clean the old installation before building the module again.
      • from within the build folder, run
        (sudo) make uninstall
        make clean
        make -j4
        (sudo) make install
        
    • "ImportError: No module named lora_sdr":
      • This issue comes probably from missing PYTHONPATH and LD_LIBRARY_PATH
      • Refer to https://wiki.gnuradio.org/index.php/ModuleNotFoundError to modify those variables. If you set a prefix during the "cmake" call, skip directly to point C.(Verifying that the paths exist in your folders might help.)
    • The OOT blocks doesn't appear in gnuradio-companion:
      • The new blocks can be loaded in gnuradio-companion by adding the following lines in home/{username}/.gnuradio/config.conf (If this file doesn't exist you need to create it):
        [grc]
        local_blocks_path=path_to_the_downloaded_folder/gr-lora_sdr/grc
        

    Changelog

    • Add option to ignore sync words checks and print the received values

    • Add optional print of received payload as hex values

    • Added tagged stream input support (for frame definition of frame length)

    • Fixed LLR stream format between fft_demod and deinterleaver

    • added tags to crc verification output stream indication frame start, length and CRC result.

    • added separator option for file input

    • added preamble length option

    • added parameter for frame zero-padding

    • add low data-rate optimization support

    • add support of spreading factors smaller than 7

      ...

    Credit

    This work was inspired from https://github.com/rpp0/gr-lora by Pieter Robyns, Peter Quax, Wim Lamotte and William Thenaers. Which architecture and functionalities have been improved to better emulate the physical layer of LoRa.

    Licence

    Distributed under the GPL-3.0 License License. See LICENSE for more information.