├── README.md └── openwrt-add-lora-gateway.patch /README.md: -------------------------------------------------------------------------------- 1 | # OpenWrt-lora 2 | 3 | Patches to add [LoRa-net/lora_gateway](https://github.com/Lora-net/lora_gateway) and [LoRa-net/packet_forwarder](https://github.com/Lora-net/packet_forwarder) to OpenWrt source tree. 4 | -------------------------------------------------------------------------------- /openwrt-add-lora-gateway.patch: -------------------------------------------------------------------------------- 1 | commit c2449a6917b2080f14bf96c690ea2c5d91799fdf 2 | Author: JiapengLi 3 | Date: Mon Apr 7 00:39:41 2014 +0800 4 | 5 | Add lora-gateway support. 6 | 7 | diff --git a/utils/lora-gateway/Makefile b/utils/lora-gateway/Makefile 8 | new file mode 100644 9 | index 0000000..53236b1 10 | --- /dev/null 11 | +++ b/utils/lora-gateway/Makefile 12 | @@ -0,0 +1,60 @@ 13 | +# 14 | +# Copyright (C) 2014 OpenWrt.org 15 | +# 16 | +# This is free software, licensed under the GNU General Public License v2. 17 | +# See /LICENSE for more information. 18 | +# 19 | + 20 | +include $(TOPDIR)/rules.mk 21 | + 22 | +PKG_NAME:=lora_gateway 23 | +PKG_VERSION:=1.3.0 24 | +PKG_RELEASE:=1 25 | + 26 | +PKG_SOURCE_PROTO:=git 27 | +PKG_SOURCE_URL:=git@github.com:Lora-net/lora_gateway.git 28 | +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 29 | +PKG_SOURCE_VERSION:=f991b0e35ad1bd3b999c70e68c518bae91bd36a6 30 | +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz 31 | + 32 | +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 33 | + 34 | +include $(INCLUDE_DIR)/host-build.mk 35 | +include $(INCLUDE_DIR)/package.mk 36 | + 37 | +define Package/lora-gateway/Default 38 | + TITLE:=Semtech lora-gateway package 39 | + URL:=http://www.semtech.com/wireless-rf/lora.html 40 | +endef 41 | + 42 | +define Package/lora-gateway 43 | +$(call Package/lora-gateway/Default) 44 | + SECTION:=utils 45 | + CATEGORY:=Utilities 46 | + DEPENDS:=+libmpsse libftdi 47 | +endef 48 | + 49 | +define Package/lora-gateway/description 50 | + lora-gateway is a library to build a gateway based on 51 | + a Semtech LoRa multi-channel RF receiver (a.k.a. concentrator). 52 | +endef 53 | + 54 | +TARGET_CFLAGS += $(FPIC) -O2 -Wall -Wextra -std=c99 -Iinc -I. -lm 55 | + 56 | +define Build/InstallDev 57 | + $(INSTALL_DIR) $(1)/usr/include/lora-gateway 58 | + $(CP) $(PKG_BUILD_DIR)/libloragw/inc/* $(1)/usr/include/lora-gateway 59 | + $(INSTALL_DIR) $(1)/usr/lib 60 | + $(CP) $(PKG_BUILD_DIR)/libloragw/libloragw.a $(1)/usr/lib/ 61 | +endef 62 | + 63 | +define Package/lora-gateway/install 64 | + $(INSTALL_DIR) $(1)/root/lora 65 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/libloragw/test* $(1)/root/lora 66 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_pkt_logger/util_pkt_logger $(1)/root/lora 67 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_band_survey/util_band_survey $(1)/root/lora 68 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_spi_stress/util_spi_stress $(1)/root/lora 69 | + $(INSTALL_BIN) $(PKG_BUILD_DIR)/util_tx_test/util_tx_test $(1)/root/lora 70 | +endef 71 | + 72 | +$(eval $(call BuildPackage,lora-gateway)) 73 | diff --git a/utils/lora-gateway/patches/000-add-missing-header.patch b/utils/lora-gateway/patches/000-add-missing-header.patch 74 | new file mode 100644 75 | index 0000000..d8ce411 76 | --- /dev/null 77 | +++ b/utils/lora-gateway/patches/000-add-missing-header.patch 78 | @@ -0,0 +1,12 @@ 79 | +--- a/libloragw/src/loragw_spi.ftdi.c 80 | ++++ b/libloragw/src/loragw_spi.ftdi.c 81 | +@@ -26,6 +26,9 @@ Maintainer: Sylvain Miermont 82 | + #include /* malloc free */ 83 | + #include /* memcpy */ 84 | + 85 | ++#include 86 | ++#include 87 | ++ 88 | + #include 89 | + 90 | + #include "loragw_spi.h" 91 | --------------------------------------------------------------------------------