From 30f459b208bca6af7494ef275dd73dac039f4c8f Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 11 Mar 2023 18:28:19 +0100 Subject: [PATCH] notes about factory reset --- docs/factory-reset.txt | 33 +++++++++++++++++++++++++++++++++ factory-reset-setup-again.sh | 23 +++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 docs/factory-reset.txt create mode 100755 factory-reset-setup-again.sh diff --git a/docs/factory-reset.txt b/docs/factory-reset.txt new file mode 100644 index 0000000..fb3de96 --- /dev/null +++ b/docs/factory-reset.txt @@ -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 index 0000000..84039e6 --- /dev/null +++ b/factory-reset-setup-again.sh @@ -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 + -- 2.20.1