summaryrefslogtreecommitdiff
path: root/inventory/group_vars/chaos-at-home-sensors
diff options
context:
space:
mode:
Diffstat (limited to 'inventory/group_vars/chaos-at-home-sensors')
-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: