From 5711c10c8e09f928a78d4d7bf4c0a360a736b478 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 5 Sep 2019 11:08:32 +0200 Subject: [PATCH] Cadus life Sensor plugins --- modules/remo2hbo.mk | 113 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 modules/remo2hbo.mk diff --git a/modules/remo2hbo.mk b/modules/remo2hbo.mk new file mode 100644 index 0000000..e4c3a2d --- /dev/null +++ b/modules/remo2hbo.mk @@ -0,0 +1,113 @@ +PACKAGES += chromium-browser ssh bridge-utils dnsmasq iptables make nmap openbsd-inetd bluez-tools +hostname := oktopus +users += oktopus + +nodm_user := oktopus +webui := http://localhost/ +include modules/nodm.mk + +define RPICONFIG += + +dtoverlay=w1-gpio +dtparam=spi=on +dtoverlay=mcp3008:spi0-0-present,spi0-32768-speed + +endef + +export oktopus_dnsmasq oktopus_btnap oktopus_eth oktopus_rclocal + +define oktopus_dnsmasq := +listen-address=192.168.82.1 +bind-interfaces + +dhcp-authoritative +dhcp-range=192.168.82.16,192.168.82.254,48h + +address=/#/192.168.82.1 +endef + +define oktopus_eth := +auto eth0 +allow-hotplug eth0 +iface eth0 inet static + address 192.168.83.1 + netmask 255.255.255.0 +endef + +define oktopus_btnap := +auto br0 +iface br0 inet static + address 192.168.82.1 + netmask 255.255.255.0 + bridge_ports none + bridge_fd 5 + bridge_stp no +endef + +define oktopus_rclocal := +#!/bin/sh + +modprobe w1-gpio pullup=1 +modprobe w1-therm + +while ! hciconfig hci0; do sleep 1; done +bt-network -s nap br0 & +hciconfig hci0 up +hciconfig hci0 sspmode 1 +hciconfig hci0 piscan + +while sleep 5; do + bt-device -l \ + | grep -oE '[0-9A-F:]{17}' \ + | while read mac; do + bt-device --set "$$mac" Trusted 1 + done +done & + +/srv/gummikraken/hatch.sh & +endef + + +_config: ${CFGROOT}/etc/dnsmasq.conf ${CFGROOT}/etc/network/interfaces.d/btnap ${CFGROOT}/etc/rc.local +_config: ${CFGROOT}/etc/inetd.conf ${CFGROOT}/etc/network/interfaces.d/eth +_config: ${CFGROOT}/usr/local/bin/teesock ${CFGROOT}/srv/gummikraken + +${CFGROOT}/etc/dnsmasq.conf: ${CFGROOT} + printf '%s\n' "$$oktopus_dnsmasq" >"$@" + +${CFGROOT}/etc/network/interfaces.d/btnap: ${CFGROOT} + mkdir -p "$(dir $@)" + printf '%s\n' "$$oktopus_btnap" >"$@" + +${CFGROOT}/etc/network/interfaces.d/eth: ${CFGROOT} + mkdir -p "$(dir $@)" + printf '%s\n' "$$oktopus_eth" >"$@" + +${CFGROOT}/etc/rc.local: ${CFGROOT} + # chroot "$${CFGROOT}" systemctl enable rc-local + printf '%s\n' "$$oktopus_rclocal" >"$@" + chmod 755 "$@" + +${CFGROOT}/usr/local/bin/teesock: teesock/teesock.arm ${CFGROOT} + cp "$<" "$@" + +${CFGROOT}/srv/gummikraken: gummikraken/ ${CFGROOT} + cp -au "$