notes about factory reset
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Mar 2023 17:28:19 +0000 (18:28 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Mar 2023 17:28:19 +0000 (18:28 +0100)
docs/factory-reset.txt [new file with mode: 0644]
factory-reset-setup-again.sh [new file with mode: 0755]

diff --git a/docs/factory-reset.txt b/docs/factory-reset.txt
new file mode 100644 (file)
index 0000000..fb3de96
--- /dev/null
@@ -0,0 +1,33 @@
+To reset power to sernsor, disconnect battery for 40s to drain all capacitors
+(count from 20 to 60 to produce 40s timeout)
+
+Pressing S6 button can be done only when sensor is active (after plugging in battery
+for example)
+
+start server on mqtt.zc‐ssensor.com
+
+dpavlin@subvision:~/zc$ ./mqtt-zc-sensor.sh
+
+Prepare new mqtt server:
+
+./zc-send queue/864823042076992 mqtt
+./zc-send queue/864823042076992 interval 300
+
+factory reset will also reset interval to 86400 seconds
+
+
+
+
+4. Reset Factorry Default Settting
+
+When the product is working abnormally, user can use button S6 to reset the default
+parameters.
+
+Press and hold the buttton S6 for 3 seconds, you will see the sensor red and green lights (D3, D4 LED)
+flash synchronously at 4Hz frequency, then D3, D4 keep light on at the same time.
+
+Release the button S6 now and wait for about 3 seconds, the device will reboot and the parameters
+will be reestored to their default state.
+
+The senssor server IP with CTIOT protocol is restoreed to 117.60.157.137, 568 83.
+For sensor of MQTT prrotocol, the proxy server IP willl be restored to mqtt.zc‐ssensor.com, 1883.
diff --git a/factory-reset-setup-again.sh b/factory-reset-setup-again.sh
new file mode 100755 (executable)
index 0000000..84039e6
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+restore_settings() {
+       echo "# restore settings for sensor $1"
+       ./zc-send $1 
+       ./zc-send $1 mqtt
+       ./zc-send $1 
+       ./zc-send $1 interval 300
+       ./zc-send $1
+}
+
+if [ -d "$1" ] ; then
+       restore_settings $1
+elif [ ! -z "$1" ] ; then
+       grep $1 subvision-numbers.txt | tee /tmp/restore
+       cat /tmp/restore | awk '{ print "queue/"$3 }' | while read queue_path ; do
+               restore_settings $queue_path
+       done
+else
+       echo "usage: $0 queue/864823042076992"
+       echo "   or: $0 pattern-from-subvision-numbers.txt"
+fi
+