在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):JaapBraam/LoRaWanGateway开源软件地址(OpenSource Url):https://github.com/JaapBraam/LoRaWanGateway开源编程语言(OpenSource Language):Lua 100.0%开源软件介绍(OpenSource Introduction):LoRaWanGatewayA LoRaWan Gateway in Lua, listening to all spreading factors on one specific channel. Goals
Why Lua?Lua is an event driven language, which is a good match for a gateway: a gateway has to respond to incoming messages from nodes and routers. The LoraWanGateway runs on an ESP8266 chip, with the NodeMCU firmware it runs a full WiFi stack and a Lua runtime. The NodeMCU contains a lot of libraries that are usefull for a gateway: WiFi, NTP support, SPI, 6 timers, JSON support etc. How multiple spreading factors are detectedUnlike complex LoRaWAN concentrator modules (such as SX1301/SX1308), a simple SX1276/SX1278 module needs to be told exactly for which channel and spreading factor (SF) it should perform channel activity detection (CAD). This works fine when using the module in an end device (node), as then LoRaWAN explicitly defines which combination is to be used. But for a single channel gateway the goal is to listen on all SFs of that single channel. The strategy to make this work for a simple SX1276/SX1278 module is to first start a SF7 CAD on the channel frequency. While performing the CAD, RSSI is used to detect the presence of a signal on the channel. If a preamble is detected the message is received using the RX_SINGLE mode of the module. If a preamble is not detected on SF7 and RSSI shows that a signal is present, CAD is used to detect a SF8 preamble. This is repeated for all spreading factors. This works because the preamble always uses 8 symbols, and the length of a symbol is dependent on the spreading factor. The next SF's symbol length is twice the length of the previous length. Detecting a signal using CAD takes less than two symbols. So when a SF7 CAD returns, two symbols of the preamble are 'used', leaving 6 more to synchronize the reading of the message. The two SF7 symbols that are gone, acount for one SF8 symbol. So there are 7 preamble symbols available to detect a SF8 signal. Likewise:
So there are always enough preamble symbols left to try to detect a higher SF signal, if the lower SF detection fails. In order to make this work it is important to detect the presence of a signal on the channel as soon as possible; the RSSI detection during CAD is used to do that. A drawback of this approach is that the range of this gateway will be less of that of a 'real' gateway; it can only receive messages that can be detected by RSSI. HardwareIn order to run a LoRaWanGateway you need:
Connections
Installation instructions
The LoRaWanGateway needs quite some RAM and processing power, so it is necessary to flash firmware that uses as little resources as possible. The firmware that we will use contains only the modules needed. There are two ways to obtain the minimum build:
Steps to follow1. Get the firmwareMethod A: Use the firmware that is supplied in this repositoryIn the directory "firmware" look for the .bin file that starts with "nodemcu-master" Method B: Build your own firmware
2. Flash the firmware to the ESP8266Method A: Windows only, use the GUI tool supplied in this repository
Method B: Use the command line tool esptool.pyA Python-based, open source, platform independent, utility. Method C: Use the python GUI tool NodeMCU PyFlasherSelf-contained NodeMCU flasher with GUI based on esptool.py and wxPython. 3. Reboot the ESP82664. Upload the .lua files to the ESP8266Suggested tool: nodemcu-uploader.py
5. Connect to the ESP8266 and set the configUse a serial connection at 115200 baud to connect and configure your gateway:
ConfigurationThe LoRaWanGateway is configured to listen for all spreadingsfactors on EU channel 0 (868.1 Mhz). The LoRaWanGateway can be run in two modes
When listening to a single SF, the range of your gateway will increase a lot because messages below the noise floor will be received too. Changing the configuration can be done from the LUA shell using the new CONFIG object.
Values can be changed using CONFIG.PARAMETER=VALUE i.e. CONFIG.GW_FREQ=902300000 for listening to channel
0 on the US915 band.
The gateway will listen to only one specific channel. It will send on whatever channel or datarate the router seems fit... Remote access using telnetYou can connect to your gateway using a telnet client. If you connect to GW_HOSTNAME:23 you will get access
to the LUA shell of your gateway. StatisticsYou can view statistics by entering statistics() in the LUA shell or in your telnet terminal. Revisions
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论