summaryrefslogtreecommitdiff
path: root/inventory/group_vars
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-09-19 02:20:57 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-09-19 02:20:57 +0200
commit62c5dbf2c4e1014910b13860ba4e6fe06f6ffd08 (patch)
tree8a34cc70b7be11d2d442a926e46cf59e4893c342 /inventory/group_vars
parentemc k8s cluster has been upgraded (diff)
improved sensors initialization
Diffstat (limited to 'inventory/group_vars')
-rw-r--r--inventory/group_vars/chaos-at-home-sensors/vars.yml33
1 files changed, 23 insertions, 10 deletions
diff --git a/inventory/group_vars/chaos-at-home-sensors/vars.yml b/inventory/group_vars/chaos-at-home-sensors/vars.yml
index 2eea9b2c..7f4a93eb 100644
--- a/inventory/group_vars/chaos-at-home-sensors/vars.yml
+++ b/inventory/group_vars/chaos-at-home-sensors/vars.yml
@@ -1,5 +1,20 @@
---
sensornode_network_wired: no
+sensornode_sensors: {}
+
+# TODO: add script to initialize i2c devices
+## I2C Bus init examples:
+## * add 8ch mux: echo "pca9548 0x70" > /sys/bus/i2c/devices/i2c-0/new_device
+## * add DS2482: echo "ds2482 0x18" > /sys/bus/i2c/devices/i2c-0/new_device
+## * add ADS1115: echo "ads1115 0x48" > /sys/bus/i2c/devices/i2c-0/new_device
+## * add BME280: echo "bme280 0x76" > /sys/bus/i2c/devices/i2c-1/new_device
+## * add BMP280: echo "bmp280 0x77" > /sys/bus/i2c/devices/i2c-1/new_device
+## * add AM2315: echo "am2315 0x5c" > /sys/bus/i2c/devices/i2c-1/new_device
+## * add MCP3221: echo "mcp3221 0x4d" > /sys/bus/i2c/devices/i2c-2/new_device
+
+# TODO: add collector for prometheus to export i2c-sensor data
+
+
install_playbook: openwrt
@@ -59,17 +74,15 @@ openwrt_mixin:
/etc/htoprc:
file: "{{ global_files_dir }}/common/htoprc"
-# TODO: add script to initialize i2c devices
-## I2C Bus init examples:
-## * add 8ch mux: echo "pca9548 0x70" > /sys/bus/i2c/devices/i2c-0/new_device
-## * add DS2482: echo "ds2482 0x18" > /sys/bus/i2c/devices/i2c-0/new_device
-## * add ADS1115: echo "ads1115 0x48" > /sys/bus/i2c/devices/i2c-0/new_device
-## * add BME280: echo "bme280 0x76" > /sys/bus/i2c/devices/i2c-1/new_device
-## * add BMP280: echo "bmp280 0x77" > /sys/bus/i2c/devices/i2c-1/new_device
-## * add AM2315: echo "am2315 0x5c" > /sys/bus/i2c/devices/i2c-1/new_device
-## * add MCP3221: echo "mcp3221 0x4d" > /sys/bus/i2c/devices/i2c-2/new_device
+ /etc/sensors.json:
+ content: "{{ sensornode_sensors | to_nice_json(indent=2) }}\n"
-# TODO: add collector for prometheus to export i2c-sensor data
+ /usr/lib/lua/sensors.lua:
+ file: "{{ global_files_dir }}/common/openwrt/sensors.module_lua"
+
+ /usr/libexec/sensors-init.lua:
+ file: "{{ global_files_dir }}/common/openwrt/sensors-init.lua"
+ mode: "0755"
openwrt_uci: