From 340163be39ad9fc3a186d76d7fee25f58ff70fe3 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Mon, 4 Nov 2019 04:31:02 -0500 Subject: [PATCH 01/26] Beeeon gateway added. --- net/beeeon/beeeon-gateway | 1 + 1 file changed, 1 insertion(+) create mode 120000 net/beeeon/beeeon-gateway diff --git a/net/beeeon/beeeon-gateway b/net/beeeon/beeeon-gateway new file mode 120000 index 0000000..91012f3 --- /dev/null +++ b/net/beeeon/beeeon-gateway @@ -0,0 +1 @@ +../../../feeds/beeeon/beeeon-gateway \ No newline at end of file From 45796c3648737c2039d7fcf5b0507403a7282b41 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Mon, 4 Nov 2019 04:40:23 -0500 Subject: [PATCH 02/26] Beeeon gateway added. --- net/beeeon-gateway/Config.in | 293 ++++++++++++++++++ net/beeeon-gateway/Makefile | 284 +++++++++++++++++ net/beeeon-gateway/files/beeeon-gateway | 29 ++ .../files/beeeon-hotplug-functions | 82 +++++ .../files/bluetooth-beeeon-dongle | 31 ++ net/beeeon-gateway/files/tty-beeeon-dongle | 55 ++++ net/beeeon/beeeon-gateway | 1 - 7 files changed, 774 insertions(+), 1 deletion(-) create mode 100644 net/beeeon-gateway/Config.in create mode 100644 net/beeeon-gateway/Makefile create mode 100644 net/beeeon-gateway/files/beeeon-gateway create mode 100755 net/beeeon-gateway/files/beeeon-hotplug-functions create mode 100644 net/beeeon-gateway/files/bluetooth-beeeon-dongle create mode 100644 net/beeeon-gateway/files/tty-beeeon-dongle delete mode 120000 net/beeeon/beeeon-gateway diff --git a/net/beeeon-gateway/Config.in b/net/beeeon-gateway/Config.in new file mode 100644 index 0000000..ab9f175 --- /dev/null +++ b/net/beeeon-gateway/Config.in @@ -0,0 +1,293 @@ +menu "Configuration" + depends on PACKAGE_beeeon-gateway + +choice + prompt "Gateway Identity" + +config BEEEON_GATEWAY_ID_RANDOM + bool "random" + help + BeeeOn Gateway ID would be generated during the build + at random. + +config BEEEON_GATEWAY_ID_CUSTOM + bool "custom" + help + BeeeOn Gateway ID is to be entered manually. + +config BEEEON_GATEWAY_ID_CERT + bool "from certificate" + help + BeeeOn Gateway ID would be extracted from the given + certificate. It is thus required to give a path to + the gateway's private key, certificate and signing + certification authority. + +endchoice + +config BEEEON_GATEWAY_ID_CUSTOM_VALUE + string "ID" + depends on BEEEON_GATEWAY_ID_CUSTOM + default "1254321374233360" + help + The Gateway ID must be in the following decadic + format: VDDD DDDD DDDD DDDC. The V is "version" + and should be always 1. The series of D denotes + the unique identification part. The C is the DAMM + check sum digit. + +config BEEEON_GATEWAY_ID_CERT_FILE + string "Certificate file" + depends on BEEEON_GATEWAY_ID_CERT + help + The certification should prove that the gateway's + public key and ID are trusted by its signing CA. + +config BEEEON_GATEWAY_ID_CERT_PKEY + string "Private key file" + depends on BEEEON_GATEWAY_ID_CERT + help + Private key of the BeeeOn Gateway. + +config BEEEON_GATEWAY_ID_CERT_AUTHORITY + string "CA public key" + depends on BEEEON_GATEWAY_ID_CERT + help + The given file should represent the public key of CA + that has signed the certificate of the gateway. + +config BEEEON_GATEWAY_GWS + bool "GWS connector" + default n + help + Enable GWS connector, component to connect + to the remote BeeeOn Server. + +config BEEEON_GATEWAY_GWS_HOST + string "GWS host" + depends on BEEEON_GATEWAY_GWS + default "" if !BEEEON_GATEWAY_GWS + +config BEEEON_GATEWAY_GWS_PORT + int "GWS port" + depends on BEEEON_GATEWAY_GWS + range 1 65535 + default 8850 + +endmenu + +menu "Modules" + depends on PACKAGE_beeeon-gateway + +config BEEEON_GATEWAY_USB_UART_RECOMMENDED + bool + default y if BEEEON_GATEWAY_ZWAVE + default y if BEEEON_GATEWAY_IQRF + default y if BEEEON_GATEWAY_JABLOTRON + default n + +config BEEEON_GATEWAY_HAS_KMOD_USB_ACM + bool + default y if PACKAGE_kmod-usb-acm + default n + +comment "You may need to select kmod-usb-acm to support UART-over-USB." + depends on BEEEON_GATEWAY_USB_UART_RECOMMENDED + depends on !BEEEON_GATEWAY_HAS_KMOD_USB_ACM + +config BEEEON_GATEWAY_BELKIN_WEMO + bool "Belkin Wemo" + default n + help + Enable support of Belkin Wemo devices connected + over LAN or WLAN. + +config BEEEON_GATEWAY_HAS_BLUEZ_DAEMON + bool + default y if PACKAGE_bluez-daemon + default n + +config BEEEON_GATEWAY_HAS_BLUEZ_LIBS + bool + default y if PACKAGE_bluez-libs + +config BEEEON_GATEWAY_HAS_GLIB2 + bool + default y if PACKAGE_glib2 + default n + +config BEEEON_GATEWAY_BLE_SMART + bool "Bluetooth LE Smart" + depends on BEEEON_GATEWAY_HAS_GLIB2 + depends on BEEEON_GATEWAY_HAS_BLUEZ_LIBS + depends on BEEEON_GATEWAY_HAS_BLUEZ_DAEMON + default n + help + Enable support of Bluetooth Low Energy Smart + devices. It is possible to measure data or + control certain devices. + +comment "BLE Smart requires bluez-daemon, bluez-lib and glib2" + depends on !BEEEON_GATEWAY_HAS_GLIB2 + depends on !BEEEON_GATEWAY_HAS_BLUEZ_LIBS + depends on !BEEEON_GATEWAY_HAS_BLUEZ_DAEMON + +config BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY + bool "Bluetooth Availability" + depends on BEEEON_GATEWAY_HAS_BLUEZ_LIBS + default n + help + Enable support of availability detection module. + It tells whether a Bluetooth device is available + or not. + +comment "Bluetooth Availability requires bluez-libs" + depends on !BEEEON_GATEWAY_HAS_BLUEZ_LIBS + +config BEEEON_GATEWAY_HCI_INFO_REPORTER + bool "HciInfo Reporter" + depends on BEEEON_GATEWAY_HAS_BLUEZ_LIBS + default n + help + Enable support of HciInfoReporter instance. It periodically + reports information about HCI nodes available in the system. + +comment "HciInfo Reporter requires bluez-libs" + depends on !BEEEON_GATEWAY_HAS_BLUEZ_LIBS + +config BEEEON_GATEWAY_FITP + bool "BUT FIT IoT Protocol" + default n + help + Enable support of the experimental FITP protocol + develped at Brno University of Technology. This + might require appropriate SPI drivers in the kernel. + +config BEEEON_GATEWAY_IQRF + bool "IQRF" + default n + help + Enable support of IQRF. This might require appropriate + USB or UART drivers in the kernel. + +config BEEEON_GATEWAY_JABLOTRON + bool "Jablotron Turris Gadgets" + default n + help + Enable support of Turris Gadgets. This might require + appropriate USB or UART drivers in the kernel. + +config BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP + bool + default y if PACKAGE_libmosquittopp + default n + +comment "MQTT exporter requires libmosquittopp" + depends on !BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP + +config BEEEON_GATEWAY_MQTT_EXPORTER + bool "Exporting data via MQTT" + depends on BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP + default n + help + Enable exporting data over MQTT via mosquitto. + +menu "MQTT Exporter settings" + depends on BEEEON_GATEWAY_MQTT_EXPORTER + +config BEEEON_GATEWAY_MQTT_EXPORTER_HOST + string "MQTT host" + default "127.0.0.1" + +config BEEEON_GATEWAY_MQTT_EXPORTER_PORT + int "MQTT port" + default 1883 + range 1 65535 + +config BEEEON_GATEWAY_MQTT_EXPORTER_TOPIC + string "MQTT topic" + default "BeeeOnOut" + +config BEEEON_GATEWAY_MQTT_EXPORTER_CLIENT_ID + string "MQTT client ID" + default "Gateway" + +endmenu + +config BEEEON_GATEWAY_PHILIPS_HUE + bool "Philips Hue" + default n + help + Enable support of Philips Hue devices connected + over LAN or WLAN. + +config BEEEON_GATEWAY_PRESSURE_SENSOR + bool "On-board pressure sensor" + default n + help + Enable support of pressure sensor read from + sysfs of the local system. + +config BEEEON_GATEWAY_PRESSURE_SENSOR_PATH + string "sysfs path to pressure sensor" + depends on BEEEON_GATEWAY_PRESSURE_SENSOR + default "" + help + Path to the sysfs entry where the pressure input can + be access and read. Example: + + /sys/devices/platform/soc@01c00000/1c2b400.i2c/i2c-2/2-0077/iio:device0/in_pressure_input + +config BEEEON_GATEWAY_VIRTUAL_DEVICES + bool "Virtual Devices (testing)" + default n + help + Enable support of virtual devices. This feature + is intended for testing. Virtual devices can + emulate real sensors. + +config BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG + string "path to custom virtual-devices.ini" + depends on BEEEON_GATEWAY_VIRTUAL_DEVICES + default "" + help + Path to a custom configuration file for virtual + devices. Leave empty to use the default one. + +config BEEEON_GATEWAY_VPT + bool "Thermona VPT" + default n + help + Enable support of Thermona VPT connected over + LAN or WLAN. + +config BEEEON_GATEWAY_ZWAVE + bool "ZWave" + default n + help + Enable support of Z-Wave. This might require appropriate + USB or UART drivers in the kernel. + +config BEEEON_GATEWAY_TESTING_CENTER + bool "Testing Center (testing)" + default n + help + Enable support for component TestingCenter which + is useful for debugging. It opens a local TCP + textual console at port 6000. + +config BEEEON_GATEWAY_TESTING_COLLECTOR + bool "Testing Collector (testing)" + default n + help + Enable support for component LoggingCollector which + is useful for debugging by looking for logs of some + internal gateway events. + +config BEEEON_GATEWAY_NEMEA + bool "Collecting & exporting data with NemeaCollector" + default y + help + Enable usage of NemeaCollector. + +endmenu diff --git a/net/beeeon-gateway/Makefile b/net/beeeon-gateway/Makefile new file mode 100644 index 0000000..60fe13d --- /dev/null +++ b/net/beeeon-gateway/Makefile @@ -0,0 +1,284 @@ +# +# Copyright (c) 2016, 2017, Brno University of Technology +# +# This is free software, licensed under the BSD-3-Clause. +# +# This file is based on +# https://github.com/BeeeOn/openwrt-packages/tree/master/beeeon-gateway +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=beeeon-gateway +PKG_VERSION:=v2019.7.1 +PKG_RELEASE:=1 +INIT_SCRIPT_NAME:=$(PKG_NAME) + + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/BeeeOn/gateway.git +PKG_SOURCE_VERSION:=7328b4377efcba98d1fef25372f2d2d6a7e685f0 + +BUILD_DIR:=$(TOPDIR)/build_dir/turris +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_BUILD_DIR:=${BUILD_DIR}/${PKG_SOURCE_SUBDIR} + +PKG_BUILD_PARALLEL:=1 +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +CMAKE_OPTIONS += \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DENABLE_TESTS=OFF \ + -DENABLE_UDEV=OFF \ + -DENABLE_BELKIN_WEMO=ON \ + -DENABLE_BLE_SMART=ON \ + -DENABLE_BLUETOOTH_AVAILABILITY=ON \ + -DENABLE_HCI_INFO_REPORTER=ON \ + -DENABLE_FITP=OFF \ + -DENABLE_IQRF=ON \ + -DENABLE_JABLOTRON=ON \ + -DENABLE_PHILIPS_HUE=ON \ + -DENABLE_VEKTIVA=ON \ + -DENABLE_PRESSURE_SENSOR=ON \ + -DENABLE_VIRTUAL_DEVICES=ON \ + -DENABLE_VPT=ON \ + -DENABLE_ZWAVE=ON \ + -DENABLE_TESTING_CENTER=ON \ + -DENABLE_NEMEA=ON + +TARGET_CXXFLAGS += -DPOCO_NO_FPENVIRONMENT + +define Package/beeeon-gateway/config + source "$(SOURCE)/Config.in" +endef + +PKG_BUILD_DEPENDS += +poco-all python3/host +glib2 +bluez +openzwave +PKG_BUILD_DEPENDS += BEEEON_GATEWAY_MQTT_EXPORTER:mosquitto + +#ifeq ($(CONFIG_BEEEON_GATEWAY_BLE_SMART),y) +#_IPKG_DEPENDS += +bluez-daemon +bluez-libs +glib2 +#endif + +#ifeq ($(CONFIG_BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY),y) +#_IPKG_DEPENDS += +bluez-libs +glib2 +#endif + +#ifeq ($(CONFIG_BEEEON_GATEWAY_HCI_INFO_REPORTER),y) +#_IPKG_DEPENDS += +bluez-libs +glib2 +#endif + +#ifeq ($(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),y) +#_IPKG_DEPENDS += +libmosquittopp +#endif + +define Package/beeeon-gateway + TITLE:=BeeeOn Gateway + SECTION:=cesnet + CATEGORY:=CESNET + DEPENDS:=+poco-all + MAINTAINER:=Jan Viktorin + + DEPENDS += +bluez-daemon +bluez-libs +glib2 +libmosquittopp +nemea-framework +libpcap +openzwave-config +libopenzwave +endef + +define Package/beeeon-gateway/description + Main application for BeeeOn Gateway. +endef + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_BELKIN_WEMO),belkinwemo) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_BELKIN_WEMO),,belkinwemo) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLE_SMART),blesmart) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLE_SMART),,blesmart) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY),bluetooth.availability) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY),,bluetooth.availability) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_HCI_INFO_REPORTER),bluetooth.reporting) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_HCI_INFO_REPORTER),,bluetooth.reporting) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_FITP),fitp) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_FITP),,fitp) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_IQRF),iqrf) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_IQRF),,iqrf) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_JABLOTRON),jablotron) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_JABLOTRON),,jablotron) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),exporter.mqtt) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),,exporter.mqtt) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_PHILIPS_HUE),philipshue) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_PHILIPS_HUE),,philipshue) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR),psdev) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR),,psdev) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES),vdev) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES),,vdev) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_VPT),vpt) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_VPT),,vpt) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_ZWAVE),zwave) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_ZWAVE),,zwave) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_CENTER),testing.center) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_CENTER),,testing.center) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_COLLECTOR),testing.collector) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_COLLECTOR),,testing.collector) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_NEMEA_COLLECTOR),nemea) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_NEMEA_COLLECTOR),,nemea) + +#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_GWS),gws) +#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_GWS),,gws) + +BEEEON_GATEWAY_MODULE_ENABLE += belkinwemo \ + blesmart \ + bluetooth.availability \ + bluetooth.reporting \ + iqrf jablotron \ + exporter.mqtt \ + philipshue \ + psdev \ + vdev \ + vpt \ + zwave \ + testing.center \ + testing.collector \ + nemea \ + gws + +# Generate random BeeeOn Gateway ID +ifeq ($(CONFIG_BEEEON_GATEWAY_ID_RANDOM),y) +BEEEON_GATEWAY_MODULE_ENABLE += gateway.id + +define BEEEON_GATEWAY_ID_INSTALL + echo gateway.id = `python3 $(PKG_BUILD_DIR)/tools/gateway-genid.py` \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.key = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.certificate = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties +endef +endif + +# Configure the manually inserted BeeeOn Gateway ID +ifeq ($(CONFIG_BEEEON_GATEWAY_ID_CUSTOM),y) +BEEEON_GATEWAY_MODULE_ENABLE += gateway.id + +define BEEEON_GATEWAY_ID_INSTALL + echo gateway.id = $(CONFIG_BEEEON_GATEWAY_ID_CUSTOM_VALUE) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.key = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.certificate = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties +endef +endif + +# Use SSL/TLS to provide BeeeOn Gateway ID +ifeq ($(CONFIG_BEEEON_GATEWAY_ID_CERT),y) +BEEEON_GATEWAY_MODULE_DISABLE += gateway.id + +define BEEEON_GATEWAY_ID_INSTALL + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc/ssl/beeeon/private + $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_PKEY) \ + $(PKG_INSTALL_DIR)/etc/ssl/beeeon/private/beeeon_gateway.key + + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs + $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_FILE) \ + $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs/beeeon_gateway.crt + $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_AUTHORITY) \ + $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs/beeeon_root_ca.crt +endef +endif + +ifeq ($(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),y) +define BEEEON_GATEWAY_MQTT_INSTALL + echo exporter.mqtt.host = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_HOST) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties + echo exporter.mqtt.port = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_PORT) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties + echo exporter.mqtt.topic = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_TOPIC) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties + echo exporter.mqtt.clientID = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_CLIENT_ID) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties +endef +endif + +define Package/beeeon-gateway/install + $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH),\ + echo psdev.path = $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH) \ + > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-pressure-sensor.properties) + + $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG),\ + $(CP) $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG) \ + $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/virtual-devices.ini) + + echo hotplug.impl = pipeHotplug \ + > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-hotplug.properties + + $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties + $(foreach module,$(BEEEON_GATEWAY_MODULE_ENABLE),\ + echo $(module).enable = yes \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) + $(foreach module,$(BEEEON_GATEWAY_MODULE_DISABLE),\ + echo $(module).enable = no \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) + + $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + + $(if $(CONFIG_BEEEON_GATEWAY_GWS_HOST),\ + echo gws.host = $(CONFIG_BEEEON_GATEWAY_GWS_HOST) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) + $(if $(CONFIG_BEEEON_GATEWAY_GWS_PORT),\ + echo gws.port = $(CONFIG_BEEEON_GATEWAY_GWS_PORT) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) + + $(BEEEON_GATEWAY_ID_INSTALL) + $(BEEEON_GATEWAY_MQTT_INSTALL) + + sed -i "s|/var/cache|/usr/lib|" ${PKG_INSTALL_DIR}/usr/etc/beeeon/gateway/gateway-startup.ini + mkdir -p $(1)/usr/lib/beeeon/gateway + + $(INSTALL_DIR) $(1) + $(CP) -r $(PKG_INSTALL_DIR)/* $(1) + $(RM) -r $(1)/var + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(INIT_SCRIPT_NAME) $(1)/etc/init.d/$(INIT_SCRIPT_NAME) + + $(INSTALL_DIR) $(1)/etc/hotplug.d + $(CP) ./files/beeeon-hotplug-functions $(1)/etc/hotplug.d/beeeon-hotplug-functions + $(INSTALL_DIR) $(1)/etc/hotplug.d/tty + $(CP) ./files/tty-beeeon-dongle $(1)/etc/hotplug.d/tty/30-beeeon-dongle + $(INSTALL_DIR) $(1)/etc/hotplug.d/bluetooth + $(CP) ./files/bluetooth-beeeon-dongle $(1)/etc/hotplug.d/bluetooth/30-beeeon-dongle +endef + +define Package/beeeon-gateway/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Enabling and starting $(PKG_NAME) service" + /etc/init.d/$(INIT_SCRIPT_NAME) enable + /etc/init.d/$(INIT_SCRIPT_NAME) start +fi +exit 0 +endef + +define Package/beeeon-gateway/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Disabling and stopping $(PKG_NAME) service" + /etc/init.d/$(INIT_SCRIPT_NAME) disable + /etc/init.d/$(INIT_SCRIPT_NAME) stop +fi +exit 0 +endef + +$(eval $(call BuildPackage,beeeon-gateway)) diff --git a/net/beeeon-gateway/files/beeeon-gateway b/net/beeeon-gateway/files/beeeon-gateway new file mode 100644 index 0000000..85c354b --- /dev/null +++ b/net/beeeon-gateway/files/beeeon-gateway @@ -0,0 +1,29 @@ +#!/bin/sh /etc/rc.common +# +# BeeeOn Project 2016 +# Author: Matej Postolka +# Last modified: 2016-04-04 +# + +USE_PROCD=1 +START=80 +APP=beeeon-gateway +BINARY_PATH=/usr/bin +CONFIG_PATH=/usr/etc/beeeon/gateway + +registerIniFiles() { + for f in $(ls $CONFIG_PATH/*.ini $CONFIG_PATH/config.d/*.ini $CONFIG_PATH/config.d/*.xml); do + procd_set_param file "$f" + done +} + +start_service() { + mkdir -p /var/run/beeeon/gateway + + procd_open_instance + procd_set_param command ${BINARY_PATH}/${APP} --config=${CONFIG_PATH}/gateway-startup.ini + registerIniFiles() + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} diff --git a/net/beeeon-gateway/files/beeeon-hotplug-functions b/net/beeeon-gateway/files/beeeon-hotplug-functions new file mode 100755 index 0000000..4a457f4 --- /dev/null +++ b/net/beeeon-gateway/files/beeeon-hotplug-functions @@ -0,0 +1,82 @@ +#! /bin/sh + +FIFO_PATH="/var/run/beeeon/gateway.hotplug" +OUTPUT_DATA="" + +propagate_uevents() +{ + PARENT="/sys${3}" + DEVICE="/sys${3}/device" + if [[ -z $OUTPUT_DATA ]]; then + OUTPUT_DATA="ACTION=$ACTION +SUBSYSTEM=${1}" + else + OUTPUT_DATA="ACTION=$ACTION +SUBSYSTEM=${1} +$OUTPUT_DATA" + fi + propagate_device_uevents "${DEVICE}" "${1}" + propagate_parent_uevents "${PARENT}" "${1}" +} + +ensure_pipe_existence() +{ + if [ ! -p "${FIFO_PATH}" ]; then + if [ -f "${FIFO_PATH}" ]; then + rm -f "${FIFO_PATH}" + fi + mkfifo "${FIFO_PATH}" + fi +} + +init_and_propagate_uevents() +{ + ensure_pipe_existence + OUTPUT_DATA=${4} + propagate_uevents "${1}" "${2}" "${3}" + propagate_lines "$OUTPUT_DATA" +} + +propagate_device_uevents() +{ + UEVENT=${1}/uevent + #DEVICE_UEVENT=$(sed 's/^/'${2}'./;' $UEVENT) + DEVICE_UEVENT=$(cat $UEVENT) + OUTPUT_DATA="$OUTPUT_DATA +$DEVICE_UEVENT" +} + +propagate_parent_uevents() +{ + UEVENT=${1}/uevent + #PARENT_UEVENT=$(sed 's/^/'${2}'./;' $UEVENT) + PARENT_UEVENT=$(cat $UEVENT) + OUTPUT_DATA="$OUTPUT_DATA +$PARENT_UEVENT" + UEVENT_CONTENT=$(cat $UEVENT) + if [[ -z "${UEVENT_CONTENT##*DEVNAME*}" ]] && [[ -z "${UEVENT_CONTENT##*MAJOR*}" ]] && [[ -z "${UEVENT_CONTENT##*MINOR*}" ]]; then + check_major_minor "$UEVENT" "${2}" + fi +} + +check_major_minor() +{ + DEVICE_NAME=$(cat ${1} | grep "DEVNAME" | cut -c 9-) + MAJOR_NUMBER_ORIG=$(ls -l /dev | grep $DEVICE_NAME | tr -s ' ' | cut -f5 -d" " | tr -d ,) + MINOR_NUMBER_ORIG=$(ls -l /dev | grep $DEVICE_NAME | tr -s ' ' | cut -f6 -d" ") + MAJOR_NUMBER_HOTPLUG=$(cat ${1} | grep "MAJOR" | cut -c 7-) + MINOR_NUMBER_HOTPLUG=$(cat ${1} | grep "MINOR" | cut -c 7-) + if [ "$MAJOR_NUMBER_ORIG" = "$MAJOR_NUMBER_HOTPLUG" ] && [ "$MINOR_NUMBER_ORIG" = "$MINOR_NUMBER_HOTPLUG" ]; then + OUTPUT_DATA="$OUTPUT_DATA +NODE=/dev/$DEVICE_NAME" + fi +} + +propagate_lines() +{ + ensure_pipe_existence + cat <<__EOF >"${FIFO_PATH}" +${1} + +__EOF +} diff --git a/net/beeeon-gateway/files/bluetooth-beeeon-dongle b/net/beeeon-gateway/files/bluetooth-beeeon-dongle new file mode 100644 index 0000000..a918a45 --- /dev/null +++ b/net/beeeon-gateway/files/bluetooth-beeeon-dongle @@ -0,0 +1,31 @@ +#! /bin/sh + +. /etc/hotplug.d/beeeon-hotplug-functions + +if [[ -n "$DEVPATH" ]] && [[ $ACTION == "add" ]]; then + if [ "$DEVTYPE" = "host" ]; then + OUTPUT_LINES='bluetooth.BEEEON_DONGLE="bluetooth"' + fi + DEVICE_UEVENT="/sys$DEVPATH/device/uevent" + UEVENT_CONTENT=$(cat $DEVICE_UEVENT) + if [[ -z "${UEVENT_CONTENT##*PRODUCT*}" ]]; then + idVendor=$(cat $DEVICE_UEVENT | grep "PRODUCT" | cut -c 9-12) + idProduct=$(cat $DEVICE_UEVENT | grep "PRODUCT" | cut -c 14-17) + OUTPUT_LINES="$OUTPUT_LINES +idVendor=$idVendor +idProduct=$idProduct" + fi + init_and_propagate_uevents "$SUBSYSTEM" "$ACTION" "$DEVPATH" "$OUTPUT_LINES" +fi + +if [[ $ACTION == "remove" ]]; then + OUTPUT_LINES="ACTION=remove +SUBSYSTEM=$SUBSYSTEM +NAME=$DEVICENAME +DEVPATH=$DEVPATH" + if [ "$DEVTYPE" = "host" ]; then + OUTPUT_LINES="$OUTPUT_LINES +bluetooth.BEEEON_DONGLE=\"bluetooth\"" + fi + propagate_lines "$OUTPUT_LINES" +fi diff --git a/net/beeeon-gateway/files/tty-beeeon-dongle b/net/beeeon-gateway/files/tty-beeeon-dongle new file mode 100644 index 0000000..b2ddde2 --- /dev/null +++ b/net/beeeon-gateway/files/tty-beeeon-dongle @@ -0,0 +1,55 @@ +#! /bin/sh + +. /etc/hotplug.d/beeeon-hotplug-functions + +usb_vendor_id() +{ + awk -F'[=/]' '/^PRODUCT/ {print $2}' < "${1}" \ + | sed -e 's/^.$/000&/' -e 's/^..$/00&/' -e 's/^...$/0&/' +} + +usb_product_id() +{ + awk -F'[=/]' '/^PRODUCT/ {print $3}' < "${1}" \ + | sed -e 's/^.$/000&/' -e 's/^..$/00&/' -e 's/^...$/0&/' +} + +if [[ -n "$DEVPATH" ]] && [[ $SUBSYSTEM != "usb-serial" ]] && [[ $ACTION == "add" ]]; then + DEVICE_UEVENT="/sys$DEVPATH/device/uevent" + UEVENT_CONTENT=$(cat $DEVICE_UEVENT) + if [[ -z "${UEVENT_CONTENT##*PRODUCT*}" ]]; then + idVendor=`usb_vendor_id "${DEVICE_UEVENT}"` + idProduct=`usb_product_id "${DEVICE_UEVENT}"` + OUTPUT_DATA="idVendor=$idVendor +idProduct=$idProduct" + case "${idVendor}-${idProduct}" in + "0403-6015") + OUTPUT_DATA="$OUTPUT_DATA +tty.BEEEON_DONGLE=jablotron" + ;; + "0658-0200") + OUTPUT_DATA="$OUTPUT_DATA +tty.BEEEON_DONGLE=zwave" + ;; + esac + fi + init_and_propagate_uevents "$SUBSYSTEM" "$ACTION" "$DEVPATH" "$OUTPUT_DATA" +fi + +if [[ $SUBSYSTEM != "usb-serial" ]] && [[ $ACTION == "remove" ]]; then + if [ -n "$DEVNAME" ]; then + OUTPUT_DATA="DEVNAME=$DEVNAME +NODE=/dev/$DEVNAME" + fi + if [ -n "$MAJOR" ]; then + OUTPUT_DATA="$OUTPUT_DATA +MAJOR=$MAJOR +MINOR=$MINOR" + fi + DATA_TO_OUTPUT="ACTION=remove +SUBSYSTEM=$SUBSYSTEM +DEVNAME=$DEVICENAME +DEVPATH=$DEVPATH +$OUTPUT_DATA" + propagate_lines "$DATA_TO_OUTPUT" +fi diff --git a/net/beeeon/beeeon-gateway b/net/beeeon/beeeon-gateway deleted file mode 120000 index 91012f3..0000000 --- a/net/beeeon/beeeon-gateway +++ /dev/null @@ -1 +0,0 @@ -../../../feeds/beeeon/beeeon-gateway \ No newline at end of file From 37247d41923ad2869d2677f5de6265a93d3ed04d Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor <40665304+jalowiczor@users.noreply.github.com> Date: Mon, 4 Nov 2019 10:56:18 +0100 Subject: [PATCH 03/26] Update .travis.yml Poco library added from official OpenWRT feed. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index f988e9d..60c9504 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,9 @@ script: - echo "src-cpy nemea $SRC_PATH" > feeds.conf - ./scripts/feeds update - ./scripts/feeds install -a + - echo "src-git packages https://github.com/openwrt/packages.git^3a2c97600f051ba47f9aa83a121f3de09f567480" > feeds.conf + - ./scripts/feeds update packages poco + - ./scripts/feeds install -p packages poco - make -j8 && { mkdir -p $HOME/dist-pkgs/turris-omnia; cp -r bin/*/packages $HOME/dist-pkgs/turris-omnia; true;} || make -j1 V=s - cd "$HOME/openwrt-sdk-turris" - echo "src-cpy nemea $SRC_PATH" > feeds.conf From 4d7e8607825bf4d6f23d6ca8c1bfb70c104a0a2b Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor <40665304+jalowiczor@users.noreply.github.com> Date: Mon, 4 Nov 2019 13:56:02 +0100 Subject: [PATCH 04/26] Update .travis.yml Glib2 added --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 60c9504..f21d33e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,9 @@ script: - echo "src-git packages https://github.com/openwrt/packages.git^3a2c97600f051ba47f9aa83a121f3de09f567480" > feeds.conf - ./scripts/feeds update packages poco - ./scripts/feeds install -p packages poco + - echo "src-git turrispackages https://gitlab.labs.nic.cz/turris/turris-os-packages.git^6b0685fce4816e5c20cd0f6eacf5e37166c87c74" > feeds.conf + - ./scripts/feeds update turrispackages glib2 + - ./scripts/feeds install -p turrispackages glib2 - make -j8 && { mkdir -p $HOME/dist-pkgs/turris-omnia; cp -r bin/*/packages $HOME/dist-pkgs/turris-omnia; true;} || make -j1 V=s - cd "$HOME/openwrt-sdk-turris" - echo "src-cpy nemea $SRC_PATH" > feeds.conf From 5ce101c89a593357b0468970d836c2171f819a05 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 5 Nov 2019 03:54:50 -0500 Subject: [PATCH 05/26] Makefile polishing --- net/beeeon-gateway/Config.in | 195 ----------------------------------- net/beeeon-gateway/Makefile | 69 ++----------- 2 files changed, 9 insertions(+), 255 deletions(-) diff --git a/net/beeeon-gateway/Config.in b/net/beeeon-gateway/Config.in index ab9f175..7ad3099 100644 --- a/net/beeeon-gateway/Config.in +++ b/net/beeeon-gateway/Config.in @@ -95,199 +95,4 @@ comment "You may need to select kmod-usb-acm to support UART-over-USB." depends on BEEEON_GATEWAY_USB_UART_RECOMMENDED depends on !BEEEON_GATEWAY_HAS_KMOD_USB_ACM -config BEEEON_GATEWAY_BELKIN_WEMO - bool "Belkin Wemo" - default n - help - Enable support of Belkin Wemo devices connected - over LAN or WLAN. - -config BEEEON_GATEWAY_HAS_BLUEZ_DAEMON - bool - default y if PACKAGE_bluez-daemon - default n - -config BEEEON_GATEWAY_HAS_BLUEZ_LIBS - bool - default y if PACKAGE_bluez-libs - -config BEEEON_GATEWAY_HAS_GLIB2 - bool - default y if PACKAGE_glib2 - default n - -config BEEEON_GATEWAY_BLE_SMART - bool "Bluetooth LE Smart" - depends on BEEEON_GATEWAY_HAS_GLIB2 - depends on BEEEON_GATEWAY_HAS_BLUEZ_LIBS - depends on BEEEON_GATEWAY_HAS_BLUEZ_DAEMON - default n - help - Enable support of Bluetooth Low Energy Smart - devices. It is possible to measure data or - control certain devices. - -comment "BLE Smart requires bluez-daemon, bluez-lib and glib2" - depends on !BEEEON_GATEWAY_HAS_GLIB2 - depends on !BEEEON_GATEWAY_HAS_BLUEZ_LIBS - depends on !BEEEON_GATEWAY_HAS_BLUEZ_DAEMON - -config BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY - bool "Bluetooth Availability" - depends on BEEEON_GATEWAY_HAS_BLUEZ_LIBS - default n - help - Enable support of availability detection module. - It tells whether a Bluetooth device is available - or not. - -comment "Bluetooth Availability requires bluez-libs" - depends on !BEEEON_GATEWAY_HAS_BLUEZ_LIBS - -config BEEEON_GATEWAY_HCI_INFO_REPORTER - bool "HciInfo Reporter" - depends on BEEEON_GATEWAY_HAS_BLUEZ_LIBS - default n - help - Enable support of HciInfoReporter instance. It periodically - reports information about HCI nodes available in the system. - -comment "HciInfo Reporter requires bluez-libs" - depends on !BEEEON_GATEWAY_HAS_BLUEZ_LIBS - -config BEEEON_GATEWAY_FITP - bool "BUT FIT IoT Protocol" - default n - help - Enable support of the experimental FITP protocol - develped at Brno University of Technology. This - might require appropriate SPI drivers in the kernel. - -config BEEEON_GATEWAY_IQRF - bool "IQRF" - default n - help - Enable support of IQRF. This might require appropriate - USB or UART drivers in the kernel. - -config BEEEON_GATEWAY_JABLOTRON - bool "Jablotron Turris Gadgets" - default n - help - Enable support of Turris Gadgets. This might require - appropriate USB or UART drivers in the kernel. - -config BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP - bool - default y if PACKAGE_libmosquittopp - default n - -comment "MQTT exporter requires libmosquittopp" - depends on !BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP - -config BEEEON_GATEWAY_MQTT_EXPORTER - bool "Exporting data via MQTT" - depends on BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP - default n - help - Enable exporting data over MQTT via mosquitto. - -menu "MQTT Exporter settings" - depends on BEEEON_GATEWAY_MQTT_EXPORTER - -config BEEEON_GATEWAY_MQTT_EXPORTER_HOST - string "MQTT host" - default "127.0.0.1" - -config BEEEON_GATEWAY_MQTT_EXPORTER_PORT - int "MQTT port" - default 1883 - range 1 65535 - -config BEEEON_GATEWAY_MQTT_EXPORTER_TOPIC - string "MQTT topic" - default "BeeeOnOut" - -config BEEEON_GATEWAY_MQTT_EXPORTER_CLIENT_ID - string "MQTT client ID" - default "Gateway" - -endmenu - -config BEEEON_GATEWAY_PHILIPS_HUE - bool "Philips Hue" - default n - help - Enable support of Philips Hue devices connected - over LAN or WLAN. - -config BEEEON_GATEWAY_PRESSURE_SENSOR - bool "On-board pressure sensor" - default n - help - Enable support of pressure sensor read from - sysfs of the local system. - -config BEEEON_GATEWAY_PRESSURE_SENSOR_PATH - string "sysfs path to pressure sensor" - depends on BEEEON_GATEWAY_PRESSURE_SENSOR - default "" - help - Path to the sysfs entry where the pressure input can - be access and read. Example: - - /sys/devices/platform/soc@01c00000/1c2b400.i2c/i2c-2/2-0077/iio:device0/in_pressure_input - -config BEEEON_GATEWAY_VIRTUAL_DEVICES - bool "Virtual Devices (testing)" - default n - help - Enable support of virtual devices. This feature - is intended for testing. Virtual devices can - emulate real sensors. - -config BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG - string "path to custom virtual-devices.ini" - depends on BEEEON_GATEWAY_VIRTUAL_DEVICES - default "" - help - Path to a custom configuration file for virtual - devices. Leave empty to use the default one. - -config BEEEON_GATEWAY_VPT - bool "Thermona VPT" - default n - help - Enable support of Thermona VPT connected over - LAN or WLAN. - -config BEEEON_GATEWAY_ZWAVE - bool "ZWave" - default n - help - Enable support of Z-Wave. This might require appropriate - USB or UART drivers in the kernel. - -config BEEEON_GATEWAY_TESTING_CENTER - bool "Testing Center (testing)" - default n - help - Enable support for component TestingCenter which - is useful for debugging. It opens a local TCP - textual console at port 6000. - -config BEEEON_GATEWAY_TESTING_COLLECTOR - bool "Testing Collector (testing)" - default n - help - Enable support for component LoggingCollector which - is useful for debugging by looking for logs of some - internal gateway events. - -config BEEEON_GATEWAY_NEMEA - bool "Collecting & exporting data with NemeaCollector" - default y - help - Enable usage of NemeaCollector. - endmenu diff --git a/net/beeeon-gateway/Makefile b/net/beeeon-gateway/Makefile index 60fe13d..c50eba4 100644 --- a/net/beeeon-gateway/Makefile +++ b/net/beeeon-gateway/Makefile @@ -19,10 +19,11 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/BeeeOn/gateway.git PKG_SOURCE_VERSION:=7328b4377efcba98d1fef25372f2d2d6a7e685f0 -BUILD_DIR:=$(TOPDIR)/build_dir/turris -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_BUILD_DIR:=${BUILD_DIR}/${PKG_SOURCE_SUBDIR} +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_MAINTAINER:=Jakub Jalowiczor +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 @@ -77,70 +78,18 @@ PKG_BUILD_DEPENDS += BEEEON_GATEWAY_MQTT_EXPORTER:mosquitto #endif define Package/beeeon-gateway + SECTION:=utils + CATEGORY:=Utilities TITLE:=BeeeOn Gateway - SECTION:=cesnet - CATEGORY:=CESNET + URL:=https://beeeon.github.io/gateway/ DEPENDS:=+poco-all - MAINTAINER:=Jan Viktorin - DEPENDS += +bluez-daemon +bluez-libs +glib2 +libmosquittopp +nemea-framework +libpcap +openzwave-config +libopenzwave endef define Package/beeeon-gateway/description - Main application for BeeeOn Gateway. + Main application for BeeeOn Gateway. endef -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_BELKIN_WEMO),belkinwemo) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_BELKIN_WEMO),,belkinwemo) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLE_SMART),blesmart) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLE_SMART),,blesmart) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY),bluetooth.availability) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY),,bluetooth.availability) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_HCI_INFO_REPORTER),bluetooth.reporting) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_HCI_INFO_REPORTER),,bluetooth.reporting) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_FITP),fitp) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_FITP),,fitp) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_IQRF),iqrf) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_IQRF),,iqrf) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_JABLOTRON),jablotron) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_JABLOTRON),,jablotron) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),exporter.mqtt) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),,exporter.mqtt) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_PHILIPS_HUE),philipshue) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_PHILIPS_HUE),,philipshue) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR),psdev) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR),,psdev) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES),vdev) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES),,vdev) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_VPT),vpt) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_VPT),,vpt) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_ZWAVE),zwave) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_ZWAVE),,zwave) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_CENTER),testing.center) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_CENTER),,testing.center) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_COLLECTOR),testing.collector) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_TESTING_COLLECTOR),,testing.collector) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_NEMEA_COLLECTOR),nemea) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_NEMEA_COLLECTOR),,nemea) - -#BEEEON_GATEWAY_MODULE_ENABLE += $(if $(CONFIG_BEEEON_GATEWAY_GWS),gws) -#BEEEON_GATEWAY_MODULE_DISABLE += $(if $(CONFIG_BEEEON_GATEWAY_GWS),,gws) - BEEEON_GATEWAY_MODULE_ENABLE += belkinwemo \ blesmart \ bluetooth.availability \ From 0c00d3931e0428e308bd0a2043c0764757e23bbd Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 5 Nov 2019 04:51:19 -0500 Subject: [PATCH 06/26] Makefile polishing. --- net/beeeon-gateway/Makefile | 209 ++++++++++++++++++++++++++---------- 1 file changed, 152 insertions(+), 57 deletions(-) diff --git a/net/beeeon-gateway/Makefile b/net/beeeon-gateway/Makefile index c50eba4..ac720ea 100644 --- a/net/beeeon-gateway/Makefile +++ b/net/beeeon-gateway/Makefile @@ -27,30 +27,55 @@ PKG_LICENSE_FILES:=LICENSE PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 +BUILD_DIR:=$(TOPDIR)/build_dir/turris +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(_PKG_VERSION) include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -CMAKE_OPTIONS += \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DENABLE_TESTS=OFF \ - -DENABLE_UDEV=OFF \ - -DENABLE_BELKIN_WEMO=ON \ - -DENABLE_BLE_SMART=ON \ - -DENABLE_BLUETOOTH_AVAILABILITY=ON \ - -DENABLE_HCI_INFO_REPORTER=ON \ - -DENABLE_FITP=OFF \ - -DENABLE_IQRF=ON \ - -DENABLE_JABLOTRON=ON \ - -DENABLE_PHILIPS_HUE=ON \ - -DENABLE_VEKTIVA=ON \ - -DENABLE_PRESSURE_SENSOR=ON \ - -DENABLE_VIRTUAL_DEVICES=ON \ - -DENABLE_VPT=ON \ - -DENABLE_ZWAVE=ON \ - -DENABLE_TESTING_CENTER=ON \ - -DENABLE_NEMEA=ON +ifeq ($(BUILD_VARIANT),all) + CMAKE_OPTIONS += \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DENABLE_TESTS=OFF \ + -DENABLE_UDEV=OFF \ + -DENABLE_BELKIN_WEMO=ON \ + -DENABLE_BLE_SMART=ON \ + -DENABLE_BLUETOOTH_AVAILABILITY=ON \ + -DENABLE_HCI_INFO_REPORTER=ON \ + -DENABLE_FITP=OFF \ + -DENABLE_IQRF=ON \ + -DENABLE_JABLOTRON=ON \ + -DENABLE_PHILIPS_HUE=ON \ + -DENABLE_VEKTIVA=ON \ + -DENABLE_PRESSURE_SENSOR=ON \ + -DENABLE_VIRTUAL_DEVICES=ON \ + -DENABLE_VPT=ON \ + -DENABLE_ZWAVE=ON \ + -DENABLE_TESTING_CENTER=ON \ + -DENABLE_NEMEA=ON +else + CMAKE_OPTIONS += \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DENABLE_TESTS=OFF \ + -DENABLE_UDEV=OFF \ + -DENABLE_BELKIN_WEMO=OFF \ + -DENABLE_BLE_SMART=OFF \ + -DENABLE_BLUETOOTH_AVAILABILITY=OFF \ + -DENABLE_HCI_INFO_REPORTER=OFF \ + -DENABLE_FITP=OFF \ + -DENABLE_IQRF=OFF \ + -DENABLE_JABLOTRON=OFF \ + -DENABLE_PHILIPS_HUE=OFF \ + -DENABLE_VEKTIVA=OFF \ + -DENABLE_PRESSURE_SENSOR=ON \ + -DENABLE_VIRTUAL_DEVICES=ON \ + -DENABLE_VPT=OFF \ + -DENABLE_ZWAVE=OFF \ + -DENABLE_TESTING_CENTER=ON \ + -DENABLE_NEMEA=OFF +endif TARGET_CXXFLAGS += -DPOCO_NO_FPENVIRONMENT @@ -58,54 +83,71 @@ define Package/beeeon-gateway/config source "$(SOURCE)/Config.in" endef -PKG_BUILD_DEPENDS += +poco-all python3/host +glib2 +bluez +openzwave -PKG_BUILD_DEPENDS += BEEEON_GATEWAY_MQTT_EXPORTER:mosquitto - -#ifeq ($(CONFIG_BEEEON_GATEWAY_BLE_SMART),y) -#_IPKG_DEPENDS += +bluez-daemon +bluez-libs +glib2 -#endif - -#ifeq ($(CONFIG_BEEEON_GATEWAY_BLUETOOTH_AVAILABILITY),y) -#_IPKG_DEPENDS += +bluez-libs +glib2 -#endif +ifeq ($(BUILD_VARIANT),all) + PKG_BUILD_DEPENDS += +poco-all python3/host +glib2 +bluez +openzwave +mosquitto +else + PKG_BUILD_DEPENDS += +poco-all python3/host +endif -#ifeq ($(CONFIG_BEEEON_GATEWAY_HCI_INFO_REPORTER),y) -#_IPKG_DEPENDS += +bluez-libs +glib2 -#endif +define Package/beeeon-gateway + SECTION:=utils + CATEGORY:=Utilities + TITLE:=BeeeOn Gateway + URL:=https://beeeon.github.io/gateway/ + DEPENDS:=+poco-all + VARIANT:=minimal +endef -#ifeq ($(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),y) -#_IPKG_DEPENDS += +libmosquittopp -#endif +define Package/beeeon-gateway/description + The main application for BeeeOn Gateway with all modules disabled. +endef -define Package/beeeon-gateway +define Package/beeeon-gateway-all SECTION:=utils CATEGORY:=Utilities TITLE:=BeeeOn Gateway URL:=https://beeeon.github.io/gateway/ DEPENDS:=+poco-all DEPENDS += +bluez-daemon +bluez-libs +glib2 +libmosquittopp +nemea-framework +libpcap +openzwave-config +libopenzwave + VARIANT:=all endef -define Package/beeeon-gateway/description - Main application for BeeeOn Gateway. +define Package/beeeon-gateway-all/description + The main application for BeeeOn Gateway with all modules enabled. endef -BEEEON_GATEWAY_MODULE_ENABLE += belkinwemo \ - blesmart \ - bluetooth.availability \ - bluetooth.reporting \ - iqrf jablotron \ - exporter.mqtt \ - philipshue \ - psdev \ +BEEEON_GATEWAY_MODULE_ENABLE += psdev \ vdev \ - vpt \ - zwave \ testing.center \ testing.collector \ - nemea \ gws +ifeq ($(BUILD_VARIANT),all) + BEEEON_GATEWAY_MODULE_ENABLE += belkinwemo \ + blesmart \ + bluetooth.availability \ + bluetooth.reporting \ + iqrf \ + jablotron \ + exporter.mqtt \ + philipshue \ + vpt \ + zwave \ + nemea +else + BEEEON_GATEWAY_MODULE_DISABLE += belkinwemo \ + blesmart \ + bluetooth.availability \ + bluetooth.reporting \ + iqrf \ + jablotron \ + exporter.mqtt \ + philipshue \ + vpt \ + zwave \ + nemea +endif + # Generate random BeeeOn Gateway ID ifeq ($(CONFIG_BEEEON_GATEWAY_ID_RANDOM),y) BEEEON_GATEWAY_MODULE_ENABLE += gateway.id @@ -161,14 +203,47 @@ endef endif define Package/beeeon-gateway/install - $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH),\ - echo psdev.path = $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH) \ - > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-pressure-sensor.properties) + echo hotplug.impl = pipeHotplug \ + > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-hotplug.properties - $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG),\ - $(CP) $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG) \ - $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/virtual-devices.ini) + $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties + $(foreach module,$(BEEEON_GATEWAY_MODULE_ENABLE),\ + echo $(module).enable = yes \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) + $(foreach module,$(BEEEON_GATEWAY_MODULE_DISABLE),\ + echo $(module).enable = no \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) + + $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + + $(if $(CONFIG_BEEEON_GATEWAY_GWS_HOST),\ + echo gws.host = $(CONFIG_BEEEON_GATEWAY_GWS_HOST) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) + $(if $(CONFIG_BEEEON_GATEWAY_GWS_PORT),\ + echo gws.port = $(CONFIG_BEEEON_GATEWAY_GWS_PORT) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) + + $(BEEEON_GATEWAY_ID_INSTALL) + sed -i "s|/var/cache|/usr/lib|" ${PKG_INSTALL_DIR}/usr/etc/beeeon/gateway/gateway-startup.ini + mkdir -p $(1)/usr/lib/beeeon/gateway + + $(INSTALL_DIR) $(1) + $(CP) -r $(PKG_INSTALL_DIR)/* $(1) + $(RM) -r $(1)/var + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(INIT_SCRIPT_NAME) $(1)/etc/init.d/$(INIT_SCRIPT_NAME) + + $(INSTALL_DIR) $(1)/etc/hotplug.d + $(CP) ./files/beeeon-hotplug-functions $(1)/etc/hotplug.d/beeeon-hotplug-functions + $(INSTALL_DIR) $(1)/etc/hotplug.d/tty + $(CP) ./files/tty-beeeon-dongle $(1)/etc/hotplug.d/tty/30-beeeon-dongle + $(INSTALL_DIR) $(1)/etc/hotplug.d/bluetooth + $(CP) ./files/bluetooth-beeeon-dongle $(1)/etc/hotplug.d/bluetooth/30-beeeon-dongle +endef + +define Package/beeeon-gateway-all/install echo hotplug.impl = pipeHotplug \ > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-hotplug.properties @@ -190,7 +265,6 @@ define Package/beeeon-gateway/install >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) $(BEEEON_GATEWAY_ID_INSTALL) - $(BEEEON_GATEWAY_MQTT_INSTALL) sed -i "s|/var/cache|/usr/lib|" ${PKG_INSTALL_DIR}/usr/etc/beeeon/gateway/gateway-startup.ini mkdir -p $(1)/usr/lib/beeeon/gateway @@ -220,6 +294,16 @@ fi exit 0 endef +define Package/beeeon-gateway-all/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Enabling and starting $(PKG_NAME) service" + /etc/init.d/$(INIT_SCRIPT_NAME) enable + /etc/init.d/$(INIT_SCRIPT_NAME) start +fi +exit 0 +endef + define Package/beeeon-gateway/prerm #!/bin/sh if [ -z "$${IPKG_INSTROOT}" ]; then @@ -230,4 +314,15 @@ fi exit 0 endef +define Package/beeeon-gateway-all/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Disabling and stopping $(PKG_NAME) service" + /etc/init.d/$(INIT_SCRIPT_NAME) disable + /etc/init.d/$(INIT_SCRIPT_NAME) stop +fi +exit 0 +endef + $(eval $(call BuildPackage,beeeon-gateway)) +$(eval $(call BuildPackage,beeeon-gateway-all)) From b635fc3defca8a2e99da471bf34c46a074b77b29 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 5 Nov 2019 06:09:48 -0500 Subject: [PATCH 07/26] Makefile polishing. --- net/beeeon-gateway/Makefile | 38 ++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/net/beeeon-gateway/Makefile b/net/beeeon-gateway/Makefile index ac720ea..3f8d164 100644 --- a/net/beeeon-gateway/Makefile +++ b/net/beeeon-gateway/Makefile @@ -28,7 +28,7 @@ PKG_LICENSE_FILES:=LICENSE PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 BUILD_DIR:=$(TOPDIR)/build_dir/turris -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(_PKG_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -83,18 +83,23 @@ define Package/beeeon-gateway/config source "$(SOURCE)/Config.in" endef +define Package/beeeon-gateway-all/config + source "$(SOURCE)/Config.in" +endef + +PKG_BUILD_DEPENDS += +poco-all python3/host +mosquitto + ifeq ($(BUILD_VARIANT),all) - PKG_BUILD_DEPENDS += +poco-all python3/host +glib2 +bluez +openzwave +mosquitto -else - PKG_BUILD_DEPENDS += +poco-all python3/host + PKG_BUILD_DEPENDS += +glib2 +bluez +openzwave endif define Package/beeeon-gateway SECTION:=utils CATEGORY:=Utilities - TITLE:=BeeeOn Gateway + TITLE:=BeeeOn Gateway (minimal version) URL:=https://beeeon.github.io/gateway/ DEPENDS:=+poco-all + DEPENDS += +libmosquittopp VARIANT:=minimal endef @@ -105,7 +110,7 @@ endef define Package/beeeon-gateway-all SECTION:=utils CATEGORY:=Utilities - TITLE:=BeeeOn Gateway + TITLE:=BeeeOn Gateway (version with all modules enabled) URL:=https://beeeon.github.io/gateway/ DEPENDS:=+poco-all DEPENDS += +bluez-daemon +bluez-libs +glib2 +libmosquittopp +nemea-framework +libpcap +openzwave-config +libopenzwave @@ -120,6 +125,7 @@ BEEEON_GATEWAY_MODULE_ENABLE += psdev \ vdev \ testing.center \ testing.collector \ + exporter.mqtt \ gws ifeq ($(BUILD_VARIANT),all) @@ -129,23 +135,21 @@ ifeq ($(BUILD_VARIANT),all) bluetooth.reporting \ iqrf \ jablotron \ - exporter.mqtt \ philipshue \ vpt \ zwave \ nemea else BEEEON_GATEWAY_MODULE_DISABLE += belkinwemo \ - blesmart \ - bluetooth.availability \ - bluetooth.reporting \ - iqrf \ - jablotron \ - exporter.mqtt \ - philipshue \ - vpt \ - zwave \ - nemea + blesmart \ + bluetooth.availability \ + bluetooth.reporting \ + iqrf \ + jablotron \ + philipshue \ + vpt \ + zwave \ + nemea endif # Generate random BeeeOn Gateway ID From 5e857d0f361f43a72b6b3661421f49eb9f7a2b52 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 5 Nov 2019 07:14:43 -0500 Subject: [PATCH 08/26] beeeon-gateway moved from net to utils directory --- {net => utils}/beeeon-gateway/Config.in | 0 {net => utils}/beeeon-gateway/Makefile | 0 utils/beeeon-gateway/Makefile.save | 258 ++++++++++++++++++ .../beeeon-gateway/files/beeeon-gateway | 0 .../files/beeeon-hotplug-functions | 0 .../files/bluetooth-beeeon-dongle | 0 .../beeeon-gateway/files/tty-beeeon-dongle | 0 7 files changed, 258 insertions(+) rename {net => utils}/beeeon-gateway/Config.in (100%) rename {net => utils}/beeeon-gateway/Makefile (100%) create mode 100644 utils/beeeon-gateway/Makefile.save rename {net => utils}/beeeon-gateway/files/beeeon-gateway (100%) rename {net => utils}/beeeon-gateway/files/beeeon-hotplug-functions (100%) rename {net => utils}/beeeon-gateway/files/bluetooth-beeeon-dongle (100%) rename {net => utils}/beeeon-gateway/files/tty-beeeon-dongle (100%) diff --git a/net/beeeon-gateway/Config.in b/utils/beeeon-gateway/Config.in similarity index 100% rename from net/beeeon-gateway/Config.in rename to utils/beeeon-gateway/Config.in diff --git a/net/beeeon-gateway/Makefile b/utils/beeeon-gateway/Makefile similarity index 100% rename from net/beeeon-gateway/Makefile rename to utils/beeeon-gateway/Makefile diff --git a/utils/beeeon-gateway/Makefile.save b/utils/beeeon-gateway/Makefile.save new file mode 100644 index 0000000..0483f66 --- /dev/null +++ b/utils/beeeon-gateway/Makefile.save @@ -0,0 +1,258 @@ +# +# Copyright (c) 2016, 2017, Brno University of Technology +# +# This is free software, licensed under the BSD-3-Clause. +# +# This file is based on +# https://github.com/BeeeOn/openwrt-packages/tree/master/beeeon-gateway +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=beeeon-gateway +PKG_VERSION:=v2019.7.1 +PKG_RELEASE:=1 +INIT_SCRIPT_NAME:=$(PKG_NAME) + + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/BeeeOn/gateway.git +PKG_SOURCE_VERSION:=7328b4377efcba98d1fef25372f2d2d6a7e685f0 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_MAINTAINER:=Jakub Jalowiczor +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE + +PKG_BUILD_PARALLEL:=1 +CMAKE_INSTALL:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(_PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +ifeq ($(BUILD_VARIANT),all) + CMAKE_OPTIONS += \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DENABLE_TESTS=OFF \ + -DENABLE_UDEV=OFF \ + -DENABLE_BELKIN_WEMO=ON \ + -DENABLE_BLE_SMART=ON \ + -DENABLE_BLUETOOTH_AVAILABILITY=ON \ + -DENABLE_HCI_INFO_REPORTER=ON \ + -DENABLE_FITP=OFF \ + -DENABLE_IQRF=ON \ + -DENABLE_JABLOTRON=ON \ + -DENABLE_PHILIPS_HUE=ON \ + -DENABLE_VEKTIVA=ON \ + -DENABLE_PRESSURE_SENSOR=ON \ + -DENABLE_VIRTUAL_DEVICES=ON \ + -DENABLE_VPT=ON \ + -DENABLE_ZWAVE=ON \ + -DENABLE_TESTING_CENTER=ON \ + -DENABLE_NEMEA=ON +else + CMAKE_OPTIONS += \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DENABLE_TESTS=OFF \ + -DENABLE_UDEV=OFF \ + -DENABLE_BELKIN_WEMO=OFF \ + -DENABLE_BLE_SMART=OFF \ + -DENABLE_BLUETOOTH_AVAILABILITY=OFF \ + -DENABLE_HCI_INFO_REPORTER=OFF \ + -DENABLE_FITP=OFF \ + -DENABLE_IQRF=OFF \ + -DENABLE_JABLOTRON=OFF \ + -DENABLE_PHILIPS_HUE=OFF \ + -DENABLE_VEKTIVA=OFF \ + -DENABLE_PRESSURE_SENSOR=ON \ + -DENABLE_VIRTUAL_DEVICES=ON \ + -DENABLE_VPT=OFF \ + -DENABLE_ZWAVE=OFF \ + -DENABLE_TESTING_CENTER=ON \ + -DENABLE_NEMEA=OFF +endif + +TARGET_CXXFLAGS += -DPOCO_NO_FPENVIRONMENT + +define Package/beeeon-gateway/config + source "$(SOURCE)/Config.in" +endef + +ifeq ($(BUILD_VARIANT),all) + PKG_BUILD_DEPENDS += +poco-all python3/host +glib2 +bluez +openzwave +mosquitto +else + PKG_BUILD_DEPENDS += +poco-all python3/host +endif + +define Package/beeeon-gateway + SECTION:=utils + CATEGORY:=Utilities + TITLE:=BeeeOn Gateway + URL:=https://beeeon.github.io/gateway/ + DEPENDS:=+poco-all + VARIANT:=minimal +endef + +define Package/beeeon-gateway/description + The main application for BeeeOn Gateway with all modules disabled. +endef + +define Package/beeeon-gateway-all + SECTION:=utils + CATEGORY:=Utilities + TITLE:=BeeeOn Gateway + URL:=https://beeeon.github.io/gateway/ + DEPENDS:=+poco-all + DEPENDS += +bluez-daemon +bluez-libs +glib2 +libmosquittopp +nemea-framework +libpcap +openzwave-config +libopenzwave + VARIANT:=all +endef + +define Package/beeeon-gateway-all/description + The main application for BeeeOn Gateway with all modules enabled. +endef + +BEEEON_GATEWAY_MODULE_ENABLE += belkinwemo \ + blesmart \ + bluetooth.availability \ + bluetooth.reporting \ + iqrf jablotron \ + exporter.mqtt \ + philipshue \ + psdev \ + vdev \ + vpt \ + zwave \ + testing.center \ + testing.collector \ + nemea \ + gws + +# Generate random BeeeOn Gateway ID +ifeq ($(CONFIG_BEEEON_GATEWAY_ID_RANDOM),y) +BEEEON_GATEWAY_MODULE_ENABLE += gateway.id + +define BEEEON_GATEWAY_ID_INSTALL + echo gateway.id = `python3 $(PKG_BUILD_DIR)/tools/gateway-genid.py` \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.key = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.certificate = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties +endef +endif + +# Configure the manually inserted BeeeOn Gateway ID +ifeq ($(CONFIG_BEEEON_GATEWAY_ID_CUSTOM),y) +BEEEON_GATEWAY_MODULE_ENABLE += gateway.id + +define BEEEON_GATEWAY_ID_INSTALL + echo gateway.id = $(CONFIG_BEEEON_GATEWAY_ID_CUSTOM_VALUE) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.key = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + echo ssl.certificate = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties +endef +endif + +# Use SSL/TLS to provide BeeeOn Gateway ID +ifeq ($(CONFIG_BEEEON_GATEWAY_ID_CERT),y) +BEEEON_GATEWAY_MODULE_DISABLE += gateway.id + +define BEEEON_GATEWAY_ID_INSTALL + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc/ssl/beeeon/private + $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_PKEY) \ + $(PKG_INSTALL_DIR)/etc/ssl/beeeon/private/beeeon_gateway.key + + $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs + $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_FILE) \ + $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs/beeeon_gateway.crt + $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_AUTHORITY) \ + $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs/beeeon_root_ca.crt +endef +endif + +ifeq ($(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),y) +define BEEEON_GATEWAY_MQTT_INSTALL + echo exporter.mqtt.host = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_HOST) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties + echo exporter.mqtt.port = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_PORT) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties + echo exporter.mqtt.topic = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_TOPIC) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties + echo exporter.mqtt.clientID = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_CLIENT_ID) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties +endef +endif + +define Package/beeeon-gateway/install + $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH),\ + echo psdev.path = $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH) \ + > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-pressure-sensor.properties) + + $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG),\ + $(CP) $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG) \ + $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/virtual-devices.ini) + + echo hotplug.impl = pipeHotplug \ + > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-hotplug.properties + + $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties + $(foreach module,$(BEEEON_GATEWAY_MODULE_ENABLE),\ + echo $(module).enable = yes \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) + $(foreach module,$(BEEEON_GATEWAY_MODULE_DISABLE),\ + echo $(module).enable = no \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) + + $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties + + $(if $(CONFIG_BEEEON_GATEWAY_GWS_HOST),\ + echo gws.host = $(CONFIG_BEEEON_GATEWAY_GWS_HOST) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) + $(if $(CONFIG_BEEEON_GATEWAY_GWS_PORT),\ + echo gws.port = $(CONFIG_BEEEON_GATEWAY_GWS_PORT) \ + >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) + + $(BEEEON_GATEWAY_ID_INSTALL) + $(BEEEON_GATEWAY_MQTT_INSTALL) + + sed -i "s|/var/cache|/usr/lib|" ${PKG_INSTALL_DIR}/usr/etc/beeeon/gateway/gateway-startup.ini + mkdir -p $(1)/usr/lib/beeeon/gateway + + $(INSTALL_DIR) $(1) + $(CP) -r $(PKG_INSTALL_DIR)/* $(1) + $(RM) -r $(1)/var + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/$(INIT_SCRIPT_NAME) $(1)/etc/init.d/$(INIT_SCRIPT_NAME) + + $(INSTALL_DIR) $(1)/etc/hotplug.d + $(CP) ./files/beeeon-hotplug-functions $(1)/etc/hotplug.d/beeeon-hotplug-functions + $(INSTALL_DIR) $(1)/etc/hotplug.d/tty + $(CP) ./files/tty-beeeon-dongle $(1)/etc/hotplug.d/tty/30-beeeon-dongle + $(INSTALL_DIR) $(1)/etc/hotplug.d/bluetooth + $(CP) ./files/bluetooth-beeeon-dongle $(1)/etc/hotplug.d/bluetooth/30-beeeon-dongle +endef + +define Package/beeeon-gateway/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Enabling and starting $(PKG_NAME) service" + /etc/init.d/$(INIT_SCRIPT_NAME) enable + /etc/init.d/$(INIT_SCRIPT_NAME) start +fi +exit 0 +endef + +define Package/beeeon-gateway/prerm +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + echo "Disabling and stopping $(PKG_NAME) service" + /etc/init.d/$(INIT_SCRIPT_NAME) disable + /etc/init.d/$(INIT_SCRIPT_NAME) stop +fi +exit 0 +endef + +$(eval $(call BuildPackage,beeeon-gateway)) diff --git a/net/beeeon-gateway/files/beeeon-gateway b/utils/beeeon-gateway/files/beeeon-gateway similarity index 100% rename from net/beeeon-gateway/files/beeeon-gateway rename to utils/beeeon-gateway/files/beeeon-gateway diff --git a/net/beeeon-gateway/files/beeeon-hotplug-functions b/utils/beeeon-gateway/files/beeeon-hotplug-functions similarity index 100% rename from net/beeeon-gateway/files/beeeon-hotplug-functions rename to utils/beeeon-gateway/files/beeeon-hotplug-functions diff --git a/net/beeeon-gateway/files/bluetooth-beeeon-dongle b/utils/beeeon-gateway/files/bluetooth-beeeon-dongle similarity index 100% rename from net/beeeon-gateway/files/bluetooth-beeeon-dongle rename to utils/beeeon-gateway/files/bluetooth-beeeon-dongle diff --git a/net/beeeon-gateway/files/tty-beeeon-dongle b/utils/beeeon-gateway/files/tty-beeeon-dongle similarity index 100% rename from net/beeeon-gateway/files/tty-beeeon-dongle rename to utils/beeeon-gateway/files/tty-beeeon-dongle From 43aa0cc31e1a8bb38fb335ed5036f7b505b8b01d Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 5 Nov 2019 07:15:52 -0500 Subject: [PATCH 09/26] beeeon-gateway moved from net to utils directory --- utils/beeeon-gateway/Makefile.save | 258 ----------------------------- 1 file changed, 258 deletions(-) delete mode 100644 utils/beeeon-gateway/Makefile.save diff --git a/utils/beeeon-gateway/Makefile.save b/utils/beeeon-gateway/Makefile.save deleted file mode 100644 index 0483f66..0000000 --- a/utils/beeeon-gateway/Makefile.save +++ /dev/null @@ -1,258 +0,0 @@ -# -# Copyright (c) 2016, 2017, Brno University of Technology -# -# This is free software, licensed under the BSD-3-Clause. -# -# This file is based on -# https://github.com/BeeeOn/openwrt-packages/tree/master/beeeon-gateway -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=beeeon-gateway -PKG_VERSION:=v2019.7.1 -PKG_RELEASE:=1 -INIT_SCRIPT_NAME:=$(PKG_NAME) - - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/BeeeOn/gateway.git -PKG_SOURCE_VERSION:=7328b4377efcba98d1fef25372f2d2d6a7e685f0 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz - -PKG_MAINTAINER:=Jakub Jalowiczor -PKG_LICENSE:=BSD-3-Clause -PKG_LICENSE_FILES:=LICENSE - -PKG_BUILD_PARALLEL:=1 -CMAKE_INSTALL:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(_PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -ifeq ($(BUILD_VARIANT),all) - CMAKE_OPTIONS += \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DENABLE_TESTS=OFF \ - -DENABLE_UDEV=OFF \ - -DENABLE_BELKIN_WEMO=ON \ - -DENABLE_BLE_SMART=ON \ - -DENABLE_BLUETOOTH_AVAILABILITY=ON \ - -DENABLE_HCI_INFO_REPORTER=ON \ - -DENABLE_FITP=OFF \ - -DENABLE_IQRF=ON \ - -DENABLE_JABLOTRON=ON \ - -DENABLE_PHILIPS_HUE=ON \ - -DENABLE_VEKTIVA=ON \ - -DENABLE_PRESSURE_SENSOR=ON \ - -DENABLE_VIRTUAL_DEVICES=ON \ - -DENABLE_VPT=ON \ - -DENABLE_ZWAVE=ON \ - -DENABLE_TESTING_CENTER=ON \ - -DENABLE_NEMEA=ON -else - CMAKE_OPTIONS += \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DENABLE_TESTS=OFF \ - -DENABLE_UDEV=OFF \ - -DENABLE_BELKIN_WEMO=OFF \ - -DENABLE_BLE_SMART=OFF \ - -DENABLE_BLUETOOTH_AVAILABILITY=OFF \ - -DENABLE_HCI_INFO_REPORTER=OFF \ - -DENABLE_FITP=OFF \ - -DENABLE_IQRF=OFF \ - -DENABLE_JABLOTRON=OFF \ - -DENABLE_PHILIPS_HUE=OFF \ - -DENABLE_VEKTIVA=OFF \ - -DENABLE_PRESSURE_SENSOR=ON \ - -DENABLE_VIRTUAL_DEVICES=ON \ - -DENABLE_VPT=OFF \ - -DENABLE_ZWAVE=OFF \ - -DENABLE_TESTING_CENTER=ON \ - -DENABLE_NEMEA=OFF -endif - -TARGET_CXXFLAGS += -DPOCO_NO_FPENVIRONMENT - -define Package/beeeon-gateway/config - source "$(SOURCE)/Config.in" -endef - -ifeq ($(BUILD_VARIANT),all) - PKG_BUILD_DEPENDS += +poco-all python3/host +glib2 +bluez +openzwave +mosquitto -else - PKG_BUILD_DEPENDS += +poco-all python3/host -endif - -define Package/beeeon-gateway - SECTION:=utils - CATEGORY:=Utilities - TITLE:=BeeeOn Gateway - URL:=https://beeeon.github.io/gateway/ - DEPENDS:=+poco-all - VARIANT:=minimal -endef - -define Package/beeeon-gateway/description - The main application for BeeeOn Gateway with all modules disabled. -endef - -define Package/beeeon-gateway-all - SECTION:=utils - CATEGORY:=Utilities - TITLE:=BeeeOn Gateway - URL:=https://beeeon.github.io/gateway/ - DEPENDS:=+poco-all - DEPENDS += +bluez-daemon +bluez-libs +glib2 +libmosquittopp +nemea-framework +libpcap +openzwave-config +libopenzwave - VARIANT:=all -endef - -define Package/beeeon-gateway-all/description - The main application for BeeeOn Gateway with all modules enabled. -endef - -BEEEON_GATEWAY_MODULE_ENABLE += belkinwemo \ - blesmart \ - bluetooth.availability \ - bluetooth.reporting \ - iqrf jablotron \ - exporter.mqtt \ - philipshue \ - psdev \ - vdev \ - vpt \ - zwave \ - testing.center \ - testing.collector \ - nemea \ - gws - -# Generate random BeeeOn Gateway ID -ifeq ($(CONFIG_BEEEON_GATEWAY_ID_RANDOM),y) -BEEEON_GATEWAY_MODULE_ENABLE += gateway.id - -define BEEEON_GATEWAY_ID_INSTALL - echo gateway.id = `python3 $(PKG_BUILD_DIR)/tools/gateway-genid.py` \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties - echo ssl.key = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties - echo ssl.certificate = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties -endef -endif - -# Configure the manually inserted BeeeOn Gateway ID -ifeq ($(CONFIG_BEEEON_GATEWAY_ID_CUSTOM),y) -BEEEON_GATEWAY_MODULE_ENABLE += gateway.id - -define BEEEON_GATEWAY_ID_INSTALL - echo gateway.id = $(CONFIG_BEEEON_GATEWAY_ID_CUSTOM_VALUE) \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties - echo ssl.key = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties - echo ssl.certificate = >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties -endef -endif - -# Use SSL/TLS to provide BeeeOn Gateway ID -ifeq ($(CONFIG_BEEEON_GATEWAY_ID_CERT),y) -BEEEON_GATEWAY_MODULE_DISABLE += gateway.id - -define BEEEON_GATEWAY_ID_INSTALL - $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc/ssl/beeeon/private - $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_PKEY) \ - $(PKG_INSTALL_DIR)/etc/ssl/beeeon/private/beeeon_gateway.key - - $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs - $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_FILE) \ - $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs/beeeon_gateway.crt - $(CP) $(CONFIG_BEEEON_GATEWAY_ID_CERT_AUTHORITY) \ - $(PKG_INSTALL_DIR)/etc/ssl/beeeon/certs/beeeon_root_ca.crt -endef -endif - -ifeq ($(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER),y) -define BEEEON_GATEWAY_MQTT_INSTALL - echo exporter.mqtt.host = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_HOST) \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties - echo exporter.mqtt.port = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_PORT) \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties - echo exporter.mqtt.topic = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_TOPIC) \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties - echo exporter.mqtt.clientID = $(CONFIG_BEEEON_GATEWAY_MQTT_EXPORTER_CLIENT_ID) \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-mqtt.properties -endef -endif - -define Package/beeeon-gateway/install - $(if $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH),\ - echo psdev.path = $(CONFIG_BEEEON_GATEWAY_PRESSURE_SENSOR_PATH) \ - > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-pressure-sensor.properties) - - $(if $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG),\ - $(CP) $(CONFIG_BEEEON_GATEWAY_VIRTUAL_DEVICES_CUSTOM_CONFIG) \ - $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/virtual-devices.ini) - - echo hotplug.impl = pipeHotplug \ - > $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-hotplug.properties - - $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties - $(foreach module,$(BEEEON_GATEWAY_MODULE_ENABLE),\ - echo $(module).enable = yes \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) - $(foreach module,$(BEEEON_GATEWAY_MODULE_DISABLE),\ - echo $(module).enable = no \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-modules.properties;) - - $(RM) $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties - - $(if $(CONFIG_BEEEON_GATEWAY_GWS_HOST),\ - echo gws.host = $(CONFIG_BEEEON_GATEWAY_GWS_HOST) \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) - $(if $(CONFIG_BEEEON_GATEWAY_GWS_PORT),\ - echo gws.port = $(CONFIG_BEEEON_GATEWAY_GWS_PORT) \ - >> $(PKG_INSTALL_DIR)/usr/etc/beeeon/gateway/config.d/x-gws.properties) - - $(BEEEON_GATEWAY_ID_INSTALL) - $(BEEEON_GATEWAY_MQTT_INSTALL) - - sed -i "s|/var/cache|/usr/lib|" ${PKG_INSTALL_DIR}/usr/etc/beeeon/gateway/gateway-startup.ini - mkdir -p $(1)/usr/lib/beeeon/gateway - - $(INSTALL_DIR) $(1) - $(CP) -r $(PKG_INSTALL_DIR)/* $(1) - $(RM) -r $(1)/var - - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/$(INIT_SCRIPT_NAME) $(1)/etc/init.d/$(INIT_SCRIPT_NAME) - - $(INSTALL_DIR) $(1)/etc/hotplug.d - $(CP) ./files/beeeon-hotplug-functions $(1)/etc/hotplug.d/beeeon-hotplug-functions - $(INSTALL_DIR) $(1)/etc/hotplug.d/tty - $(CP) ./files/tty-beeeon-dongle $(1)/etc/hotplug.d/tty/30-beeeon-dongle - $(INSTALL_DIR) $(1)/etc/hotplug.d/bluetooth - $(CP) ./files/bluetooth-beeeon-dongle $(1)/etc/hotplug.d/bluetooth/30-beeeon-dongle -endef - -define Package/beeeon-gateway/postinst -#!/bin/sh -if [ -z "$${IPKG_INSTROOT}" ]; then - echo "Enabling and starting $(PKG_NAME) service" - /etc/init.d/$(INIT_SCRIPT_NAME) enable - /etc/init.d/$(INIT_SCRIPT_NAME) start -fi -exit 0 -endef - -define Package/beeeon-gateway/prerm -#!/bin/sh -if [ -z "$${IPKG_INSTROOT}" ]; then - echo "Disabling and stopping $(PKG_NAME) service" - /etc/init.d/$(INIT_SCRIPT_NAME) disable - /etc/init.d/$(INIT_SCRIPT_NAME) stop -fi -exit 0 -endef - -$(eval $(call BuildPackage,beeeon-gateway)) From 68d815e9f37e19918072a2975c09fc61dfd1a835 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 10 Dec 2019 08:26:27 -0500 Subject: [PATCH 10/26] Makefile and Config.in adjustment --- utils/beeeon-gateway/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/beeeon-gateway/Makefile b/utils/beeeon-gateway/Makefile index 3f8d164..7e842b9 100644 --- a/utils/beeeon-gateway/Makefile +++ b/utils/beeeon-gateway/Makefile @@ -28,7 +28,8 @@ PKG_LICENSE_FILES:=LICENSE PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 BUILD_DIR:=$(TOPDIR)/build_dir/turris -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_SOURCE_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_SOURCE_VERSION) include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk From 1749bf7815783002ca5f01d11fc7cc380d4dd2f9 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 10 Dec 2019 08:31:44 -0500 Subject: [PATCH 11/26] Makefile and Config.in adjustment --- utils/beeeon-gateway/Config.in | 58 ++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/utils/beeeon-gateway/Config.in b/utils/beeeon-gateway/Config.in index 7ad3099..689b201 100644 --- a/utils/beeeon-gateway/Config.in +++ b/utils/beeeon-gateway/Config.in @@ -1,5 +1,5 @@ menu "Configuration" - depends on PACKAGE_beeeon-gateway + depends on PACKAGE_beeeon-gateway-all choice prompt "Gateway Identity" @@ -7,22 +7,21 @@ choice config BEEEON_GATEWAY_ID_RANDOM bool "random" help - BeeeOn Gateway ID would be generated during the build - at random. + BeeeOn Gateway ID would be generated during the build + at random. config BEEEON_GATEWAY_ID_CUSTOM bool "custom" help - BeeeOn Gateway ID is to be entered manually. + BeeeOn Gateway ID is to be entered manually. config BEEEON_GATEWAY_ID_CERT bool "from certificate" help - BeeeOn Gateway ID would be extracted from the given - certificate. It is thus required to give a path to - the gateway's private key, certificate and signing - certification authority. - + BeeeOn Gateway ID would be extracted from the given + certificate. It is thus required to give a path to + the gateway's private key, certificate and signing + certification authority. endchoice config BEEEON_GATEWAY_ID_CUSTOM_VALUE @@ -77,13 +76,10 @@ config BEEEON_GATEWAY_GWS_PORT endmenu menu "Modules" - depends on PACKAGE_beeeon-gateway + depends on PACKAGE_beeeon-gateway-all config BEEEON_GATEWAY_USB_UART_RECOMMENDED bool - default y if BEEEON_GATEWAY_ZWAVE - default y if BEEEON_GATEWAY_IQRF - default y if BEEEON_GATEWAY_JABLOTRON default n config BEEEON_GATEWAY_HAS_KMOD_USB_ACM @@ -95,4 +91,40 @@ comment "You may need to select kmod-usb-acm to support UART-over-USB." depends on BEEEON_GATEWAY_USB_UART_RECOMMENDED depends on !BEEEON_GATEWAY_HAS_KMOD_USB_ACM +config BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP + bool + default y if PACKAGE_libmosquittopp + default n + +comment "MQTT exporter requires libmosquittopp" + depends on !BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP + +config BEEEON_GATEWAY_MQTT_EXPORTER + bool "Exporting data via MQTT" + depends on BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP + default n + help + Enable exporting data over MQTT via mosquitto. + +menu "MQTT Exporter settings" + depends on BEEEON_GATEWAY_MQTT_EXPORTER + +config BEEEON_GATEWAY_MQTT_EXPORTER_HOST + string "MQTT host" + default "127.0.0.1" + +config BEEEON_GATEWAY_MQTT_EXPORTER_PORT + int "MQTT port" + default 1883 + range 1 65535 + +config BEEEON_GATEWAY_MQTT_EXPORTER_TOPIC + string "MQTT topic" + default "BeeeOnOut" + +config BEEEON_GATEWAY_MQTT_EXPORTER_CLIENT_ID + string "MQTT client ID" + default "Gateway" + +endmenu endmenu From 9e0273b36d4f461fe48b213e945b3e740a1644d7 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Tue, 28 Jan 2020 14:53:48 -0500 Subject: [PATCH 12/26] BeeeOn gateway updated to v2019.12.1 --- utils/beeeon-gateway/Config.in | 55 +++++++--------------------------- utils/beeeon-gateway/Makefile | 18 ++++++++--- 2 files changed, 24 insertions(+), 49 deletions(-) diff --git a/utils/beeeon-gateway/Config.in b/utils/beeeon-gateway/Config.in index 689b201..48fc609 100644 --- a/utils/beeeon-gateway/Config.in +++ b/utils/beeeon-gateway/Config.in @@ -1,5 +1,5 @@ menu "Configuration" - depends on PACKAGE_beeeon-gateway-all + depends on PACKAGE_beeeon-gateway choice prompt "Gateway Identity" @@ -7,21 +7,22 @@ choice config BEEEON_GATEWAY_ID_RANDOM bool "random" help - BeeeOn Gateway ID would be generated during the build - at random. + BeeeOn Gateway ID would be generated during the build + at random. config BEEEON_GATEWAY_ID_CUSTOM bool "custom" help - BeeeOn Gateway ID is to be entered manually. + BeeeOn Gateway ID is to be entered manually. config BEEEON_GATEWAY_ID_CERT bool "from certificate" help - BeeeOn Gateway ID would be extracted from the given - certificate. It is thus required to give a path to - the gateway's private key, certificate and signing - certification authority. + BeeeOn Gateway ID would be extracted from the given + certificate. It is thus required to give a path to + the gateway's private key, certificate and signing + certification authority. + endchoice config BEEEON_GATEWAY_ID_CUSTOM_VALUE @@ -76,7 +77,7 @@ config BEEEON_GATEWAY_GWS_PORT endmenu menu "Modules" - depends on PACKAGE_beeeon-gateway-all + depends on PACKAGE_beeeon-gateway config BEEEON_GATEWAY_USB_UART_RECOMMENDED bool @@ -91,40 +92,4 @@ comment "You may need to select kmod-usb-acm to support UART-over-USB." depends on BEEEON_GATEWAY_USB_UART_RECOMMENDED depends on !BEEEON_GATEWAY_HAS_KMOD_USB_ACM -config BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP - bool - default y if PACKAGE_libmosquittopp - default n - -comment "MQTT exporter requires libmosquittopp" - depends on !BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP - -config BEEEON_GATEWAY_MQTT_EXPORTER - bool "Exporting data via MQTT" - depends on BEEEON_GATEWAY_HAS_LIBMOSQUITTOPP - default n - help - Enable exporting data over MQTT via mosquitto. - -menu "MQTT Exporter settings" - depends on BEEEON_GATEWAY_MQTT_EXPORTER - -config BEEEON_GATEWAY_MQTT_EXPORTER_HOST - string "MQTT host" - default "127.0.0.1" - -config BEEEON_GATEWAY_MQTT_EXPORTER_PORT - int "MQTT port" - default 1883 - range 1 65535 - -config BEEEON_GATEWAY_MQTT_EXPORTER_TOPIC - string "MQTT topic" - default "BeeeOnOut" - -config BEEEON_GATEWAY_MQTT_EXPORTER_CLIENT_ID - string "MQTT client ID" - default "Gateway" - -endmenu endmenu diff --git a/utils/beeeon-gateway/Makefile b/utils/beeeon-gateway/Makefile index 7e842b9..525717e 100644 --- a/utils/beeeon-gateway/Makefile +++ b/utils/beeeon-gateway/Makefile @@ -10,14 +10,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=beeeon-gateway -PKG_VERSION:=v2019.7.1 +PKG_VERSION:=v2019.12.1 PKG_RELEASE:=1 INIT_SCRIPT_NAME:=$(PKG_NAME) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/BeeeOn/gateway.git -PKG_SOURCE_VERSION:=7328b4377efcba98d1fef25372f2d2d6a7e685f0 +PKG_SOURCE_VERSION:=27bc592e847278df5ca6866ebde6eb04ca29a4f2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz @@ -28,8 +28,7 @@ PKG_LICENSE_FILES:=LICENSE PKG_BUILD_PARALLEL:=1 CMAKE_INSTALL:=1 BUILD_DIR:=$(TOPDIR)/build_dir/turris -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_SOURCE_VERSION) -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_SOURCE_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -49,11 +48,13 @@ ifeq ($(BUILD_VARIANT),all) -DENABLE_JABLOTRON=ON \ -DENABLE_PHILIPS_HUE=ON \ -DENABLE_VEKTIVA=ON \ + -DENABLE_CONRAD=OFF \ -DENABLE_PRESSURE_SENSOR=ON \ -DENABLE_VIRTUAL_DEVICES=ON \ -DENABLE_VPT=ON \ -DENABLE_ZWAVE=ON \ -DENABLE_TESTING_CENTER=ON \ + -DENABLE_SONOFF=ON \ -DENABLE_NEMEA=ON else CMAKE_OPTIONS += \ @@ -70,11 +71,13 @@ else -DENABLE_JABLOTRON=OFF \ -DENABLE_PHILIPS_HUE=OFF \ -DENABLE_VEKTIVA=OFF \ + -DENABLE_CONRAD=OFF \ -DENABLE_PRESSURE_SENSOR=ON \ -DENABLE_VIRTUAL_DEVICES=ON \ -DENABLE_VPT=OFF \ -DENABLE_ZWAVE=OFF \ -DENABLE_TESTING_CENTER=ON \ + -DENABLE_SONOFF=OFF \ -DENABLE_NEMEA=OFF endif @@ -129,6 +132,9 @@ BEEEON_GATEWAY_MODULE_ENABLE += psdev \ exporter.mqtt \ gws +BEEEON_GATEWAY_MODULE_DISABLE += fitp \ + conrad + ifeq ($(BUILD_VARIANT),all) BEEEON_GATEWAY_MODULE_ENABLE += belkinwemo \ blesmart \ @@ -139,6 +145,8 @@ ifeq ($(BUILD_VARIANT),all) philipshue \ vpt \ zwave \ + vektiva \ + sonoff \ nemea else BEEEON_GATEWAY_MODULE_DISABLE += belkinwemo \ @@ -150,6 +158,8 @@ else philipshue \ vpt \ zwave \ + vektiva \ + sonoff \ nemea endif From 5501233a81c91b257bbbaa2e2d40439ed99a7235 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Mon, 10 Feb 2020 08:42:08 -0500 Subject: [PATCH 13/26] nemea-siot: added zwave packages --- net/nemea-siot/Makefile | 45 +++++++++++++++++++++- net/nemea-siot/patches/001-makefile.patch | 10 +++++ net/nemea-siot/patches/002-configure.patch | 10 +++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 net/nemea-siot/patches/001-makefile.patch create mode 100644 net/nemea-siot/patches/002-configure.patch diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index 047d818..9c8ebaf 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -1,14 +1,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nemea-siot -PKG_VERSION:=19-08.1 +PKG_VERSION:=20-20.1 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/CESNET/nemea-siot.git -PKG_SOURCE_VERSION:=dd3b9a73af68aa54857b38ed18320c5078f08523 +PKG_SOURCE_VERSION:=192f924e1e2b174e9bb5f39cd42108a4ac2bfac6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION) + PKG_MAINTAINER:=Tomas Cejka PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE @@ -60,6 +63,21 @@ define Package/siot-wsn-anomaly TITLE:=Wireless Sensor Network Detector (based on time series) endef +define Package/siot-zwave-collector + $(call Package/nemea-siot/Default) + TITLE:=Zwave collector +endef + +define Package/siot-zwave-detector + $(call Package/nemea-siot/Default) + TITLE:=Zwave detector +endef + +define Package/siot-zwave-sniffer + $(call Package/nemea-siot/Default) + TITLE:=Zwave SDR sniffer +endef + TARGET_CFLAGS += \ -ffunction-sections \ -fdata-sections @@ -112,9 +130,32 @@ define Package/siot-wsn-anomaly/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-wsn-anomaly $(1)/usr/bin/nemea/ endef +define Package/siot-zwave-collector/install + $(INSTALL_DIR) $(1)/usr/bin/nemea + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-zwave-collector $(1)/usr/bin/nemea/ +endef + + +define Package/siot-zwave-detector/install + $(INSTALL_DIR) $(1)/usr/bin/nemea + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-zwave-detector $(1)/usr/bin/nemea/ +endef + + +define Package/siot-zwave-sniffer/install + $(INSTALL_DIR) $(1)/usr/bin/nemea + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-zwave-sdr-sniffer $(1)/usr/bin/nemea/ +endef + + + + $(eval $(call BuildPackage,siot-ble-pairing)) $(eval $(call BuildPackage,siot-hci-collector)) $(eval $(call BuildPackage,siot-lora-airtime)) $(eval $(call BuildPackage,siot-lora-distance)) $(eval $(call BuildPackage,siot-lora-replay)) $(eval $(call BuildPackage,siot-wsn-anomaly)) +$(eval $(call BuildPackage,siot-zwave-collector)) +$(eval $(call BuildPackage,siot-zwave-detector)) +$(eval $(call BuildPackage,siot-zwave-sniffer)) diff --git a/net/nemea-siot/patches/001-makefile.patch b/net/nemea-siot/patches/001-makefile.patch new file mode 100644 index 0000000..df50efd --- /dev/null +++ b/net/nemea-siot/patches/001-makefile.patch @@ -0,0 +1,10 @@ +---a/Makefile.am 2020-01-24 11:52:43.892645551 -0500 ++++ b/Makefile.am 2020-01-24 11:53:55.214170760 -0500 +@@ -6,7 +6,6 @@ + lora-airtime \ + lora-replay \ + lora-distance \ +-ble-adv-collector \ + zwave-sdr-sniffer \ + zwave-collector \ + zwave-detector diff --git a/net/nemea-siot/patches/002-configure.patch b/net/nemea-siot/patches/002-configure.patch new file mode 100644 index 0000000..ca0e5e3 --- /dev/null +++ b/net/nemea-siot/patches/002-configure.patch @@ -0,0 +1,10 @@ +--- a/configure.ac 2020-01-24 11:53:32.585687188 -0500 ++++ b/configure.ac 2020-01-24 11:52:18.784107825 -0500 +@@ -46,7 +46,6 @@ + lora-airtime + lora-replay + lora-distance +-ble-adv-collector + zwave-sdr-sniffer + zwave-collector + zwave-detector]) From ecf0d2ce71940743b2625e930360ff734e5776ba Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor <40665304+jalowiczor@users.noreply.github.com> Date: Mon, 10 Feb 2020 14:47:12 +0100 Subject: [PATCH 14/26] Update Makefile --- net/nemea-siot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index 9c8ebaf..d81dfa4 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nemea-siot -PKG_VERSION:=20-20.1 +PKG_VERSION:=20-01.1 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git From f3df9eae52c1d57b3e2942ab685b248e970bdb5a Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor <40665304+jalowiczor@users.noreply.github.com> Date: Mon, 10 Feb 2020 15:10:26 +0100 Subject: [PATCH 15/26] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b46fa7..eeb065b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ # NEMEA OpenWrt feed ## Description +This OpenWrt package feed contains parts that are necessary for the SIoT project but are not ready to be deployed on the Turris Omnia router without certain changes. -This is an OpenWrt package feed containing [NEMEA system](https://github.com/CESNET/Nemea) components and P4 generated [IPFIX exporter](https://github.com/CESNET/NEMEA-Probe) for exporting flow data . +Conditions for the pull request to master branch include: +* Newer version of glib (2.58.3 or newer) in Turris OS +* Poco libraries from [newer commit](https://github.com/openwrt/packages/commit/4712deffa57c9f919b1e60238daff7d164f6a695) in Turris OS + +Besides [NEMEA system](https://github.com/CESNET/Nemea) components and P4 generated [IPFIX exporter](https://github.com/CESNET/NEMEA-Probe) for exporting flow data, this Openwrt package feed contains [BeeeOn gateway] (https://github.com/BeeeOn/gateway). ![Infrastructure with NEMEA and OpenWRT router](doc/openwrt-scheme.png) From 1b4133909592e7806bf307db8d0eb5da603360cc Mon Sep 17 00:00:00 2001 From: Radek Krejci Date: Thu, 13 Feb 2020 14:24:22 +0100 Subject: [PATCH 16/26] nemea-siot: link with the most recent version Removes patches which are not necessary with the recent version where the problems with ble-adv-collector were solved. --- net/nemea-siot/Makefile | 2 +- net/nemea-siot/patches/001-makefile.patch | 10 ---------- net/nemea-siot/patches/002-configure.patch | 10 ---------- 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 net/nemea-siot/patches/001-makefile.patch delete mode 100644 net/nemea-siot/patches/002-configure.patch diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index d81dfa4..fa28325 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -6,7 +6,7 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/CESNET/nemea-siot.git -PKG_SOURCE_VERSION:=192f924e1e2b174e9bb5f39cd42108a4ac2bfac6 +PKG_SOURCE_VERSION:=5000cebad99631b071f4c61aab67ed09e0b98bed PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) diff --git a/net/nemea-siot/patches/001-makefile.patch b/net/nemea-siot/patches/001-makefile.patch deleted file mode 100644 index df50efd..0000000 --- a/net/nemea-siot/patches/001-makefile.patch +++ /dev/null @@ -1,10 +0,0 @@ ----a/Makefile.am 2020-01-24 11:52:43.892645551 -0500 -+++ b/Makefile.am 2020-01-24 11:53:55.214170760 -0500 -@@ -6,7 +6,6 @@ - lora-airtime \ - lora-replay \ - lora-distance \ --ble-adv-collector \ - zwave-sdr-sniffer \ - zwave-collector \ - zwave-detector diff --git a/net/nemea-siot/patches/002-configure.patch b/net/nemea-siot/patches/002-configure.patch deleted file mode 100644 index ca0e5e3..0000000 --- a/net/nemea-siot/patches/002-configure.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/configure.ac 2020-01-24 11:53:32.585687188 -0500 -+++ b/configure.ac 2020-01-24 11:52:18.784107825 -0500 -@@ -46,7 +46,6 @@ - lora-airtime - lora-replay - lora-distance --ble-adv-collector - zwave-sdr-sniffer - zwave-collector - zwave-detector]) From 3a2d81ce09c74622b1f4831b1f49c5a39ab82cd9 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Thu, 26 Mar 2020 07:02:20 -0400 Subject: [PATCH 17/26] BeeeOn gateway updated to v2020.3.1 --- utils/beeeon-gateway/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/beeeon-gateway/Makefile b/utils/beeeon-gateway/Makefile index 525717e..b4b7c3d 100644 --- a/utils/beeeon-gateway/Makefile +++ b/utils/beeeon-gateway/Makefile @@ -10,14 +10,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=beeeon-gateway -PKG_VERSION:=v2019.12.1 +PKG_VERSION:=v2020.3.1 PKG_RELEASE:=1 INIT_SCRIPT_NAME:=$(PKG_NAME) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/BeeeOn/gateway.git -PKG_SOURCE_VERSION:=27bc592e847278df5ca6866ebde6eb04ca29a4f2 +PKG_SOURCE_VERSION:=2d52852c0547484a31ace3ea41b91c5c3ae72fa3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz From 53f81f22ace27413bbd1f1a61dfacc16dbba96f6 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Wed, 29 Apr 2020 05:00:51 -0400 Subject: [PATCH 18/26] nemea-siot updated to the latest version --- net/nemea-siot/Makefile | 4 ++-- .../patches/001-remove-lora-collector-configure.patch | 10 ++++++++++ .../patches/002-remove-lora-collector-makefile.patch | 10 ++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 net/nemea-siot/patches/001-remove-lora-collector-configure.patch create mode 100644 net/nemea-siot/patches/002-remove-lora-collector-makefile.patch diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index fa28325..c0ce7fc 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nemea-siot -PKG_VERSION:=20-01.1 +PKG_VERSION:=20-03.1 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/CESNET/nemea-siot.git -PKG_SOURCE_VERSION:=5000cebad99631b071f4c61aab67ed09e0b98bed +PKG_SOURCE_VERSION:=2884fdb4b39b23c968e327c81b57c2eea90a00ea PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) diff --git a/net/nemea-siot/patches/001-remove-lora-collector-configure.patch b/net/nemea-siot/patches/001-remove-lora-collector-configure.patch new file mode 100644 index 0000000..43ce7c6 --- /dev/null +++ b/net/nemea-siot/patches/001-remove-lora-collector-configure.patch @@ -0,0 +1,10 @@ +--- a/configure.ac 2020-04-28 05:23:43.317176682 -0400 ++++ b/configure.ac 2020-04-28 05:25:09.458993152 -0400 +@@ -43,7 +43,6 @@ + AC_CONFIG_SUBDIRS([hci-collector + ble-pairing + wsn-anomaly +-lora-collector + lora-airtime + lora-replay + lora-distance diff --git a/net/nemea-siot/patches/002-remove-lora-collector-makefile.patch b/net/nemea-siot/patches/002-remove-lora-collector-makefile.patch new file mode 100644 index 0000000..a91b0e7 --- /dev/null +++ b/net/nemea-siot/patches/002-remove-lora-collector-makefile.patch @@ -0,0 +1,10 @@ +--- a/Makefile.am 2020-04-28 05:41:06.315152708 -0400 ++++ b/Makefile.am 2020-04-28 05:41:25.035546967 -0400 +@@ -3,7 +3,6 @@ + SUBDIRS=ble-pairing \ + hci-collector \ + wsn-anomaly \ +-lora-collector \ + lora-airtime \ + lora-replay \ + lora-distance \ From dc5f042970cb376b5c0f357be6345f775f163d46 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Wed, 29 Apr 2020 05:57:26 -0400 Subject: [PATCH 19/26] nemea-siot updated to the latest version --- net/nemea-siot/Makefile | 44 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index c0ce7fc..765ce47 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -58,6 +58,21 @@ define Package/siot-lora-replay TITLE:=LoRaWAN Replay attack ABP detection endef +define Package/siot-ble-adv-collector + $(call Package/nemea-siot/Default) + TITLE:=BLE collector +endef + +define Package/siot-ble-conn-detector + $(call Package/nemea-siot/Default) + TITLE:=BLE connection detector +endef + +define Package/siot-ble-conn-guard + $(call Package/nemea-siot/Default) + TITLE:=BLE connection guard +endef + define Package/siot-wsn-anomaly $(call Package/nemea-siot/Default) TITLE:=Wireless Sensor Network Detector (based on time series) @@ -73,6 +88,11 @@ define Package/siot-zwave-detector TITLE:=Zwave detector endef +define Package/siot-zwave-stats-creator + $(call Package/nemea-siot/Default) + TITLE:=Zwave stats creator +endef + define Package/siot-zwave-sniffer $(call Package/nemea-siot/Default) TITLE:=Zwave SDR sniffer @@ -125,6 +145,21 @@ define Package/siot-lora-replay/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-lora-replay $(1)/usr/bin/nemea/ endef +define Package/siot-ble-adv-collector/install + $(INSTALL_DIR) $(1)/usr/bin/nemea + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-ble-adv-collector $(1)/usr/bin/nemea/ +endef + +define Package/siot-ble-conn-detector/install + $(INSTALL_DIR) $(1)/usr/bin/nemea + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-ble-conn-detector $(1)/usr/bin/nemea/ +endef + +define Package/siot-ble-conn-guard/install + $(INSTALL_DIR) $(1)/usr/bin/nemea + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-ble-conn-guard $(1)/usr/bin/nemea/ +endef + define Package/siot-wsn-anomaly/install $(INSTALL_DIR) $(1)/usr/bin/nemea $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-wsn-anomaly $(1)/usr/bin/nemea/ @@ -135,12 +170,15 @@ define Package/siot-zwave-collector/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-zwave-collector $(1)/usr/bin/nemea/ endef - define Package/siot-zwave-detector/install $(INSTALL_DIR) $(1)/usr/bin/nemea $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-zwave-detector $(1)/usr/bin/nemea/ endef +define Package/siot-zwave-stats-creator/install + $(INSTALL_DIR) $(1)/usr/bin/nemea + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nemea/siot-zwave-stats-creator $(1)/usr/bin/nemea/ +endef define Package/siot-zwave-sniffer/install $(INSTALL_DIR) $(1)/usr/bin/nemea @@ -155,7 +193,11 @@ $(eval $(call BuildPackage,siot-hci-collector)) $(eval $(call BuildPackage,siot-lora-airtime)) $(eval $(call BuildPackage,siot-lora-distance)) $(eval $(call BuildPackage,siot-lora-replay)) +$(eval $(call BuildPackage,siot-ble-adv-collector)) +$(eval $(call BuildPackage,siot-ble-conn-detector)) +$(eval $(call BuildPackage,siot-ble-conn-guard)) $(eval $(call BuildPackage,siot-wsn-anomaly)) $(eval $(call BuildPackage,siot-zwave-collector)) $(eval $(call BuildPackage,siot-zwave-detector)) +$(eval $(call BuildPackage,siot-zwave-stats-creator)) $(eval $(call BuildPackage,siot-zwave-sniffer)) From f6a8d4aa8af7b22f4dcf4401d4ce00d749e3f8c9 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor Date: Wed, 29 Apr 2020 07:27:07 -0400 Subject: [PATCH 20/26] nemea-siot updated to the latest version --- net/nemea-siot/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index 765ce47..5d73269 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -61,16 +61,19 @@ endef define Package/siot-ble-adv-collector $(call Package/nemea-siot/Default) TITLE:=BLE collector + DEPENDS+= +libstdcpp +bluez-libs endef define Package/siot-ble-conn-detector $(call Package/nemea-siot/Default) TITLE:=BLE connection detector + DEPENDS+= +libstdcpp +bluez-libs endef define Package/siot-ble-conn-guard $(call Package/nemea-siot/Default) TITLE:=BLE connection guard + DEPENDS+= +libstdcpp +bluez-libs endef define Package/siot-wsn-anomaly From dad3b5f3a33768a2f1348e3bea30dcfc68619f76 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor <40665304+jalowiczor@users.noreply.github.com> Date: Wed, 29 Apr 2020 14:03:07 +0200 Subject: [PATCH 21/26] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f21d33e..4677459 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ deploy: skip_cleanup: true local_dir: $HOME/dist-pkgs github_token: $GITHUB_TOKEN - target_branch: turris-packages + target_branch: turris-packages-devel on: - branch: master + branch: devel From 8df63b0c31adbf06fcd8effe0a399ee13c5bd6d9 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor <40665304+jalowiczor@users.noreply.github.com> Date: Wed, 29 Apr 2020 14:50:46 +0200 Subject: [PATCH 22/26] Update .travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4677459..c84e336 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,8 @@ script: - echo "src-git packages https://github.com/openwrt/packages.git^3a2c97600f051ba47f9aa83a121f3de09f567480" > feeds.conf - ./scripts/feeds update packages poco - ./scripts/feeds install -p packages poco + - ./scripts/feeds update packages libloragw + - ./scripts/feeds install -p packages libloragw - echo "src-git turrispackages https://gitlab.labs.nic.cz/turris/turris-os-packages.git^6b0685fce4816e5c20cd0f6eacf5e37166c87c74" > feeds.conf - ./scripts/feeds update turrispackages glib2 - ./scripts/feeds install -p turrispackages glib2 From 6955ecdbf75c1d537bdf9584ed20c919b2532484 Mon Sep 17 00:00:00 2001 From: Jakub Jalowiczor <40665304+jalowiczor@users.noreply.github.com> Date: Wed, 29 Apr 2020 14:53:17 +0200 Subject: [PATCH 23/26] Update .travis.yml --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c84e336..dd40986 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ script: - echo "$PWD" - export SRC_PATH="$PWD" - cd "$HOME/openwrt-sdk-omnia" - - echo "src-cpy nemea $SRC_PATH" > feeds.conf + - echo "src-cpy siot $SRC_PATH" > feeds.conf - ./scripts/feeds update - ./scripts/feeds install -a - echo "src-git packages https://github.com/openwrt/packages.git^3a2c97600f051ba47f9aa83a121f3de09f567480" > feeds.conf @@ -38,9 +38,9 @@ script: - ./scripts/feeds install -p turrispackages glib2 - make -j8 && { mkdir -p $HOME/dist-pkgs/turris-omnia; cp -r bin/*/packages $HOME/dist-pkgs/turris-omnia; true;} || make -j1 V=s - cd "$HOME/openwrt-sdk-turris" - - echo "src-cpy nemea $SRC_PATH" > feeds.conf + - echo "src-cpy siot $SRC_PATH" > feeds.conf - ./scripts/feeds update - - ./scripts/feeds install -p nemea nemea-ipfixprobe + - ./scripts/feeds install -p siot nemea-ipfixprobe - make -j8 && { mkdir -p $HOME/dist-pkgs/turris; cp -r bin/*/packages $HOME/dist-pkgs/turris; true; } || make -j1 V=s deploy: From f0f9522b69a4b690693bcd37806a238c18f6b0b9 Mon Sep 17 00:00:00 2001 From: Radek Krejci Date: Sat, 9 May 2020 08:33:00 +0200 Subject: [PATCH 24/26] Update nemea-siot version Include the latest changes in NEMEA-SIoT repository --- net/nemea-siot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index 5d73269..aa7c32f 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -6,7 +6,7 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/CESNET/nemea-siot.git -PKG_SOURCE_VERSION:=2884fdb4b39b23c968e327c81b57c2eea90a00ea +PKG_SOURCE_VERSION:=fd8a804b0592c3255b69c4ea3424408e02e026ea PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) From 9ea55eeba49d1373a580cc755059813ce8ca3f39 Mon Sep 17 00:00:00 2001 From: Radek Krejci Date: Mon, 11 May 2020 17:13:32 +0200 Subject: [PATCH 25/26] update NEMEA-SIoT packages --- net/nemea-siot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index aa7c32f..852dd2f 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -6,7 +6,7 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/CESNET/nemea-siot.git -PKG_SOURCE_VERSION:=fd8a804b0592c3255b69c4ea3424408e02e026ea +PKG_SOURCE_VERSION:=5f9ed3d4047122efe878bcdab4fbd671f9042943 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) From f48fe15bf4a92b0493dfac39da6ab3a76b1b9199 Mon Sep 17 00:00:00 2001 From: Radek Krejci Date: Wed, 20 May 2020 15:28:06 +0200 Subject: [PATCH 26/26] update NEMEA-SIoT packages --- net/nemea-siot/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nemea-siot/Makefile b/net/nemea-siot/Makefile index 852dd2f..cc4388a 100644 --- a/net/nemea-siot/Makefile +++ b/net/nemea-siot/Makefile @@ -6,7 +6,7 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/CESNET/nemea-siot.git -PKG_SOURCE_VERSION:=5f9ed3d4047122efe878bcdab4fbd671f9042943 +PKG_SOURCE_VERSION:=78a6af6c236c29b46480ebef5eddd20b7477979f PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)