From: Paul Hänsch Date: Thu, 5 Sep 2019 09:08:32 +0000 (+0200) Subject: Cadus life Sensor plugins X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=5711c10c8e09f928a78d4d7bf4c0a360a736b478;p=blast Cadus life Sensor plugins --- 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 "$