]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_ctfws/commitdiff
Check in much of the device configuration
authorNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sat, 29 Jun 2019 12:38:39 +0000 (13:38 +0100)
committerNathaniel Wesley Filardo <nwfilardo@gmail.com>
Sat, 29 Jun 2019 15:24:05 +0000 (16:24 +0100)
Move passwords out to rewrites so that almost everything else can land.
While here, make the MQTT configuration set the timeout to 100 seconds
so that we get LWT messages sent much more promptly.

fixup timeout

13 files changed:
README.rst
conf/.gitignore [new file with mode: 0644]
conf/_common/nwfmqtt.conf.in [new file with mode: 0644]
conf/_common/nwfnet.conf [new file with mode: 0644]
conf/_common/nwfnet.conf2 [new file with mode: 0644]
conf/clr/nwfnet.conf [new symlink]
conf/clr/nwfnet.conf2 [new symlink]
conf/red/nwfnet.conf [new symlink]
conf/red/nwfnet.conf2 [new symlink]
conf/yel/ctfws-misc.conf [new file with mode: 0644]
conf/yel/nwfnet.conf [new symlink]
conf/yel/nwfnet.conf2 [new symlink]
mkspiffs.sh

index b1bba45a4f13e3b06f34eb113cbd46173f645af7..361964e003d50e4f8dd369c30e974a957b23fe95 100644 (file)
@@ -192,6 +192,7 @@ Configuration Files
 
 * ``nwfnet.conf`` has details of how to get connectivity to the network.
 * ``nwfnet.conf2`` sets the SNTP server to use
-* ``nwfmqtt.conf`` sets the MQTT server and credentials
-
-
+* ``nwfmqtt.conf`` sets the MQTT server and credentials; it is derived from
+  ``nwfmqtt.conf.in`` via ``rewrites.sed`` in the configuration directories;
+  note that the latter of which is deliberately not checked in.
+* ``ctfws-misc.conf`` can be used to assign the LCD I2C address
diff --git a/conf/.gitignore b/conf/.gitignore
new file mode 100644 (file)
index 0000000..f66c198
--- /dev/null
@@ -0,0 +1 @@
+rewrites.sed
diff --git a/conf/_common/nwfmqtt.conf.in b/conf/_common/nwfmqtt.conf.in
new file mode 100644 (file)
index 0000000..9aee1d9
--- /dev/null
@@ -0,0 +1,9 @@
+{
+  "broker": "kgb.club.cc.cmu.edu",
+  "port": 1883,
+  "secure" : 0,
+  "clean": 1,
+  "keepalive": 100,
+  "user": "@@MQTT_USER@@",
+  "pass": "@@MQTT_PASSWORD@@"
+}
diff --git a/conf/_common/nwfnet.conf b/conf/_common/nwfnet.conf
new file mode 100644 (file)
index 0000000..c9a6738
--- /dev/null
@@ -0,0 +1 @@
+{ "wifi_mode":"station", "sta_essid": "CMU", "sta_pw": "", "keepfile":1 }
diff --git a/conf/_common/nwfnet.conf2 b/conf/_common/nwfnet.conf2
new file mode 100644 (file)
index 0000000..27752fd
--- /dev/null
@@ -0,0 +1 @@
+{ "sntp": "ntp.cmu.edu" }
diff --git a/conf/clr/nwfnet.conf b/conf/clr/nwfnet.conf
new file mode 120000 (symlink)
index 0000000..396dcb2
--- /dev/null
@@ -0,0 +1 @@
+../_common/nwfnet.conf
\ No newline at end of file
diff --git a/conf/clr/nwfnet.conf2 b/conf/clr/nwfnet.conf2
new file mode 120000 (symlink)
index 0000000..717195b
--- /dev/null
@@ -0,0 +1 @@
+../_common/nwfnet.conf2
\ No newline at end of file
diff --git a/conf/red/nwfnet.conf b/conf/red/nwfnet.conf
new file mode 120000 (symlink)
index 0000000..396dcb2
--- /dev/null
@@ -0,0 +1 @@
+../_common/nwfnet.conf
\ No newline at end of file
diff --git a/conf/red/nwfnet.conf2 b/conf/red/nwfnet.conf2
new file mode 120000 (symlink)
index 0000000..717195b
--- /dev/null
@@ -0,0 +1 @@
+../_common/nwfnet.conf2
\ No newline at end of file
diff --git a/conf/yel/ctfws-misc.conf b/conf/yel/ctfws-misc.conf
new file mode 100644 (file)
index 0000000..7425bdc
--- /dev/null
@@ -0,0 +1 @@
+{ "lcd": 63 }
diff --git a/conf/yel/nwfnet.conf b/conf/yel/nwfnet.conf
new file mode 120000 (symlink)
index 0000000..396dcb2
--- /dev/null
@@ -0,0 +1 @@
+../_common/nwfnet.conf
\ No newline at end of file
diff --git a/conf/yel/nwfnet.conf2 b/conf/yel/nwfnet.conf2
new file mode 120000 (symlink)
index 0000000..717195b
--- /dev/null
@@ -0,0 +1 @@
+../_common/nwfnet.conf2
\ No newline at end of file
index dc3f78168f5aca5f8bb713c44a02cc11bea11d82..d940ccc5a3b9a6e74eaac6e857b1a3eb6ad06bb8 100755 (executable)
@@ -13,7 +13,15 @@ LUACROSS=${FWDIR}/luac.cross ./mklfs.sh
        echo import core/init.lua init.lua
 
        # Grab our configuration
-       for i in conf/${CONFNAME}/*; do echo import $i `basename $i`; done
+       if [ -r conf/${CONFNAME}/rewrites.sed ]; then
+               for i in conf/_common/*.conf.in; do
+                       sed -f conf/${CONFNAME}/rewrites.sed < $i \
+                               > `dirname $i`/`basename $i .in`
+               done
+       elif [ ! -r conf/${CONFNAME}/nwfmqtt.conf ]; then
+               echo 'NO MQTT CONFIGURATION KNOWN; THIS IS UNLIKELY TO WORK!'
+       fi
+       for i in conf/${CONFNAME}/*.conf; do echo import $i `basename $i`; done
 
        # And all our Lua files
        for i in *.lua; do echo import $i $i; done