diff options
-rw-r--r-- | bigclown-control-tool/Makefile | 35 | ||||
-rw-r--r-- | bigclown-gateway/Makefile | 46 | ||||
-rw-r--r-- | bigclown-gateway/files/config | 10 | ||||
-rwxr-xr-x | bigclown-gateway/files/init | 58 | ||||
-rw-r--r-- | bigclown-mqtt2influxdb/Makefile | 45 | ||||
-rw-r--r-- | bigclown-mqtt2influxdb/files/config.yml | 67 | ||||
-rw-r--r-- | bigclown-mqtt2influxdb/files/init | 22 | ||||
-rw-r--r-- | python-appdirs/Makefile | 36 | ||||
-rw-r--r-- | python-chardet/Makefile | 36 | ||||
-rw-r--r-- | python-decorator/Makefile | 31 | ||||
-rw-r--r-- | python-influxdb/Makefile | 36 | ||||
-rw-r--r-- | python-jsonpath-ng/Makefile | 31 | ||||
-rw-r--r-- | python-schema/Makefile | 35 |
13 files changed, 488 insertions, 0 deletions
diff --git a/bigclown-control-tool/Makefile b/bigclown-control-tool/Makefile new file mode 100644 index 0000000..4ac6d12 --- /dev/null +++ b/bigclown-control-tool/Makefile @@ -0,0 +1,35 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bigclown-control-tool +PKG_VERSION:=0.2.0 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://codeload.github.com/bigclownlabs/bch-control-tool/tar.gz/v$(PKG_VERSION)? +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=76e41d48be436b598a220df22824c922d197a1bd40717b975efb1fa6a2a7e8fa +PKG_LICENSE:=MIT +PKG_BUILD_DIR:=$(BUILD_DIR)/bch-control-tool-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../../lang/python/python3-package.mk + +define Package/$(PKG_NAME) + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=BigClown + URL:=https://github.com/bigclownlabs/bch-control-tool + TITLE:=BigCLown control tool + DEPENDS:=+click-log +python3-paho-mqtt +python3-pyserial +python3-pyyaml +python3-simplejson +endef + +define Build/Compile + sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py" + $(call Py3Build/Compile/Default) +endef + +$(eval $(call Py3Package,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/bigclown-gateway/Makefile b/bigclown-gateway/Makefile new file mode 100644 index 0000000..068edfd --- /dev/null +++ b/bigclown-gateway/Makefile @@ -0,0 +1,46 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bigclown-gateway +PKG_VERSION:=1.16.1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://codeload.github.com/bigclownlabs/bch-gateway/tar.gz/v$(PKG_VERSION)? +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=9dad4663be59b8184e4501aca70295e91271d3416197d8dd123b9fbcdbcca638 +PKG_LICENSE:=MIT +PKG_BUILD_DIR:=$(BUILD_DIR)/bch-gateway-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../../lang/python/python3-package.mk + +define Package/$(PKG_NAME) + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=BigClown + URL:=https://github.com/bigclownlabs/bch-gateway + TITLE:=BigCLown gateway + DEPENDS:=+kmod-usb-serial-ftdi +kmod-usb-acm +click-log +python3-paho-mqtt +python3-pyserial +python3-pyyaml +python3-simplejson + python3-schema python3-appdirs +endef + +define Py3Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/config $(1)/etc/config/bigclown-gateway + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/init $(1)/etc/init.d/bigclown-gateway +endef + +define Package/$(PKG_NAME)/conffiles +/etc/config/bigclown-gateway +endef + +define Build/Compile + sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py" + $(call Py3Build/Compile/Default) +endef + +$(eval $(call Py3Package,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/bigclown-gateway/files/config b/bigclown-gateway/files/config new file mode 100644 index 0000000..6a60ae4 --- /dev/null +++ b/bigclown-gateway/files/config @@ -0,0 +1,10 @@ + +config gateway 'gateway' + option enabled '0' + option name 'usb-dongle' + option device '/dev/ttyUSB0' + option automatic_rename_kit_nodes '1' + +config mqtt 'mqtt' + option host 'localhost' + option port '1883' diff --git a/bigclown-gateway/files/init b/bigclown-gateway/files/init new file mode 100755 index 0000000..47c12b9 --- /dev/null +++ b/bigclown-gateway/files/init @@ -0,0 +1,58 @@ +#!/bin/sh /etc/rc.common + +START=98 +STOP=1 + +USE_PROCD=1 + +PROG=/usr/bin/bcg +CONF=/tmp/etc/bigclown-gateway.conf + +append() { + local cfg="$1" + local uci_name="$2" + local out_name="$3" + local default="$4" + config_get val $cfg $uci_name $default + if [ -n "$val" ]; then + echo "$out_name $val" >> $CONF + fi +} + +start_service() { + config_load bigclown-gateway + + local enabled + config_get_bool enabled gateway enabled "0" + [ "$enabled" = "1" ] || { + echo "Bigclown gateway service disabled" + exit 1 + } + + rm -rf $CONF + echo "Generating bigclown-gateway config file in $CONF" + + append gateway name 'name:' usb-dongle + # TODO add hotplug script and use different default here + append gateway device 'device:' /dev/ttyUSB0 + append gateway automatic_rename_kit_nodes 'automatic_rename_kit_nodes:' 1 + append gateway base_topic_prefix 'base_topic_prefix:' + + echo "mqtt:" >> $CONF + append mqtt host ' host:' localhost + append mqtt port ' port:' 1883 + append mqtt cafile ' cafile:' + append mqtt certfile ' certfile:' + append mqtt keyfile ' keyfile:' + + procd_open_instance + procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} + procd_set_param command "$PROG" -c "$CONF" -W + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger 'bigclown-gateway' +} diff --git a/bigclown-mqtt2influxdb/Makefile b/bigclown-mqtt2influxdb/Makefile new file mode 100644 index 0000000..f75ab85 --- /dev/null +++ b/bigclown-mqtt2influxdb/Makefile @@ -0,0 +1,45 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bigclown-mqtt2influxdb +PKG_VERSION:=1.1.0 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://codeload.github.com/bigclownlabs/bch-mqtt2influxdb/tar.gz/v$(PKG_VERSION)? +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=5be14132311e85215abbfd732fe6cd652522ea0a343ee8ba7abab3ec7578eb99 +PKG_LICENSE:=MIT +PKG_BUILD_DIR:=$(BUILD_DIR)/bch-mqtt2influxdb-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../../../lang/python/python3-package.mk + +define Package/$(PKG_NAME) + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=BigClown + URL:=https://github.com/bigclownlabs/bch-mqtt2influxdb + TITLE:=BigCLown MQTT to Influxdb bridge + DEPENDS:=+python3-paho-mqtt +python3-pyyaml +python3-influxdb +python3-jsonpath-ng +python3-schema +endef + +define Py3Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/init $(1)/etc/init.d/bigclown-mqtt2influxdb + $(INSTALL_DATA) ./files/config.yml $(1)/etc/bigclown-mqtt2influxdb.yml +endef + +define Package/$(PKG_NAME)/conffiles +/etc/bc-mqtt2influxdb.yml +endef + +define Build/Compile + sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py" + $(call Py3Build/Compile/Default) +endef + +$(eval $(call Py3Package,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/bigclown-mqtt2influxdb/files/config.yml b/bigclown-mqtt2influxdb/files/config.yml new file mode 100644 index 0000000..350c85a --- /dev/null +++ b/bigclown-mqtt2influxdb/files/config.yml @@ -0,0 +1,67 @@ +## Example bigclown-mqtt2influxdb configuration + +# MQTT configuration +mqtt: + #host: 127.0.0.1 + #port: 1883 + +# InfluxDB configuration +influxdb: + #host: 127.0.0.1 + #port: 8086 + #database: node + +# This is default configuration used to mirror all values produced by default +# BigClown modules firmware. You might want to add your topics or drop those for +# modules you don't own. +points: + - measurement: temperature + topic: node/+/thermometer/+/temperature + fields: + value: $.payload + tags: + id: $.topic[1] + channel: $.topic[3] + + - measurement: relative-humidity + topic: node/+/hygrometer/0:4/relative-humidity + fields: + value: $.payload + tags: + id: $.topic[1] + + - measurement: illuminance + topic: node/+/lux-meter/0:0/illuminance + fields: + value: $.payload + tags: + id: $.topic[1] + + - measurement: pressure + topic: node/+/barometer/0:0/pressure + fields: + value: $.payload + tags: + id: $.topic[1] + + - measurement: co2 + topic: node/+/co2-meter/-/concentration + fields: + value: $.payload + tags: + id: $.topic[1] + + - measurement: voltage + topic: node/+/battery/+/voltage + fields: + value: $.payload + tags: + id: $.topic[1] + + - measurement: button + topic: node/+/push-button/+/event-count + fields: + value: $.payload + tags: + id: $.topic[1] + channel: $.topic[3] diff --git a/bigclown-mqtt2influxdb/files/init b/bigclown-mqtt2influxdb/files/init new file mode 100644 index 0000000..04fae99 --- /dev/null +++ b/bigclown-mqtt2influxdb/files/init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=1 + +USE_PROCD=1 + +PROG=/usr/bin/mqtt2influxdb +CONF=/etc/bigclown-mqtt2influxdb.yml + +start_service() { + procd_open_instance + procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} + procd_set_param command "$PROG" -c "$CONF" + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} + +stop_service() { + service_stop "$PROG" +} diff --git a/python-appdirs/Makefile b/python-appdirs/Makefile new file mode 100644 index 0000000..adc81a7 --- /dev/null +++ b/python-appdirs/Makefile @@ -0,0 +1,36 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-appdirs +PKG_VERSION:=1.4.3 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://pypi.python.org/packages/source/a/appdirs/ +PKG_SOURCE:=appdirs-$(PKG_VERSION).tar.gz +PKG_HASH:=9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92 +PKG_LICENSE:=MIT +PKG_BUILD_DIR:=$(BUILD_DIR)/appdirs-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-appdirs + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/ActiveState/appdirs + TITLE:=python3-appdirs + DEPENDS:=+python3-light + VARIANT:=python3 +endef + +define Package/python-appdirs/description + The Universal Character Encoding Detector +endef + +$(eval $(call Py3Package,python3-appdirs)) +$(eval $(call BuildPackage,python3-appdirs)) +$(eval $(call BuildPackage,python3-appdirs-src)) diff --git a/python-chardet/Makefile b/python-chardet/Makefile new file mode 100644 index 0000000..ed44fcf --- /dev/null +++ b/python-chardet/Makefile @@ -0,0 +1,36 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-chardet +PKG_VERSION:=3.0.4 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://pypi.python.org/packages/source/c/chardet/ +PKG_SOURCE:=chardet-$(PKG_VERSION).tar.gz +PKG_HASH:=84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae +PKG_LICENSE:=GPLv2.1 +PKG_BUILD_DIR:=$(BUILD_DIR)/chardet-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-chardet + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/chardet/chardet + TITLE:=python3-chardet + DEPENDS:=+python3-light + VARIANT:=python3 +endef + +define Package/python-chardet/description + The Universal Character Encoding Detector +endef + +$(eval $(call Py3Package,python3-chardet)) +$(eval $(call BuildPackage,python3-chardet)) +$(eval $(call BuildPackage,python3-chardet-src)) diff --git a/python-decorator/Makefile b/python-decorator/Makefile new file mode 100644 index 0000000..92883d9 --- /dev/null +++ b/python-decorator/Makefile @@ -0,0 +1,31 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-decorator +PKG_VERSION:=4.3.2 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://codeload.github.com/micheles/decorator/tar.gz/$(PKG_VERSION)? +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=c053ec881270608a5aef624a45a7700ec76ceca9d96689506411e1f319085380 +PKG_BUILD_DIR:=$(BUILD_DIR)/decorator-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-decorator + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/micheles/decorator + TITLE:=python3-decodator + DEPENDS:=+python3-light + VARIANT:=python3 +endef + +$(eval $(call Py3Package,python3-decorator)) +$(eval $(call BuildPackage,python3-decorator)) +$(eval $(call BuildPackage,python3-decorator-src)) diff --git a/python-influxdb/Makefile b/python-influxdb/Makefile new file mode 100644 index 0000000..1de4389 --- /dev/null +++ b/python-influxdb/Makefile @@ -0,0 +1,36 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-influxdb +PKG_VERSION:=5.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://pypi.python.org/packages/source/i/influxdb/ +PKG_SOURCE:=influxdb-$(PKG_VERSION).tar.gz +PKG_HASH:=75d96de25d0d4e9e66e155f64dc9dc2a48de74ac4e77e3a46ad881fba772e3b6 +PKG_LICENSE:=MIT +PKG_BUILD_DIR:=$(BUILD_DIR)/influxdb-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-influxdb + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/influxdb/influxdb-python + TITLE:=python3-influxdb + DEPENDS:=+python3-requests +python3-pytz +python3-six +python3-dateutil + VARIANT:=python3 +endef + +define Package/python3-influxdb/description + Python client for InfluxDB +endef + +$(eval $(call Py3Package,python3-influxdb)) +$(eval $(call BuildPackage,python3-influxdb)) +$(eval $(call BuildPackage,python3-influxdb-src)) diff --git a/python-jsonpath-ng/Makefile b/python-jsonpath-ng/Makefile new file mode 100644 index 0000000..985c46c --- /dev/null +++ b/python-jsonpath-ng/Makefile @@ -0,0 +1,31 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jsonpath-ng +PKG_VERSION:=1.4.3 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://pypi.python.org/packages/source/j/jsonpath-ng/ +PKG_SOURCE:=jsonpath-ng-$(PKG_VERSION).tar.gz +PKG_HASH:=b1fc75b877e9b2f46845a455fbdcfb0f0d9c727c45c19a745d02db620a9ef0be +PKG_BUILD_DIR:=$(BUILD_DIR)/jsonpath-ng-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jsonpath-ng + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/h2non/jsonpath-ng + TITLE:=python3-jsonpath-ng + DEPENDS:=+python3-ply +python3-six +python3-decorator + VARIANT:=python3 +endef + +$(eval $(call Py3Package,python3-jsonpath-ng)) +$(eval $(call BuildPackage,python3-jsonpath-ng)) +$(eval $(call BuildPackage,python3-jsonpath-ng-src)) diff --git a/python-schema/Makefile b/python-schema/Makefile new file mode 100644 index 0000000..6a8fc17 --- /dev/null +++ b/python-schema/Makefile @@ -0,0 +1,35 @@ +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-schema +PKG_VERSION:=0.7.2 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=https://codeload.github.com/keleshev/schema/tar.gz/v$(PKG_VERSION)? +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=df35c5ecf00f890f6c4780007478c72403730641c83392bae97d4f41f1172805 +PKG_BUILD_DIR:=$(BUILD_DIR)/schema-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-schema + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + URL:=https://github.com/keleshev/schema + TITLE:=python3-schema + DEPENDS:=+python3-light + VARIANT:=python3 +endef + +define Package/python3-schema/description + Schema validation just got Pythonic +endef + +$(eval $(call Py3Package,python3-schema)) +$(eval $(call BuildPackage,python3-schema)) +$(eval $(call BuildPackage,python3-schema-src)) |