SX1301/8 LoRa网关模块快速入门

[English]

概要

对于SX1301和SX1308, 它们的性能, 驱动程序, 接口封装和功能是完全相同的. 其差值就是工作温度范围. SX1301定位为室外型, SX1308定位为室内型. 与合适的驱动硬件和Linux操作系统 (如树莓派)合作, 就可以作为LoRa网关.

技术特点

引脚定义

电气特性

使用SPI模式运行SX130x模块(树莓派)

默认情况下, 树莓派SPI总线是禁用的. 在putty中输入以下命令打开树莓派配置界面, 并启用SPI总线.

sudo raspi-config

选择 Interfacing Options SPI Yes, 可能需要重新启动树莓派.

通过以下命令安装SX1301模块相关的应用程序和服务:

mkdir lora
cd lora
sudo apt-get update
sudo apt-get install git
git clone https://github.com/Lora-net/lora_gateway.git
# LoRa Gateway drivers
git clone https://github.com/Lora-net/packet_forwarder.git
# packet forwarding software
git clone https://github.com/HelTecAutomation/lorasdk.git
# This package will create a "lrgateway" service in Raspberry Pi
cd /home/pi/lora/lora_gateway
make clean all
cd /home/pi/lora/packet_forwarder
make clean all
cd /home/pi/lora/lorasdk
chmod +x install.sh 
./install.sh
#Run the script. After the script is run, it will create a service named "lrgateway". The purpose is to make the lora driver and data forwarding program run automatically at startup.
sudo cp -f /home/pi/lora/lorasdk/global_conf_EU868.json /home/pi/lora/packet_forwarder/lora_pkt_fwd/global_conf.json
#the "global_conf_EU868.json" may need change to your need.

小技巧

“global_conf.json” 文件决定了网关的监听频率, 这是节点能否成功与网关通信的关键!

./install.sh 执行时, 如果一切正常, 将打印当前网关的唯一ID. LoRa服务器上注册网关时需要这个唯一的ID.

确认安装

在树莓派中运行 sudo systemctl status lrgateway, 如果一切正常, 服务正在运行:

 

连接到LoRa服务器

与树莓派工作的SX130x模块与树莓派在SPI模式下的HT-M01 网关最相似. 连接到LoRa服务器的步骤, 请参阅本文档:

https://heltec-automation-docs.readthedocs.io/en/latest/gateway/ht-m01/connect_to_server.html