diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-09-19 02:20:57 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-09-19 02:20:57 +0200 |
commit | 62c5dbf2c4e1014910b13860ba4e6fe06f6ffd08 (patch) | |
tree | 8a34cc70b7be11d2d442a926e46cf59e4893c342 /inventory/group_vars | |
parent | emc 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.yml | 33 |
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: |