Sync gk7205v300_ultimate_oko project

pull/1/head
Igor Zalatov (from Citadel PC) 2022-11-14 22:21:29 +03:00
parent c7b4c95c30
commit fb9afe09c3
101 changed files with 4774 additions and 0 deletions

View File

@ -0,0 +1,303 @@
#!/bin/bash
#
# OpenIPC.org (c)
#
#
# Constants
#
MAX_KERNEL_SIZE=0x200000 # 2MiB, 2097152
MAX_KERNEL_SIZE_ULTIMATE=0x300000 # 3MiB, 3145728
MAX_KERNEL_SIZE_EXPERIMENTAL=0x3E8480 # ~3.9MiB, 4097152
MAX_ROOTFS_SIZE=0x500000 # 5MiB, 5242880
MAX_ROOTFS_SIZE_ULTIMATE=0xA00000 # 10MiB, 10485760
_d=$(date +"%y.%m.%d")
OPENIPC_VER=$(echo OpenIPC v${_d:0:1}.${_d:1})
unset _d
SRC_CACHE_DIR="/tmp/buildroot_dl"
#
# Functions
#
echo_c() {
# 30 grey, 31 red, 32 green, 33 yellow, 34 blue, 35 magenta, 36 cyan,37 white
echo -e "\e[1;$1m$2\e[0m"
}
log_and_run() {
_command=$1
echo_c 35 "$_command"
$_command
unset _command
}
clone() {
sudo apt-get update -y
sudo apt-get install -y automake autotools-dev bc build-essential curl fzf git libtool rsync unzip
git clone --depth=1 https://github.com/OpenIPC/firmware.git
}
fresh() {
BR_VER=$1
if [ -d "$SRC_CACHE_DIR" ]; then
echo_c 36 "Found cache directory."
else
echo_c 31 "Cache directory not found."
echo_c 34 "Creating cache directory ..."
log_and_run "mkdir -p ${SRC_CACHE_DIR}"
echo_c 34 "Done.\n"
fi
if [ -d "buildroot-${BR_VER}" ]; then
echo_c 36 "Found existing Buildroot directory."
if [ -d "buildroot-${BR_VER}/dl" ]; then
echo_c 36 "Found existing Buildroot downloads directory."
echo_c 34 "Copying Buildroot downloads to cache directory ..."
log_and_run "cp -rvf buildroot-${BR_VER}/dl/* ${SRC_CACHE_DIR}"
echo_c 34 "Done.\n"
fi
echo_c 34 "Cleaning source directory."
echo_c 35 "make distclean"
make distclean
echo_c 34 "Done.\n"
else
echo_c 31 "Buildroot sources not found."
fi
echo_c 34 "Downloading Buildroot sources to cache directory ..."
log_and_run "curl --continue-at - --output ${SRC_CACHE_DIR}/buildroot-${BR_VER}.tar.gz https://buildroot.org/downloads/buildroot-${BR_VER}.tar.gz"
echo_c 34 "Done.\n"
echo_c 34 "Extracting a fresh copy of Buildroot from Buildroot sources ..."
log_and_run "tar xvf ${SRC_CACHE_DIR}/buildroot-${BR_VER}.tar.gz"
echo_c 34 "Done.\n"
echo_c 34 "Copying cached source files back to Buildroot ..."
log_and_run "mkdir -p buildroot-${BR_VER}/dl/"
log_and_run "cp -rvf ${SRC_CACHE_DIR}/* buildroot-${BR_VER}/dl/"
echo_c 34 "Done.\n"
# make prepare
echo_c 33 "Start building OpenIPC Firmware ${OPENIPC_VER} for ${SOC}."
echo "The start-stop times" >/tmp/openipc_buildtime.txt
date >>/tmp/openipc_buildtime.txt
}
should_fit() {
filename=$1
maxsize=$2
filesize=$(stat --printf="%s" ./output/images/$filename)
if [[ $filesize -gt $maxsize ]]; then
export TG_NOTIFY="Warning: $filename is too large: $filesize vs $maxsize"
echo_c 31 "Warning: $filename is too large: $filesize vs $maxsize"
exit 1
fi
}
rename() {
if grep -q ultimate_defconfig ./output/.config || grep -q ultimate_oko_defconfig ./output/.config || grep -q fpv_defconfig ./output/.config; then
should_fit uImage $MAX_KERNEL_SIZE_ULTIMATE
should_fit rootfs.squashfs $MAX_ROOTFS_SIZE_ULTIMATE
else
should_fit uImage $MAX_KERNEL_SIZE
should_fit rootfs.squashfs $MAX_ROOTFS_SIZE
fi
mv -v ./output/images/uImage ./output/images/uImage.${SOC}
mv -v ./output/images/rootfs.squashfs ./output/images/rootfs.squashfs.${SOC}
mv -v ./output/images/rootfs.cpio ./output/images/rootfs.${SOC}.cpio
mv -v ./output/images/rootfs.tar ./output/images/rootfs.${SOC}.tar
date >>/tmp/openipc_buildtime.txt
echo_c 31 "\n\n$(cat /tmp/openipc_buildtime.txt)\n\n"
}
rename_initramfs() {
should_fit uImage $MAX_KERNEL_SIZE_EXPERIMENTAL
mv -v ./output/images/uImage ./output/images/uImage.initramfs.${SOC}
mv -v ./output/images/rootfs.cpio ./output/images/rootfs.${SOC}.cpio
mv -v ./output/images/rootfs.tar ./output/images/rootfs.${SOC}.tar
date >>/tmp/openipc_buildtime.txt
echo_c 31 "\n\n$(cat /tmp/openipc_buildtime.txt)\n\n"
}
autoup_rootfs() {
echo_c 34 "\nDownloading u-boot created by OpenIPC"
curl --location --output ./output/images/u-boot-${SOC}-universal.bin \
https://github.com/OpenIPC/firmware/releases/download/latest/u-boot-${SOC}-universal.bin
echo_c 34 "\nMaking autoupdate u-boot image"
./output/host/bin/mkimage -A arm -O linux -T firmware -n "$OPENIPC_VER" \
-a 0x0 -e 0x50000 -d ./output/images/u-boot-${SOC}-universal.bin \
./output/images/autoupdate-uboot.img
echo_c 34 "\nMaking autoupdate kernel image"
./output/host/bin/mkimage -A arm -O linux -T kernel -C none -n "$OPENIPC_VER" \
-a 0x50000 -e 0x250000 -d ./output/images/uImage.${SOC} \
./output/images/autoupdate-kernel.img
echo_c 34 "\nMaking autoupdate rootfs image"
./output/host/bin/mkimage -A arm -O linux -T filesystem -n "$OPENIPC_VER" \
-a 0x250000 -e 0x750000 -d ./output/images/rootfs.squashfs.${SOC} \
./output/images/autoupdate-rootfs.img
}
#################################################################################
FUNCS=(
ambarella-s3l
ak3916ev300
ak3918ev300
fh8833v100
fh8852v100
fh8852v200
fh8852v210
fh8856v100
fh8856v200
fh8856v210
fh8858v200
fh8858v210
gk7101
gk7101s
gk7102
gk7102s
gk7202v300
gk7205v200 gk7205v200_fpv gk7205v200_ultimate
gk7205v210
gk7205v300 gk7205v300_fpv gk7205v300_ultimate
gk7605v100
gm8135
gm8136
hi3516cv100
hi3518ev100
hi3516cv200
hi3518ev200 hi3518ev200_ultimate
hi3516cv300 hi3516cv300_ultimate
hi3516ev100
hi3516av100 hi3516av100_ultimate
hi3516dv100 hi3516dv100_ultimate
hi3519v101
hi3516av200 hi3516av200_ultimate
hi3516av300
hi3516cv500
hi3516dv300
hi3516dv200
hi3516ev200 hi3516ev200_fpv hi3516ev200_ultimate hi3516ev200_eltis
hi3516ev300 hi3516ev300_fpv hi3516ev300_ultimate hi3516ev300_dev hi3516ev300_glibc hi3516ev300_tehshield
hi3518ev300 hi3518ev300_ultimate
hi3536cv100
hi3536dv100 hi3536dv100_vixand
msc313e msc313e_baresip
msc316dc
msc316dm
nt98562
nt98566
rv1109
rv1126
ssc325
ssc333
ssc335 ssc335_blackbird ssc335_goodcam ssc335_initramfs ssc335_musl ssc335_portal ssc335_rotek ssc335_tiandy
ssc337 ssc337_kama
ssc335de
ssc337de
t10
t20
t30
t31 t31_ultimate
xm510
xm530
xm550
)
copy_function() {
test -n "$(declare -f "$1")" || return
eval "${_/$1/$2}"
}
uni_build() {
[ -z "$BOARD" ] && BOARD=$FUNCNAME
SOC=$(echo $BOARD | cut -d '_' -f 1)
set -e
if [ "$(echo $BOARD | cut -sd '_' -f 2)" == "" ]; then
BOARD="${BOARD}_lite"
fi
if [ "$BOARD" == "hi3518ev200_lite" ]; then
NEED_AUTOUP=1
fi
echo_c 33 "\n SoC: $SOC\nBoard: $BOARD\n"
if [ "all" = "${COMMAND}" ]; then
fresh $(make BOARD=${BOARD} buildroot-version)
fi
log_and_run "make BOARD=${BOARD} ${COMMAND}"
if [ "all" = "${COMMAND}" ]; then
if [ "$BOARD" == "ssc335_initramfs" ]; then
rename_initramfs
else
rename
fi
if [ ! -z "$NEED_AUTOUP" ]; then
autoup_rootfs
fi
fi
}
for i in "${FUNCS[@]}"; do
copy_function uni_build $i
done
#######
if [ $# -eq 0 ]; then
if ! command -v fzf >/dev/null 2>&1; then
echo -ne "Usage: $0 <variant>\nVariants:"
for i in "${FUNCS[@]}"; do echo -n " ${i}"; done
echo
exit 1
else
SELECTED=$(find . -path "*/br-ext-chip-*" -name "*_defconfig" | fzf)
[ -z "$SELECTED" ] && exit 1
BOARD=$(echo $SELECTED | cut -d / -f 4 | awk -F_ '{printf "%s_%s", $1, $2}')
fi
else
BOARD=$1
fi
COMMAND=$2
[ -z "$COMMAND" ] && COMMAND=all
echo_c 37 "Building OpenIPC for ${BOARD}"
uni_build $BOARD $COMMAND

View File

@ -0,0 +1 @@
<+03>-3

View File

@ -0,0 +1,8 @@
#!/bin/sh
at AT+CGDCONT=1,"IP","Internet"
at AT+CGACT=1,1
at AT+CGPADDR=1
at AT+QCFG="usbnet",1
at at+qnetdevctl=1,1,1

View File

@ -0,0 +1,21 @@
#!/bin/sh
case "$1" in
start)
hwclock -s
pwr 7 0
sleep 3 &&
modprobe mt7601u
modprobe usbserial vendor=0x28e9 product=0x018a;
sleep 3 &&
qw 0 AT+LDB+on
qw 0 AT+MDM+on
qw 0 AT+AP5+on
morg &
;;
stop)
pwr 7 1
qw 0 AT+MDM+off
;;
esac

View File

@ -0,0 +1,134 @@
#!/bin/sh
readconfig() {
echo "=============------------ Read cofig --------------============"
rcfg
echo "================-------- Parse config -------------============"
ssid=`cat /tmp/config.txt | grep ssid | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d " " -f 2`
key=`cat /tmp/config.txt | grep ^key | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`
###########################
privkey=`cat /tmp/config.txt | grep PrivateKey | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`
addrcam=`cat /tmp/config.txt | grep Address | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;addrcam="${addrcam%/*}"
gateway=`cat /tmp/config.txt | grep Gateway | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;gateway="${gateway%<*}"
pubkey=`cat /tmp/config.txt | grep PublicKey | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`
allowips=`cat /tmp/config.txt | grep AllowedIPs | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;allowips="${allowips%<*}"
endpoint=`cat /tmp/config.txt | grep Endpoint | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d: -d " " -f 2`;endpoint="${endpoint%<*}"
###########################
dumpconfig=`echo -n "$ssid$key"`
}
setconfig() {
echo "===========-------------- set wifi config ------------=========="
if [[ ! -z "$ssid" && ! -z "$key" ]]
then
cur=`sed -n '3p' /usr/bin/crCli`
new="wpa_passphrase $ssid $key >/tmp/wpa_supplicant.conf"
if [[ "$cur" == "$new" ]]
then
echo "Ok. ssid not replaced"
else
echo "Ok. Set new ssid, key"
sed -i '3d' /usr/bin/crCli
sed -i "3i \\$new" /usr/bin/crCli
fi
fi
if [[ ! -z "$privkey" && ! -z "$addrcam" && ! -z "$pubkey" && ! -z "$allowips" && ! -z "$endpoint" ]]
then
echo "=======---------- Not Null ------========"
corr=0
#########################################################################
addrcam="address ${addrcam%/*}"
gateway="gateway ${gateway%/*}"
privkey="PrivateKey = $privkey"
pubkey="PublicKey = $pubkey"
allowips="AllowedIPs = $allowips"
endpoint="Endpoint = $endpoint"
eaddrcam=`sed -n '48p' /etc/network/interfaces | sed 's/^ *//'`
egateway=`sed -n '50p' /etc/network/interfaces | sed 's/^ *//'`
eprivkey=`cat /etc/wireguard.conf | grep PrivateKey`
epubkey=`cat /etc/wireguard.conf | grep PublicKey`
eallowips=`cat /etc/wireguard.conf | grep AllowedIPs`
eendpoint=`cat /etc/wireguard.conf | grep Endpoint`
if [[ ! "$addrcam" == "$eaddrcam" ]]
then
sed -i '48d' /etc/network/interfaces
sed -i "48i \\$addrcam" /etc/network/interfaces
corr=1
echo "==========----------- correct addr in interfaces ---------========"
fi
if [[ ! "$gateway" == "$egateway" ]]
then
sed -i '50d' /etc/network/interfaces
sed -i "50i \\$gateway" /etc/network/interfaces
corr=1
echo "======------ correct gateway in interfaces -----====="
fi
if [[ ! "$privkey" == "$eprivkey" ]]
then
corr=1
fi
if [[ ! "$pubkey" == "$epubkey" ]]
then
corr=1
fi
if [[ ! "$allowips" == "$eallowips" ]]
then
corr=1
fi
if [[ ! "$endpoint" == "$eendpoint" ]]
then
corr=1
fi
if [[ $corr == 1 ]]
then
echo "===========--------------- Set WG ----------============"
echo "WG addr:: $addrcam"
if [[ ! "$addrcam" == "address xxx.xxx.xxx.xxx" ]]
then sed -i '46s/manual/auto/' /etc/network/interfaces
else sed -i '46s/auto/manual/' /etc/network/interfaces
fi
rm -f /etc/wireguard.conf
echo "[Interface]" >> /etc/wireguard.conf
echo "$privkey" >> /etc/wireguard.conf
echo "[Peer]" >> /etc/wireguard.conf
echo "$pubkey" >> /etc/wireguard.conf
echo "$allowips" >> /etc/wireguard.conf
echo "$endpoint" >> /etc/wireguard.conf
echo "PersistentKeepalive = 5" >> /etc/wireguard.conf
rm -f /sdcard/config.hex
rm -f /sdcard/config.txt
fi
fi
}
checkconfig() {
echo "check config"
if [ -f /sdcard/config.hex ]
then
echo "config exist"
readconfig
setconfig
else
echo "config not exist"
fi
if [ -f /sdcard/hardres ]
then
rm -f /sdcard/hardres
firstboot
fi
}
case "$1" in
start)
echo "read config on SDcard"
checkconfig
echo "set config done"
# commands to launch application
;;
esac

View File

@ -0,0 +1,44 @@
#!/bin/sh
hands() {
echo "0" > /tmp/maxf
echo "0" > /tmp/lst
echo "0" > /tmp/st
echo "0" > /tmp/zx
sleep 3;
if [[ "$(getenv apmode)" == "1" ]]
then
crAp
else
crCli
fi
light 1
sleep 0.5
light 0
#eaddrcam=`sed -n '56p' /etc/network/interfaces | sed 's/^ *//'`
#rcaddr="address xxx.xxx.xxx.xxx"
}
case "$1" in
start)
echo "hands WG"
hands
auto_f &
zx &
warmlight &
qw 0 AT+CU2+40
prconn &
;;
stop)
killall auto_f
killall zx
killall warmlight
killall morg
light 0
qw 0 AT+ALL>0
killall uqmi
qw 0 AT+CU2+0
killall prconn
;;
esac

View File

@ -0,0 +1,79 @@
system:
buffer: 2048
image:
mirror: false
flip: false
rotate: none
contrast: 55
hue: 50
saturation: 65
luminance: 50
osd:
enabled: true
template: "%a %e %B %Y %H:%M:%S"
nightMode:
enabled: false
pinSwitchDelayUs: 150
irSensorPinInvert: false
records:
enabled: true
path: /mnt/mmc/records/%Y/%m/%d/%H.mp4
maxUsage: 95
video0:
enabled: true
codec: h264
size: 1920x1080
fps: 15
gopMode: normal
gopSize: 0.5
rcMode: avbr
bitrate: 2048
video1:
enabled: true
size: 1920x1080
fps: 15
bitrate: 1024
codec: h264
jpeg:
enabled: true
toProgressive: false
mjpeg:
size: 640x360
fps: 5
bitrate: 1024
audio:
enabled: false
volume: auto
srate: 8000
rtsp:
enabled: true
port: 554
hls:
enabled: true
youtube:
enabled: true
url: rtmp://a.rtmp.youtube.com/live2
key: qk5h-kxrg-dsfk-jduh-c0jg
motionDetect:
enabled: false
profile: outdoor
visualize: false
debug: false
ipeye:
enabled: false
onvif:
enabled: false
watchdog:
enabled: true
timeout: 10
netip:
enabled: false
user: admin
password: 6V0Y4HLF
port: 34567
snapshots: false
ignoreSetTime: false
cloud:
enabled: false
isp:
memMode: normal

View File

@ -0,0 +1,6 @@
f2fs
vfat
usb-storage
sd_mod
camhi-motor.ko

View File

@ -0,0 +1,42 @@
# Interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hwaddress ether $(fw_printenv -n ethaddr || echo 00:24:B8:FF:FF:FF)
#pre-up echo -e "nameserver 77.88.8.8\nnameserver 8.8.4.4\n" >/tmp/resolv.conf
auto wwan0
iface wwan0 inet dhcp
pre-up sleep 1
pre-up modprobe option
pre-up modprobe qmi_wwan
pre-up sleep 10
pre-up uqmi -s -d /dev/cdc-wdm0 --start-network internet --autoconnect &
pre-up echo 'Y' | tee /sys/class/net/wwan0/qmi/raw_ip
post-down uqmi -s -d /dev/cdc-wdm0 --stop-network --autoconnect
post-down sleep 2
post-down killall uqmi
post-down killall uqmi
auto wg0
iface wg0 inet static
address 192.168.77.14
netmask 255.255.255.0
gateway 192.168.77.1
pre-up modprobe wireguard
pre-up ip link add dev wg0 type wireguard
pre-up wg setconf wg0 /etc/wireguard.conf
post-down ip link del dev wg0
auto bbsw0
iface bbsw0 inet static
address 192.168.78.15
netmask 255.255.255.0
gateway 192.168.78.1
pre-up modprobe wireguard
pre-up ip link add dev bbsw0 type wireguard
pre-up wg setconf bbsw0 /etc/wg1.conf
post-down ip link del dev bbsw0

View File

@ -0,0 +1,69 @@
# Sample udhcpd configuration file (/etc/udhcpd.conf)
start 192.168.2.20
end 192.168.2.254
# The interface that udhcpd will use
interface wlan0
# The maximum number of leases (includes addresses reserved
# by OFFER's, DECLINE's, and ARP conflicts). Will be corrected
# if it's bigger than IP lease block, but it ok to make it
# smaller than lease block.
max_leases 5
#pidfile /var/run/udhcpd.pid
# The location of the leases file
lease_file /tmp/udhcpd.leases
# The time period at which udhcpd will write out leases file.
#static_lease 00:60:08:11:CE:4E 192.168.0.54
#static_lease 00:60:08:11:CE:3E 192.168.0.44
#Examples:
#opt dns 192.168.10.2 192.168.10.10
#option subnet 255.255.255.0
#opt router 192.168.10.2
#opt wins 192.168.10.10
#option dns 129.219.13.81 # appended to above DNS servers for a total of 3
#option domain local
#option lease 864000 # default: 10 days
#option msstaticroutes 10.0.0.0/8 10.127.0.1 # single static route
#option staticroutes 10.0.0.0/8 10.127.0.1, 10.11.12.0/24 10.11.12.1
# Arbitrary option in hex form:
#option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
# Currently supported options (for more info, see options.c):
#opt lease NUM
#opt subnet IP
#opt broadcast IP
#opt router IP_LIST
#opt ipttl NUM
#opt mtu NUM
#opt hostname STRING # client's hostname
#opt domain STRING # client's domain suffix
#opt search STRING_LIST # search domains
#opt nisdomain STRING
#opt timezone NUM # (localtime - UTC_time) in seconds. signed
#opt tftp STRING # tftp server name
#opt bootfile STRING # tftp file to download (e.g. kernel image)
#opt bootsize NUM # size of that file
#opt rootpath STRING # (NFS) path to mount as root fs
#opt wpad STRING
#opt serverid IP # default: server's IP
#opt message STRING # error message (udhcpd sends it on success too)
#opt vlanid NUM # 802.1P VLAN ID
#opt vlanpriority NUM # 802.1Q VLAN priority
# Options specifying server(s)
#opt dns IP_LIST
#opt wins IP_LIST
#opt nissrv IP_LIST
#opt ntpsrv IP_LIST
#opt lprsrv IP_LIST
#opt swapsrv IP
# Options specifying routes
#opt routes IP_PAIR_LIST
#opt staticroutes STATIC_ROUTES # RFC 3442 classless static route option
#opt msstaticroutes STATIC_ROUTES # same, using MS option number
# Obsolete options, no longer supported
#opt logsrv IP_LIST # 704/UDP log server (not syslog!)
#opt namesrv IP_LIST # IEN 116 name server, obsolete (August 1979!!!)
#opt cookiesrv IP_LIST # RFC 865 "quote of the day" server, rarely (never?) used
#opt timesrv IP_LIST # RFC 868 time server, rarely (never?) used
# TODO: in development
#opt userclass STRING # RFC 3004. set of LASCII strings. "I am a printer" etc
#opt sipserv STRING LIST # RFC 3361. flag byte, then: 0: domain names, 1: IP addrs

View File

@ -0,0 +1,11 @@
#
[interface]
PrivateKey = *
#
[Peer]
PublicKey = *
AllowedIPs = *
Endpoint = *
PersistentKeepalive = 5
#

View File

@ -0,0 +1,9 @@
ctrl_interface=/var/run/wpa_supplicant
# -- SoftAP mode with encryption/password protected example:
network={
ssid="gk300-0003-03"
mode=2
key_mgmt=WPA-PSK
psk="10923874"
}

View File

@ -0,0 +1,83 @@
#!/bin/sh
destdir="/mnt"
my_umount()
{
if grep -qs "^/dev/$1 " /proc/mounts ; then
yaml-cli -s ".records.enabled" "false"
# sed -i '96s/true/false/' /etc/majestic.yaml
unlink "/sdcard";
unlink "/var/www/rec";
umount "${destdir}/mmc";
rmdir "${destdir}/mmc"
fi
[ -d "${destdir}/mmc" ] && rmdir "${destdir}/mmc"
}
my_mount()
{
mkdir -p "${destdir}/mmc" || exit 1
if ! mount -t vfat "/dev/$1" "${destdir}/mmc"; then
# failed to mount, clean up mountpoint
rmdir "${destdir}/mmc"
exit 1
fi
echo "SD Card mounted";
ln -s "${destdir}/mmc" "/sdcard"
ln -s "${destdir}/mmc/records" "/var/www/rec"
yaml-cli -s ".records.enabled" "true"
if [ -f /sdcard/autoexe ]
then
/sdcard/autoexe
fi
if [ -f /sdcard/hardres ]
then
rm -f /sdcard/hardres
flash_eraseall -j /dev/mtd4
firstboot
fi
}
case "${ACTION}" in
add|"")
majex=`ps aux | grep majestic | grep -v grep`
if [[ ! -z "$majex" ]]
then
echo "Stop majestic"
dumpconfig=`echo -n "Stop majestic"`
/etc/init.d/S95hisilicon stop
sleep 1
fi
my_umount ${MDEV}
my_mount ${MDEV}
if [[ ! -z "$majex" ]]
then
echo "Start majestic"
dumpconfig=`echo -n "Start majestic"`
/etc/init.d/S95hisilicon start
fi
;;
remove)
majex=`ps aux | grep majestic | grep -v grep`
if [[ ! -z "$majex" ]]
then
echo "Stop majestic"
dumpconfig=`echo -n "Stop majestic"`
/etc/init.d/S95hisilicon stop
sleep 1
fi
my_umount ${MDEV}
if [[ ! -z "$majex" ]]
then
echo "Start majestic"
dumpconfig=`echo -n "Start majestic"`
/etc/init.d/S95hisilicon start
fi
;;
esac

View File

@ -0,0 +1,25 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
curz
fi
baf
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
baf
fi

View File

@ -0,0 +1,8 @@
#!/bin/sh
AT="$1"
SLEEP=0.2
TTY=/dev/ttyUSB3
RESULT=$(cat $TTY & echo -ne "$AT\n" > $TTY; sleep $SLEEP; killall cat)
echo $RESULT

View File

@ -0,0 +1,44 @@
#!/bin/sh
fa=$(getenv auto-focus);
if [[ "$fa" == "1" ]]
then
if [[ "$(getenv focus-control)" == "1" ]]
then
sleep 35;
s_z_up &&
s_z_down
fi
fi
while true; do
ft=$(getenv focus-threshold);
fa=$(getenv auto-focus);
FF=$(gf);
st=$(getenv delay-tr);
#echo $FF;
if [[ "$fa" == "1" ]]
then
if [[ "$FF" -lt "$ft" ]]
then
cst=$(cat /tmp/st)
if [[ "$cst" == "$st" ]]
then
s_baf
sleep 3
fp=$(gf)
if [[ "$fp" -lt "$(expr $ft / 2)" ]]
then
curz
# s_baf;
fi
echo "0" > /tmp/st
else
echo "$(expr $cst + 1)" > /tmp/st
fi
else
echo "0" > /tmp/st
fi
fi
done

View File

@ -0,0 +1,146 @@
#!/bin/sh
echo "$(date +%Y-%m-%d-%H-%M-%S-%3N) : BAF" >> /tmp/l_focus
#get_focus() {
#iRES=$(sample_af 0 c & sleep 0.25; killall sample_af)
#RST=`echo ${RES} | awk '{print $2}'`
#if [[ ! -z "$RST" ]]
#then
#echo "1"
#else
#echo "$RST"
#fi
#}
step_r() {
echo "step r"
#sleep $SLEEP;
cur_fs=$(gf)
echo $cur_fs;
st=`expr $cur_fs + 8`
fs_in 10;
while [[ $st -gt $cur_fs ]]; do
# sleep $SLEEP;
cur_fs=$(gf)
#echo 'step r'
echo $cur_fs
fs_in 10;
# sleep $SLEEP;
st=$(gf)
echo $st;
done
fs_out 20;
}
step_l() {
echo 'step l'
#sleep $SLEEP;
cur_fs=$(gf)
echo $cur_fs;
st=`expr $cur_fs + 8`
fs_out 10
while [[ $st -gt $cur_fs ]]; do
# echo 'step l';
# sleep $SLEEP;
cur_fs=$(gf)
# echo $cur_fs;
fs_out 10
# sleep $SLEEP;
st=$(gf)
#echo $st;
done
fs_in 10
}
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
fs_in 60;
#echo $CC_F
st=$(gf)
kf=$DD
ct=`expr $st + 8`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
#i sleep 0.25
st=$(gf)
fs_out 2;
# sleep 0.25
ct=$(gf)
if [[ "$st" -eq "$ct" ]]
then
ct=`expr $ct + 8`
fi
if [[ "$ct" -lt 40 ]]
then
ct=`expr $ct + 230`
fi
# echo "$st $ct"
echo "ct: $ct st: $st kf:$kf";
done
fs_in 1;
#fi
#sleep $SLEEP;
#iCUR_F=$(get_focus)
#echo "cur $CUR_F";
#fs_in 25;
#STP_R=$(get_focus)
#echo "R $STP_R";
#fs_out 50;
#STP_L=$(get_focus)
#echo "L $STP_L";
#fs_in 25;
#tek=$(get_focus)
#echo "tek $tek";
#///////////////////////////////////////////////////////////////////////////////////////////////////////////
#if [[ $STP_R -gt $CUR_F ]]
#then
# echo "Go L"
# step_r
#else
# if [[ $STP_L -gt $CUR_F ]]
# then
# echo "Go R";
# step_l
# else
# curz;
# fi
#fi
#tek=$(get_focus)
#if [[ $tek -lt $CUR_F ]]
#then
#CUR_F=$(get_focus)
##echo "cur $CUR_F";
#fs_in 70;
#STP_R=$(get_focus)
#echo "R $STP_R";
#fs_out 140;
#STP_L=$(get_focus)
#echo "L $STP_L";
#fs_in 70;
#tek=$(get_focus)
#echo "tek $tek";
#///////////////////////////////////////////////////////////////////////////////////////////////////////////
#if [[ $STP_R -gt $CUR_F ]]
#then
# echo "Go L"
# step_r
#else
# if [[ $STP_L -gt $CUR_F ]]
# then
# echo "Go R";
# step_l
# else
# curz;
# fi
#fi
#fi

View File

@ -0,0 +1,34 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=100;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
#fs_out 180;
fs_in 140;
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
st=$(gf)
s_fs_out 1;
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
ct=`expr $(gf) + 1`;
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_in 13;
#fi

View File

@ -0,0 +1,34 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=100;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
#fs_out 180;
fs_out 140;
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
st=$(gf)
s_fs_in 1;
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
ct=`expr $(gf) + 1`;
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_out 21;
#fi

View File

@ -0,0 +1,13 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=100;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
fs_in 140;
fs_out 140;
it=`cat /tmp/iter`
fs_in $it;

View File

@ -0,0 +1,32 @@
#!/bin/sh
#i killall sample_af
# rm -f /tmp/saf_f
# sample_af 0 c >> /tmp/saf_f &
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
fs_out 120;
#echo $CC_F
st=$(gf)
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -le "$ct" ]]; do
st=$(gf)
zz=$(echo "scale=4; $st/1000" | bc);
sleep $zz;
s_fs_in 1;
ct=$(gf)
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_out 4;
#fi

View File

@ -0,0 +1,35 @@
#!/bin/sh
killall sample_af
rm -f /tmp/saf_f
echo "0" > /tmp/maxf
sample_af 0 c >> /tmp/saf_f &
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
#fs_out 180;
fs_out 140;
#echo $CC_F
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$ct" ]]; do
st=$(gf)
s_fs_in 1;
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
ct=`expr $(gf) + 8`;
if [[ "$ct" -lt $DD ]]
then
ct=`expr $ct + 230`
fi
echo "ct: $ct st: $st kf:$kf zz:$zz";
done
s_fs_out 21;
#fi

View File

@ -0,0 +1,37 @@
#!/bin/sh
#i killall sample_af
# rm -f /tmp/saf_f
# echo "0" > /tmp/maxf
# sample_af 0 c >> /tmp/saf_f &
DD=120;
#/////////////////////////////////////////////////////////////////////////////////////////////////////////////
CC_F=$(gf)
#if [[ $CC_F -lt $DD ]]
#then
fs_in 180;
fs_out 320;
#echo $CC_F
st=$(gf);
mx=`cat /tmp/maxf`;
kf=$DD
ct=`expr $st + 1`
echo "ct: $ct st: $st kf:$kf";
while [[ "$st" -lt "$mx" ]]; do
s_fs_in 1;
st=$(gf)
zz=$(echo "scale=4; $st/2000" | bc);
sleep $zz;
st=$(gf)
ct=$(gf)
# if [[ "$ct" -lt $DD ]]
# then
# ct=`expr $ct + 230`
# fi
echo "ct: $mx st: $st kf:$kf zz:$zz";
done
s_fs_out 4;
#fi

View File

@ -0,0 +1,80 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d r -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d r -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d l -s 85
}
step_l() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d l -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d l -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d r -s 85
}
CUR_F=$(get_focus)
camhi-motor -d l -s 99
STP_R=$(get_focus)
camhi-motor -d r -s 99
sleep $SLEEP
camhi-motor -d r -s 99
STP_L=$(get_focus)
camhi-motor -d l -s 99
if [[ $STP_R -gt $CUR_F ]]
then
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
step_r
else
if [[ $CUR_F -lt 300 ]]
then
camhi-motor -d r -s 99
camhi-motor -d r -s 99
STP_R=$(get_focus)
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
STP_L=$(get_focus)
camhi-motor -d r -s 99
camhi-motor -d r -s 99
if [[ $STP_R -gt $STP_L ]]
then
camhi-motor -d r -s 99
step_r
else
camhi-motor -d l -s 99
step_l
fi
fi
fi
fi

View File

@ -0,0 +1,32 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
c_bbaf
fi
c_baf
c_saf
CR_L=$(get_focus)
if [[ $CR_L -lt 300 ]]
then
# echo "Zhopa"
c_bbaf
c_baf
c_saf
fi

View File

@ -0,0 +1,201 @@
#!/bin/sh
step_r() {
echo "r $1"
cur_fs=$(gf)
echo "r $1 $cur_fs"
camhi-motor -d r -s $1 && st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
sleep 0.2 && cur_fs=$(gf)
camhi-motor -d r -s $1 && st=$(gf)
echo "r $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_l $(expr $1 / 2)
else
echo "r $1 $cur_fs"
camhi-motor -d r -s 2 && st=$(gf)
fi
}
step_l() {
cur_fs=$(gf)
#echo "l $1 $cur_fs"
camhi-motor -d l -s $1 && st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s $1 && st=$(gf)
echo "l $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_r $(expr $1 / 2)
else
camhi-motor -d r -s 2 && st=$(gf)
echo "r $1 $cur_fs"
fi
}
if [[ -z $1 ]]
then
ss=64
else
ss=$1
fi
if [[ "$(gf)" -lt "25" ]]
then
ss=99
fi
while [[ $ss -gt 2 ]]
do
CUR_F=$(gf)
if [[ $ss == 99 ]]
then
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1
if [[ $STP_L -lt 20 ]]
then
if [[ $STP_R -lt 20 ]]
then
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
camhi-motor -d r -s 64 && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1 &&
camhi-motor -d l -s 64 && sleep 0.1
fi
fi
fi
fi
fi
fi
fi
fi
else
camhi-motor -d l -s $ss && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s $ss && sleep 0.1 &&
camhi-motor -d r -s $ss && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s $ss && sleep 0.1
fi
echo $CUR_F;
echo $STP_R;
echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
echo "Go L"
step_l $ss
# ss=1
else
if [[ $STP_L -gt $CUR_F ]]
then
echo "Go R";
step_r $ss
# ss=1
fi
fi
if [[ $ss == 99 ]]
then
ss=64
else
ss=$(expr $ss / 2)
fi
done

View File

@ -0,0 +1,64 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(gf)
camhi-motor -d r -s 32
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d r -s 32
st=$(gf)
done
camhi-motor -d l -s 32
}
step_l() {
cur_fs=$(gf)
camhi-motor -d l -s 32
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s 32
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d r -s 32
}
CUR_F=$(gf)
camhi-motor -d l -s 64
STP_R=$(gf)
camhi-motor -d r -s 64
sleep $SLEEP
camhi-motor -d r -s 64
STP_L=$(gf)
camhi-motor -d l -s 64
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
# else
# echo "Current"
fi
fi

View File

@ -0,0 +1,86 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d r -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d r -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d l -s 85
}
step_l() {
cur_fs=$(get_focus)
st=`expr $cur_fs + 1`
camhi-motor -d l -s 85
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(get_focus)
camhi-motor -d l -s 85
sleep $SLEEP;
st=$(get_focus)
done
camhi-motor -d r -s 85
}
CUR_F=$(get_focus)
camhi-motor -d l -s 99
STP_R=$(get_focus)
camhi-motor -d r -s 99
sleep $SLEEP
camhi-motor -d r -s 99
STP_L=$(get_focus)
camhi-motor -d l -s 99
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
else
if [[ $CUR_F -lt 300 ]]
then
camhi-motor -d r -s 99
camhi-motor -d r -s 99
STP_R=$(get_focus)
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
camhi-motor -d l -s 99
STP_L=$(get_focus)
camhi-motor -d r -s 99
camhi-motor -d r -s 99
if [[ $STP_R -gt $STP_L ]]
then
camhi-motor -d r -s 99
step_r
else
camhi-motor -d l -s 99
step_l
# echo "Current"
fi
fi
fi
fi

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d l -s $1
#c_baf
#c_saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d r -s $1
#c_baf
#c_saf

View File

@ -0,0 +1,65 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(gf)
camhi-motor -d r -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d r -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d l -s 2
}
step_l() {
cur_fs=$(gf)
camhi-motor -d l -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d r -s 2
}
CUR_F=$(gf)
camhi-motor -d l -s 16
STP_R=$(gf)
camhi-motor -d r -s 16
sleep $SLEEP
camhi-motor -d r -s 16
STP_L=$(gf)
camhi-motor -d l -s 16
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
# else
# echo "Current"
fi
fi

View File

@ -0,0 +1,65 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(gf)
camhi-motor -d r -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d r -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d l -s 2
}
step_l() {
cur_fs=$(gf)
camhi-motor -d l -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d r -s 2
}
CUR_F=$(gf)
camhi-motor -d l -s 16
STP_R=$(gf)
camhi-motor -d r -s 16
sleep $SLEEP
camhi-motor -d r -s 16
STP_L=$(gf)
camhi-motor -d l -s 16
#echo $CUR_F;
#echo $STP_R;
#echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
# echo "Go L"
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
# echo "Go R";
step_r
# else
# echo "Current"
fi
fi

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d d -s 25
#baf
#saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d u -s 25
#baf
#saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d d -s 25
c_baf
c_saf

View File

@ -0,0 +1,4 @@
#!/bin/sh
camhi-motor -d u -s 25
c_baf
c_saf

View File

@ -0,0 +1,7 @@
#!/bin/sh
sleep 7;
wpa_supplicant -B -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf
touch /tmp/udhcpd.leases;
sleep 6;
ip addr add 192.168.2.1/24 dev wlan0
udhcpd -f "/etc/udhcpd.conf" &

View File

@ -0,0 +1,9 @@
#!/bin/sh
sleep 3
wpa_passphrase $(getenv cmid) $(getenv cmkey) >/tmp/wpa_supplicant.conf
sed -i '2i \\tscan_ssid=1' /tmp/wpa_supplicant.conf
sleep 3
wpa_supplicant -B -Dnl80211 -iwlan0 -c/tmp/wpa_supplicant.conf
sleep 6
udhcpc -i wlan0 &

View File

@ -0,0 +1,6 @@
#!/bin/sh
z_up
sleep 0.05;
z_down

View File

@ -0,0 +1,3 @@
#!/bin/sh
xm-uart-motors 0 x && sleep 0.2 && xm-uart-motors 0 s && xm-uart-motors 0 s
echo "$(date) : f_down" >> /tmp/l_focus

View File

@ -0,0 +1,3 @@
#!/bin/sh
xm-uart-motors 0 z && sleep 0.1 && xm-uart-motors 0 s && xm-uart-motors 0 s
echo "$(date) : f_up" >> /tmp/l_focus

View File

@ -0,0 +1,10 @@
#!/bin/sh
it=$1
i=0
while [ $i -lt $it ]
do
f_down;
i=`expr $i + 1`;
done
echo "$(date) : fs_in $it" >> /tmp/l_focus

View File

@ -0,0 +1,10 @@
#!/bin/sh
it=$1
i=0
while [ $i -lt $it ]
do
f_up;
i=`expr $i + 1`;
done
echo "$(date) : fs_out $it" >> /tmp/l_focus

View File

@ -0,0 +1,2 @@
#!/bin/sh
fw_printenv $1 -n

View File

@ -0,0 +1,12 @@
#!/bin/sh
tt="$(fw_printenv ethaddr -n | cut -c12- | tr -d :)";
cssid=`cat /etc/wpa_supplicant.conf | grep ssid | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d " " -f 2`
nssid="ssid=\"ev300-$tt\"";
echo "$cssid";
echo "$nssid";
#if [[ "$cssid" != "$nssid" ]]
# then
# echo "new_ssid"
# sed -i '5d' /etc/wpa_supplicant.conf
# sed -i "5i \\$nssid" /etc/wpa_supplicant.conf
#fi

View File

@ -0,0 +1,11 @@
#!/bin/sh
get_exp() {
exp=1
exp=$(curl -s http://localhost/metrics | grep ^isp_exptime | cut -d' ' -f2)
bri=`expr $exp / 1000`
echo $bri
};
BRI=$(get_exp);
echo "$BRI";

View File

@ -0,0 +1,4 @@
#!/bin/sh
sleep 0.2 && echo $(cat /tmp/zx);

View File

@ -0,0 +1,2 @@
#!/bin/sh
cat /tmp/maxf

View File

@ -0,0 +1,13 @@
#!/bin/sh
tt="$(fw_printenv ethaddr -n | cut -c12- | tr -d :)";
cssid=`cat /etc/wpa_supplicant.conf | grep ssid | sed '/^#/d' | sed 's/ \{1,\}/ /g' | cut -d " " -f 2`
nssid="ssid=\"ev300-$tt\"";
#echo "$cssid";
#echo "$nssid";
echo $tt;
#if [[ "$cssid" != "$nssid" ]]
# then
# echo "new_ssid"
# sed -i '5d' /etc/wpa_supplicant.conf
# sed -i "5i \\$nssid" /etc/wpa_supplicant.conf
#fi

View File

@ -0,0 +1,62 @@
#!/bin/sh
light_enable() {
echo "1" > /tmp/lt
if [[ "$ir_inv" == "0" ]]
then
ircut_demo gk7205v300 0
else
ircut_demo gk7205v300 1
fi
if [[ "$lt_t" == "1" ]]
then
qw 0 AT+BLH+75
else
if [[ "$lt_p" -gt "0" ]]
then
devmem 0x100C0080 32 0x530
echo "$lt_p" >/sys/class/gpio/unexport
echo "$lt_p" >/sys/class/gpio/export
echo "out" >/sys/class/gpio/gpio$lt_p/direction
echo "1" >/sys/class/gpio/gpio$lt_p/value
fi
fi
}
light_disable() {
echo "0" > /tmp/lt
if [[ "$ir_inv" == "0" ]]
then
ircut_demo gk7205v300 1
else
ircut_demo gk7205v300 0
fi
if [[ "$lt_t" == "1" ]]
then
qw 0 AT+BLH+0
else
if [[ "$lt_p" -gt "0" ]]
then
devmem 0x100C0080 32 0x530
echo "$lt_p" >/sys/class/gpio/unexport
echo "$lt_p" >/sys/class/gpio/export
echo "out" >/sys/class/gpio/gpio$lt_p/direction
echo "0" >/sys/class/gpio/gpio$lt_p/value
fi
fi
}
ir_inv=$(getenv ircut-inv);
lt_t=$(getenv light-control);
lt_p=$(getenv light-port);
echo "0" > /tmp/lst
if [ $1 -eq 1 ]; then
light_enable
elif [ $1 -eq 0 ]; then
light_disable
fi

View File

@ -0,0 +1,7 @@
#!/bin/sh
devmem 0x100C0080 32 0x530
echo 0 > /tmp/lt
echo 4 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio4/direction
echo 0 > /sys/class/gpio/gpio4/value

View File

@ -0,0 +1,7 @@
#!/bin/sh
devmem 0x100C0080 32 0x530
echo 1 > /tmp/lt
echo 4 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio4/direction
echo 1 > /sys/class/gpio/gpio4/value

View File

@ -0,0 +1,76 @@
#!/bin/sh
step_r() {
echo "r $1"
cur_fs=$(gf)
echo "r $1 $cur_fs"
camhi-motor -d r -s $1 && st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
sleep 0.2 && cur_fs=$(gf)
camhi-motor -d r -s $1 && st=$(gf)
echo "r $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_l $(expr $1 / 2)
else
echo "r $1 $cur_fs"
camhi-motor -d r -s 2 && st=$(gf)
fi
}
step_l() {
cur_fs=$(gf)
#echo "l $1 $cur_fs"
camhi-motor -d l -s $1 && st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s $1 && st=$(gf)
echo "l $1 $cur_fs"
done
if [[ ! $1 == 1 ]]
then
step_r $(expr $1 / 2)
else
camhi-motor -d r -s 2 && st=$(gf)
echo "r $1 $cur_fs"
fi
}
if [[ -z $1 ]]
then
ss=64
else
ss=$1
fi
while [[ $ss -gt 2 ]]
do
CUR_F=$(gf)
camhi-motor -d l -s $ss && sleep 0.1 &&
STP_R=$(gf)
camhi-motor -d r -s $ss && sleep 0.1 &&
camhi-motor -d r -s $ss && sleep 0.1 &&
STP_L=$(gf)
camhi-motor -d l -s $ss && sleep 0.1 &&
echo $CUR_F;
echo $STP_R;
echo $STP_L;
if [[ $STP_R -gt $CUR_F ]]
then
echo "Go L"
step_l $ss
# ss=1
else
if [[ $STP_L -gt $CUR_F ]]
then
echo "Go R";
step_r $ss
# ss=1
fi
fi
ss=$(expr $ss / 2)
done

View File

@ -0,0 +1,11 @@
#!/bin/sh
while (true)
do
sleep 1.7 && qw 0 "AT+ALL>1" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>2" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>3" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>4" && sleep 0.1 && qw 0 "AT+ALL>0"
sleep 1.7 && qw 0 "AT+ALL>0" && sleep 0.1 && qw 0 "AT+ALL>0" && qw 0 "AT+ALL>0";
done

View File

@ -0,0 +1,9 @@
#!/bin/sh
f="{$1}"
maj=`ps aux | grep $f | grep -v grep`
if [[ ! -z "$maj" ]]
then
echo "1";
else
echo "0"
fi

View File

@ -0,0 +1,6 @@
#!/bin/sh
devmem 0x100C0080 32 0x530
echo $1 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio$1/direction
echo $2 > /sys/class/gpio/gpio$1/value

View File

@ -0,0 +1,10 @@
#!/bin/sh
AT="$2"
TTY=/dev/ttyUSB$1
echo -ne "$AT\n" > $TTY;
echo -ne "$AT\n" > $TTY;
echo -ne "$AT\n" > $TTY;
echo -ne "$AT\n" > $TTY;

View File

@ -0,0 +1,5 @@
#!/bin/sh
qw 0 AT+MDM+off
sleep 1;
qw 0 AT+MDM+on
reboot;

View File

@ -0,0 +1,10 @@
#!/bin/sh
ip link set wwan0 down
uqmi -s -d /dev/cdc-wdm0 --stop-network --autoconnect
sleep 1;
uqmi -s -d /dev/cdc-wdm0 --start-network internet --autoconnect &
echo 'Y' | tee /sys/class/net/wwan0/qmi/raw_ip
ip link set wwan0 up
echo "get ip"
udhcpc -i wwan0

View File

@ -0,0 +1,25 @@
#!/bin/sh
cc=$(getenv focus-control);
if [[ "$cc" == 1 ]]
then
if [[ "$(getenv focus-in)" == "1" ]]
then
if [[ "$(pren baf)" == "0" ]]
then
baf
fi
else
if [[ "$(pren bafl)" == "0" ]]
then
bafl
fi
fi
else
if [[ "$(pren c_baf)" == "0" ]]
then
c_baf;
c_saf;
fi
fi

View File

@ -0,0 +1,15 @@
#!/bin/sh
cc=$(getenv focus-control);
if [[ "$cc" == "1" ]]
then
if [[ "$(pren fs_in)" == "0" ]]
then
fs_in $1
fi
else
if [[ "$(pren c_fs_in)" == "0" ]]
then
c_fs_in $1
fi
fi

View File

@ -0,0 +1,16 @@
#!/bin/sh
cc=$(getenv focus-control);
if [[ "$cc" == "1" ]]
then
if [[ "$(pren fs_out)" == "0" ]]
then
fs_out $1
fi
else
if [[ "$(pren c_fs_out)" == "0" ]]
then
c_fs_out $1
fi
fi

View File

@ -0,0 +1,16 @@
#!/bin/sh
cc=$(getenv focus-control);
if [[ "$cc" == "1" ]]
then
if [[ "$(pren z_down)" == "0" ]]
then
z_down
fi
else
if [[ "$(pren c_z_down)" == "0" ]]
then
c_z_down
fi
fi

View File

@ -0,0 +1,15 @@
#!/bin/sh
cc=$(getenv focus-control);
if [[ "$cc" == "1" ]]
then
if [[ "$(pren z_up)" == "0" ]]
then
z_up
fi
else
if [[ "$(pren c_z_up)" == "0" ]]
then
c_z_up
fi
fi

View File

@ -0,0 +1,58 @@
#!/bin/sh
SLEEP=0.150
get_focus() {
RES=$(sample_af 0 c & sleep $SLEEP && killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
step_r() {
cur_fs=$(gf)
camhi-motor -d r -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d r -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d l -s 2
}
step_l() {
cur_fs=$(gf)
camhi-motor -d l -s 2
st=`expr $cur_fs + 1`
while [[ $st -gt $cur_fs ]]; do
cur_fs=$(gf)
camhi-motor -d l -s 2
# sleep $SLEEP;
st=$(gf)
done
camhi-motor -d r -s 2
}
CUR_F=$(gf)
camhi-motor -d l -s 10
STP_R=$(gf)
camhi-motor -d r -s 10
sleep $SLEEP
camhi-motor -d r -s 10
STP_L=$(gf)
camhi-motor -d l -s 10
if [[ $STP_R -gt $CUR_F ]]
then
step_l
else
if [[ $STP_L -gt $CUR_F ]]
then
step_r
fi
fi

View File

@ -0,0 +1,87 @@
#!/bin/sh
SLEEP=0.5
#sleep 25;
#z_up
#z_up
#z_up
#z_up
ir_inv=$(getenv ircut-inv);
get_exp() {
exp=1
exp=$(curl -s http://localhost/metrics | grep ^isp_exptime | cut -d' ' -f2)
bri=`expr $exp / 1000`
echo $bri
}
get_focus() {
#killall sample_af
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $1}'`
echo $RST
}
get_focus1() {
#killall sample_af
RES=$(sample_af 0 c & sleep $SLEEP; killall sample_af)
RST=`echo ${RES} | awk '{print $2}'`
echo $RST
}
lt_tr_on=$(getenv light-tr-on);
lt_tr_off=$(getenv light-tr-off);
lt_au=$(getenv auto-light);
lt_on=$(getenv always-on);
lt_ltr=$(getenv delay-lt);
while true; do
clt=$(cat /tmp/lt);
bri=$(get_exp);
echo $bri > /tmp/lexp;
if [[ "$lt_on" == "1" ]]
then
light 1;
else
if [[ "$lt_au" == "1" ]]
then
if [ $bri -gt $lt_tr_on ]
then
if [[ "$clt" == "0" ]]
then
echo "0" > /tmp/lst
if [[ "$clt" == "0" ]]
then
light 1
fi
fi
fi
if [ $bri -lt $lt_tr_off ]
then
if [[ "$clt" == "1" ]]
then
cst=$(cat /tmp/lst)
if [[ "$cst" == "$lt_ltr" ]]
then
light 0
echo "0" > /tmp/lst
else
echo "$(expr $cst + 1)" > /tmp/lst
fi
fi
fi
fi
fi
#------------------------------------------------------------------------------
#egat=`sed -n '58p' /etc/network/interfaces | sed -r 's/........//'`
#iif [[ "$egat" != "xxx.xxx.xxx.xxx" ]]
# then
# echo "BINGO $egat"
# ping -c 1 $egat
#fi
done

View File

@ -0,0 +1,11 @@
#!/bin/sh
xm-uart-motors 0 -
sleep 0.50;
xm-uart-motors 0 s
sleep 0.05;
#/sdcard/xm-uart-motors 0 +
#sleep 0.03;
#/sdcard/xm-uart-motors 0 s
xm-uart-motors 0 s
xm-uart-motors 0 s
echo "$(date) : z_down" >> /tmp/l_focus

View File

@ -0,0 +1,8 @@
#!/bin/sh
xm-uart-motors 0 +
sleep 0.20;
xm-uart-motors 0 s
xm-uart-motors 0 s
sleep 0.05;
xm-uart-motors 0 s
echo "$(date) : z_up" >> /tmp/l_focus

View File

@ -0,0 +1,15 @@
#!/bin/sh
while [[ -z $cur_fs ]]
do
RST=`echo $(sample_af 0 c & sleep 0.07 && killall sample_af) | awk '{print $2}'`
if [[ ! -z "$RST" ]]
then
# echo "----------==============*************============---------------"
# CCTF="$RST"
echo $RST > /tmp/zx
# export CCTF
# export CCTF=$(echo $RST);
fi
done

View File

@ -0,0 +1,106 @@
<% http_header_html %>
<% reus=$(printenv REMOTE_USER) %>
<!DOCTYPE html>
<html lang="en">
<head>
<% if [ $reus = "oper" ]; then %><meta http-equiv="refresh" content="0;URL=/cgi-bin/opreview.cgi" /><% fi %>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><% html_title "$page_title" %></title>
<link rel="shortcut icon" href="/favicon.png">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/bootstrap.override.css">
<% if [ $HTTP_MODE = "development" ]; then %><link rel="stylesheet" href="/css/debug.css"><% fi %>
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/main.js"></script>
<script type="text/javascript" language="javascript">
function fullscreen3(element) {
if(element.requestFullScreen) {
element.requestFullScreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
function formatDate(date) {
var hours = date.getHours();
var minutes = date.getMinutes();
// var ampm = hours >= 12 ? 'pm' : 'am';
// hours = hours % 12;
// hours = hours ? hours : 12;
minutes = minutes < 10 ? '0'+minutes : minutes;
var strTime = hours + ':' + minutes;
return ( date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate() + " " + strTime ) ;
}
fullscreen3(document.documentElement);
</script>
</head>
<body id="top" onLoad="load(); fullscreen3(document.documentElement);return false;">
<nav class="navbar navbar-expand-lg navbar-dark sticky-top">
<div class="container p-0">
<a class="navbar-brand" href="/cgi-bin/status.cgi"><img src="/img/logo.svg" width="116" height="32" alt=""><%= "&nbsp;<b>gk300-$(gmnum)-$(getenv apname)</b> $(date +%F) $(date +%H:%M)"%></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownInformation" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Information</a>
<ul class="dropdown-menu" aria-labelledby="dropdownInformation">
<li><a class="dropdown-item" href="/cgi-bin/status.cgi">Overview</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-cron.cgi">Cron config</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-dmesg.cgi">Diagnostic message</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-httpd.cgi">HTTPd environment</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-log.cgi">Log read</a></li>
</ul>
</li>
<li class="nav-item"><a class="nav-link" href="/cgi-bin/firmware.cgi">Firmware</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownNetwork" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Settings</a>
<ul class="dropdown-menu" aria-labelledby="dropdownNetwork">
<li><a class="dropdown-item" href="/cgi-bin/network.cgi">Network Settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/network-ntp.cgi">NTP Settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/fl-settings.cgi">Extended settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/webui-settings.cgi">Web UI Password</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownMajestic" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Majestic</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMajestic">
<li><a class="dropdown-item" href="/cgi-bin/majestic-settings-general.cgi">Settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/majestic-settings-services.cgi">Services</a></li>
<li><a class="dropdown-item" href="/cgi-bin/majestic-config-actions.cgi">Maintenance</a></li>
<li><a class="dropdown-item" href="/cgi-bin/preview-help.cgi">Information</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownTools" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Tools</a>
<ul class="dropdown-menu" aria-labelledby="dropdownTools">
<li><a class="dropdown-item" href="/cgi-bin/tools.cgi">Ping & Traceroute</a></li>
<li><a class="dropdown-item" href="/cgi-bin/console.cgi">Web Console</a></li>
<li><a class="dropdown-item" href="/cgi-bin/format.cgi">Format SD & reboot</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownPreview" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false"><%= $tMenuPreview %></a>
<ul class="dropdown-menu" aria-labelledby="dropdownPreview">
<li><a class="dropdown-item" href="/cgi-bin/preview.cgi">JPEG</a></li>
<li><a class="dropdown-item" href="/cgi-bin/preview-mjpeg.cgi">MJPEG</a></li>
<li><a class="dropdown-item" href="/cgi-bin/preview-video.cgi">Video</a></li>
<li><a class="dropdown-item" href="/cgi-bin/mpreview.cgi">Preview</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<main>
<div class="container p-0">

View File

@ -0,0 +1,372 @@
#!/usr/bin/haserl
<% http_header_html %>
<% ipaddr=$(printenv | grep HTTP_HOST | cut -d= -f2 | cut -d: -f1) %>
<% reus=$(printenv REMOTE_USER) %>
<!DOCTYPE html>
<html lang="en">
<head>
<% if [ $reus = "oper" ]; then %><meta http-equiv="refresh" content="0;URL=/cgi-bin/opreview.cgi" /><% fi %>
<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="viewport" content="width=device-width,initial-scale=1">
<title><% html_title "$page_title" %></title>
<link rel="shortcut icon" href="/favicon.png">
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/bootstrap.override.css">
<% if [ $HTTP_MODE = "development" ]; then %><link rel="stylesheet" href="/css/debug.css"><% fi %>
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/jquery.js"></script>
<script type="text/javascript" language="javascript">
var img = new Image();
var imgObj;
var webcam = "http://<%= $ipaddr %>/image.jpg?width=640&height=360&qfactor=73&color2gray=0"
function preload()
{
img.src= webcam + new Date;
}
function changesrc()
{
img1.src=img.src;
preload();
setTimeout(changesrc,3500);
}
function update()
{
imgObj = document.getElementById('img1');
imgObj.src = img.src;
img.src = webcam + (new Date()).getTime();
}
function takeError()
{
img.src = webcam + (new Date()).getTime();
}
function startonload()
{
img.src = webcam + (new Date()).getTime();
img.onerror=takeError;
img.onload=update;
}
function load()
{
if (navigator.appName.indexOf("Microsoft IE Mobile") != -1)
{
preload();
changesrc();
return;
}
startonload();
}
function zoom_in()
{
$.ajax({
url: '/cgi-bin/z_in.cgi',
method: 'get',
cache: false
});
}
function zoom_out()
{
$.ajax({
url: '/cgi-bin/z_out.cgi',
method: 'get',
cache: false
});
}
function zoom_ins()
{
$.ajax({
url: '/cgi-bin/sz_in.cgi',
method: 'get',
cache: false
});
}
function zoom_outs()
{
$.ajax({
url: '/cgi-bin/sz_out.cgi',
method: 'get',
cache: false
});
}
function stop()
{
$.ajax({
url: '/cgi-bin/c_stop.cgi',
method: 'get',
cache: false
});
}
function focus_auto()
{
$.ajax({
url: '/cgi-bin/af.cgi',
method: 'get',
cache: false
});
}
function focus_plus()
{
$.ajax({
url: '/cgi-bin/f_plus.cgi',
method: 'get',
cache: false
});
}
function focus_minus()
{
$.ajax({
url: '/cgi-bin/f_minus.cgi',
method: 'get',
cache: false
});
}
function focus_pluss()
{
$.ajax({
url: '/cgi-bin/sf_plus.cgi',
method: 'get',
cache: false
});
}
function focus_minuss()
{
$.ajax({
url: '/cgi-bin/sf_minus.cgi',
method: 'get',
cache: false
});
}
function light()
{
$.ajax({
url: '/cgi-bin/light.cgi',
method: 'get',
cache: false
});
}
function getserv() {
$(function(){
$.getJSON('/cgi-bin/flajax.cgi', function(data) {
document.getElementById("GF").innerHTML = data.gf;
document.getElementById("LST").innerHTML = data.lst;
document.getElementById("LEXP").innerHTML = data.lexp;
/* if ( data.stf == 0 )
{
document.getElementById("STF").innerHTML = "&#1053;&#1086;&#1088;&#1084;&#1091;&#1083;&#1100;";
};
if ( data.stf == 1 )
{
document.getElementById("STF").innerHTML = "&#1041;&#1083;&#1103;";
};
if ( data.stf == 2 )
{
document.getElementById("STF").innerHTML = "&#1058;&#1072; &#1085;&#1091; &#1085;&#1072;&#1093;";
};
if ( data.stf == 3 )
{
document.getElementById("STF").innerHTML = "&#1058;&#1072; &#1096;&#1086; &#1090;&#1072;&#1082;&#1086;&#1077;";
};
if ( data.stf == 4 )
{
document.getElementById("STF").innerHTML = "&#1058;&#1072;&#1085;&#1091;&#1085;&#1080;&#1105;&#1087;&#1090;&#1099;&#1090;&#1100;";
};
if ( data.stf == 5 )
{
document.getElementById("STF").innerHTML = " &#1055;&#1080;&#1079;&#1076;&#1077;&#1094; ";
};
if ( data.stf == 6 )
{
document.getElementById("STF").innerHTML = "&#1051;&#1077;&#1095;&#1080;&#1084;";
}; */
document.getElementById("STF").innerHTML = data.stf;
if ( data.ld == 1 )
{
document.getElementById("light").src="/img/lt-on.svg";
} else {
document.getElementById("light").src="/img/lt-off.svg";
}
});
});
setTimeout("getserv()", 500);
}
function fullscreen3(element) {
if(element.requestFullScreen) {
element.requestFullScreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}
fullscreen3(document.documentElement);
</script>
<style type="text/css">
.b1 TABLE { position: relative; }
.b2 { left: 0px; top: -160px; z-index: 2}
.b3 {
position: fixed;
left: 0; bottom: 0;
padding: 2px;
width: 100%;
gap: 0rem;
margin: 0rem auto;
z-index: 2}
.b4 {
position: fixed;
left: 0; top: 90;
padding: 2px;
width: 100%;
gap: 0rem;
margin: 0rem auto;
z-index: 2}
.meven {
padding: 4px;
background: #222222;
color: #FFFFFF;
font-weight: bold;
align: center;
}
.parent {
width: 100%;
height: 100%;
background-color: #000000;
position: fixed;
top: 0;
left: 0;
display: flex;
align-items: center;
align-content: center;
justify-content: center;
overflow: auto;
}
.block {
width: 100%;
img {
display: block;
border: none;
}
}
</style>
</head>
<body id="top" onLoad="load(); fullscreen3(document.documentElement);return false;" class="sss">
<nav class="navbar navbar-expand-lg navbar-dark sticky-top">
<div class="container p-0">
<a class="navbar-brand" href="/cgi-bin/status.cgi"><img src="/img/logo.svg" width="116" height="32" alt=""><%= "&nbsp;<b>gk300-$(gmnum)-$(getenv apname)</b> $(date +%F) $(date +%H:%M) $reus "; %></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownInformation" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Information</a>
<ul class="dropdown-menu" aria-labelledby="dropdownInformation">
<li><a class="dropdown-item" href="/cgi-bin/status.cgi">Overview</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-cron.cgi">Cron config</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-dmesg.cgi">Diagnostic message</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-httpd.cgi">HTTPd environment</a></li>
<li><a class="dropdown-item" href="/cgi-bin/info-log.cgi">Log read</a></li>
</ul>
</li>
<li class="nav-item"><a class="nav-link" href="/cgi-bin/firmware.cgi">Firmware</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownNetwork" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Settings</a>
<ul class="dropdown-menu" aria-labelledby="dropdownNetwork">
<li><a class="dropdown-item" href="/cgi-bin/network.cgi">Network Settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/network-ntp.cgi">NTP Settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/fl-settings.cgi">Extended settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/webui-settings.cgi">Web UI Password</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownMajestic" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Majestic</a>
<ul class="dropdown-menu" aria-labelledby="dropdownMajestic">
<li><a class="dropdown-item" href="/cgi-bin/majestic-settings-general.cgi">Settings</a></li>
<li><a class="dropdown-item" href="/cgi-bin/majestic-settings-services.cgi">Services</a></li>
<li><a class="dropdown-item" href="/cgi-bin/majestic-config-actions.cgi">Maintenance</a></li>
<li><a class="dropdown-item" href="/cgi-bin/preview-help.cgi">Information</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownTools" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false">Tools</a>
<ul class="dropdown-menu" aria-labelledby="dropdownTools">
<li><a class="dropdown-item" href="/cgi-bin/tools.cgi">Ping & Traceroute</a></li>
<li><a class="dropdown-item" href="/cgi-bin/console.cgi">Web Console</a></li>
<li><a class="dropdown-item" href="/cgi-bin/format.cgi">Format SD & reboot</a></li>
</ul>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdownPreview" href="#"
role="button" data-bs-toggle="dropdown" aria-expanded="false"><%= $tMenuPreview %></a>
<ul class="dropdown-menu" aria-labelledby="dropdownPreview">
<li><a class="dropdown-item" href="/cgi-bin/preview.cgi">JPEG</a></li>
<li><a class="dropdown-item" href="/cgi-bin/preview-mjpeg.cgi">MJPEG</a></li>
<li><a class="dropdown-item" href="/cgi-bin/preview-video.cgi">Video</a></li>
<li><a class="dropdown-item" href="/cgi-bin/mpreview.cgi">Preview</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<%
button() {
id=$(echo "${2// /_}" | tr '[:upper:]' '[:lower:]')
echo "<img id=\"$id\" src=\"/img/${1}\" Onclick=\"$id();\" title=\"${2}\">"
}
tbutton() {
id=$(echo "${2// /_}" | tr '[:upper:]' '[:lower:]')
echo "<img id=\"$id\" src=\"/img/${1}\" Onmousedown=\"$id();\" onmouseup=\"stop();\" title=\"${2}\">"
}
ttbuttonn() {
id=$(echo "${2// /_}" | tr '[:upper:]' '[:lower:]')
echo "<img id=\"$id\" src=\"/img/${1}\" Onmousedown=\"$id();\" onmouseup=\"focus_minuss();stop();\" title=\"${2}\">"
}
%>
<table border="0" cellpadding="2" cellspacing="2" width="100%" class= "b4">
<tr>
<td width=50>
<div id="GF" class="meven" align="center">
&nbsp;
</div>
</td>
<td width=50>
<div id="LEXP" class="meven" align="center">
&nbsp;
</div>
</td>
<td width=35>
<div id="STF" class="meven" align="center">
&nbsp;
</div>
</td>
<td width=35>
<div id="LST" class="meven" align="center">
&nbsp;
</div>
</td>
<td align=center onClick="fullscreen3(document.documentElement);return false;">&nbsp;</td>
<td width=60 align="right" class="contr" id="BL">
<% button "lt-off.svg" "light" %>
</td>
</tr>
</table>
<main>
<div class="container p-0">

View File

@ -0,0 +1,5 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
s_baf
%>

View File

@ -0,0 +1,270 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
qauto_focus=0;
qlight_control=0;
qfocus_in=0;
qalways_on=0;
qsim7600=0;
qfocus_port=0;
qfirst_step=0;
qircut_inv=0;
qfocus_control=0;
qec200t=0;
qsave_zf=0;
qfocus_threshold=0;
qauto_light=0;
qlight_port=0;
qlight_tr_on=0;
qlight_tr_off=0;
qdelay_tr=0;
qdelay_lt=0;
qapmode=0;
qbbsw=0;
qapname="00";
qcmid="0";
qcmkey="00000000";
qamkey="00000000";
data="$(printenv|grep POST_)"
IFS=$'\n' # make newlines the only separator
for name in $data; do
key="$(echo $name | sed 's/^POST_//' | cut -d= -f1 )"
value="$(echo $name | cut -d= -f2)"
if [ "$value" == "true" ]; then
value="1";
fi
if [ "$value" == "on" ]; then
value="1";
fi
if [ "$value" == "false" ]; then
value="0";
fi
if [ "$key" == "focus-port" ]; then
if [ "$value" == "" ]; then
value="0";
fi
fi
if [ "$key" == "first-step" ]; then
if [ "$value" == "" ]; then
value="0";
fi
fi
if [ "$key" == "light-port" ]; then
if [ "$value" == "" ]; then
value="0";
fi
fi
if [ "$key" == "light-tr-on" ]; then
if [ "$value" == "" ]; then
value="70";
fi
fi
if [ "$key" == "light-tr-off" ]; then
if [ "$value" == "" ]; then
value="40";
fi
fi
if [ "$key" == "focus-threshold" ]; then
if [ "$value" == "" ]; then
value="110";
fi
fi
if [ "$key" == "apmode" ]; then
if [ "$value" == "" ]; then
value="0";
fi
fi
if [ "$key" == "bbsw" ]; then
if [ "$value" == "" ]; then
value="0";
fi
fi
if [ "$key" == "apname" ]; then
if [ "$value" == "" ]; then
value="00";
fi
fi
if [ "$key" == "cmid" ]; then
if [ "$value" == "" ]; then
value="swit";
fi
fi
if [ "$key" == "cmkey" ]; then
if [ "$value" == "" ]; then
value="swit.737";
fi
fi
if [ "$key" == "amkey" ]; then
if [ "$value" == "" ]; then
value="10923874";
fi
fi
if [ "$key" == "delay-tr" ]; then
if [ "$value" == "" ]; then
value="6";
fi
fi
if [ "$key" == "delay-lt" ]; then
if [ "$value" == "" ]; then
value="10";
fi
fi
if [ "$value" == "" ]; then
value="0";
fi
if [ "$key" == "auto-focus" ]; then
qauto_focus="$value"; fi
if [ "$key" == "light-control" ]; then
qlight_control="$value"; fi
if [ "$key" == "focus-in" ]; then
qfocus_in="$value"; fi
if [ "$key" == "always-on" ]; then
qalways_on="$value"; fi
if [ "$key" == "sim7600" ]; then
qsim7600="$value"; fi
if [ "$key" == "focus-port" ]; then
qfocus_port="$value"; fi
if [ "$key" == "first-step" ]; then
qfirst_step="$value"; fi
if [ "$key" == "ircut-inv" ]; then
qircut_inv="$value"; fi
if [ "$key" == "focus-control" ]; then
qfocus_control="$value"; fi
if [ "$key" == "ec200t" ]; then
qec200t="$value"; fi
if [ "$key" == "save-zf" ]; then
qsave_zf="$value"; fi
if [ "$key" == "focus-threshold" ]; then
qfocus_threshold="$value"; fi
if [ "$key" == "auto-light" ]; then
qauto_light="$value"; fi
if [ "$key" == "light-port" ]; then
qlight_port="$value"; fi
if [ "$key" == "light-tr-on" ]; then
qlight_tr_on="$value"; fi
if [ "$key" == "light-tr-off" ]; then
qlight_tr_off="$value"; fi
if [ "$key" == "apmode" ]; then
qapmode="$value"; fi
if [ "$key" == "bbsw" ]; then
qbbsw="$value"; fi
if [ "$key" == "apname" ]; then
qapname="$value"; fi
if [ "$key" == "cmid" ]; then
qcmid="$value"; fi
if [ "$key" == "cmkey" ]; then
qcmkey="$value"; fi
if [ "$key" == "amkey" ]; then
qamkey="$value"; fi
if [ "$key" == "delay-tr" ]; then
qdelay_tr="$value"; fi
if [ "$key" == "delay-lt" ]; then
qdelay_lt="$value"; fi
if [ "$key" == "newdat" ]; then
qnewdat="$value"; fi
done
if [ "$qauto_focus" != "$(getenv auto-focus)" ]; then
fw_setenv auto-focus $qauto_focus; fi
if [ "$qfirst_step" != "$(getenv first-step)" ]; then
fw_setenv first-step $qfirst_step; fi
if [ "$qlight_control" != "$(getenv light-control)" ]; then
fw_setenv light-control $qlight_control; fi
if [ "$qfocus_in" != "$(getenv focus-in)" ]; then
fw_setenv focus-in $qfocus_in; fi
if [ "$qalways_on" != "$(getenv always-on)" ]; then
fw_setenv always-on $qalways_on; fi
fw_setenv sim7600 $qsim7600;
if [[ "$qsim7600" == "1" ]]
then
sed -i '27s/manual/auto/' /etc/network/interfaces
else
sed -i '27s/auto/manual/' /etc/network/interfaces
fi
if [ "$qfocus_port" != "$(getenv focus-port)" ]; then
fw_setenv focus-port $qfocus_port; fi
if [ "$qircut_inv" != "$(getenv ircut-inv)" ]; then
fw_setenv ircut-inv $qircut_inv; fi
if [ "$qfocus_control" != "$(getenv focus-control)" ]; then
fw_setenv focus-control $qfocus_control; fi
fw_setenv ec200t $qec200t;
if [[ "$qec200t" == "1" ]]
then
sed -i '6s/manual/auto/' /etc/network/interfaces
else
sed -i '6s/auto/manual/' /etc/network/interfaces
fi
if [ "$qsave_zf" != "$(getenv save-zf)" ]; then
fw_setenv save-zf $qsave_zf; fi
if [ "$qfocus_threshold" != "$(getenv focus-threshold)" ]; then
fw_setenv focus-threshold $qfocus_threshold; fi
if [ "$qauto_light" != "$(getenv auto-light)" ]; then
fw_setenv auto-light $qauto_light; fi
if [ "$qlight_port" != "$(getenv light-port)" ]; then
fw_setenv light-port $qlight_port; fi
if [ "$qlight_tr_on" != "$(getenv light-tr-on)" ]; then
fw_setenv light-tr-on $qlight_tr_on; fi
if [ "$qlight_tr_off" != "$(getenv light-tr-off)" ]; then
fw_setenv light-tr-off $qlight_tr_off; fi
snap=0;
if [ "$qapmode" != "$(getenv apmode)" ]; then
fw_setenv apmode $qapmode; snap=1;
fi
fw_setenv bbsw $qbbsw;
if [[ "$qbbsw" == "1" ]]
then
sed -i '56s/manual/auto/' /etc/network/interfaces
else
sed -i '56s/auto/manual/' /etc/network/interfaces
fi
if [ "$qapname" != "$(getenv apname)" ]; then
fw_setenv apname $qapname; snap=1; fi
if [ "$qcmid" != "$(getenv cmid)" ]; then
fw_setenv cmid $qcmid; fi
if [ "$qcmkey" != "$(getenv cmkey)" ]; then
fw_setenv cmkey $qcmkey; fi
if [ "$qamkey" != "$(getenv amkey)" ]; then
fw_setenv amkey $qamkey;
npsk="psk=\"$qamkey\"";
sed -i '8d' /etc/wpa_supplicant.conf
sed -i "8i \\$npsk" /etc/wpa_supplicant.conf
fi
if [ "$qdelay_tr" != "$(getenv delay-tr)" ]; then
fw_setenv delay-tr $qdelay_tr; fi
if [ "$qdelay_lt" != "$(getenv delay-lt)" ]; then
fw_setenv delay-lt $qdelay_lt; fi
if [ "$snap" == "1" ]; then
cssid="gk300-$(gmnum)-$(getenv apname)";
nssid="ssid=\"$cssid\"";
sed -i '5d' /etc/wpa_supplicant.conf
sed -i "5i \\$nssid" /etc/wpa_supplicant.conf
echo $cssid > /etc/hostname
fi
date -s "$qnewdat" > /dev/null
hwclock -w > /dev/null
#echo "$qauto_focus <br>";
#echo "$qlight_control<br>";
#echo "$qfocus_in<br>";
#echo "$qalways_on<br>";
#echo "$qsim7600<br>";
#echo "$qfocus_port<br>";
#echo "$qircut_inv<br>";
#echo "$qfocus_control<br>";
#echo "$qec200t<br>";
#echo "$qsave_zf<br>";
#echo "$qfocus_threshold<br>";
#echo "$qauto_light<br>";
#echo "$qlight_port<br>";
#echo "$qlight_threshold<br>";
#echo "$qnewdat<br>";
redirect_to "/cgi-bin/fl-settings.cgi"
%>

View File

@ -0,0 +1,5 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
s_fs_out 1
%>

View File

@ -0,0 +1,5 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
s_fs_in 1
%>

View File

@ -0,0 +1,340 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<% page_title="Extended settings"
ipaddr=$(printenv | grep HTTP_HOST | cut -d= -f2 | cut -d: -f1)
button() {
id=$(echo "${2// /_}" | tr '[:upper:]' '[:lower:]')
echo "<img id=\"$id\" src=\"/img/${1}\" Onclick=\"$id();\" title=\"${2}\">"
}
%>
<%in _header.cgi %>
<h2>Extended settings</h2>
<div class="container p-3">
<form action="/cgi-bin/ext-settings-update.cgi" method="POST" autocomplete="off">
<div class="row row-cols-1 row-cols-xl-2 row-cols-xxl-3 g-4 mb-3">
<!-- ------------------------------------------------------------------------------------------------------------------------- --->
<div class="col">
<div class="card h-100">
<div class="card-header">Light</div>
<div class="card-body">
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv auto-light)" == "1" ]]
then
echo "<input class='form-check-input' name='auto-light' id='auto-light' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='auto-light' id='auto-light' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="auto-light">Auto light</label>
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="light-tr-on">Lighting threshold turn-on</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="light-tr-on" id="light-tr-on" value="<%= `getenv light-tr-on` %>" placeholder="70">
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="light-tr-off">Lighting threshold turn-off</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="light-tr-off" id="light-tr-off" value="<%= `getenv light-tr-off` %>" placeholder="40">
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="delay-lt">Turn-off delay</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="delay-lt" id="delay-lt" value="<%= `getenv delay-lt` %>" placeholder="10">
</div>
</div>
</div>
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv always-on)" == "1" ]]
then
echo "<input class='form-check-input' name='always-on' id='always-on' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='always-on' id='always-on' type='checkbox' role='switch'>";
fi; %>
<label class='form-check-label' for='always-on'>Always on</label>
</div>
</div>
</div>
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv light-control)" == "1" ]]
then
echo "<input class='form-check-input' name='light-control' id='light-control' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='light-control' id='light-control' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="light-control">Light control gpio/uart</label>
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="light-port">Uart/GPIO № for control</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="light-port" id="light-port" value="<%= `getenv light-port` %>" placeholder="4">
</div>
</div>
</div>
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv ircut-inv)" == "1" ]]
then
echo "<input class='form-check-input' name='ircut-inv' id='ircut-inv' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='ircut-inv' id='ircut-inv' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="ircut-inv">IRCUT normal/inverse</label>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- ------------------------------------------------------------------------------------------------------------------------- --->
<div class="col">
<div class="card h-100">
<div class="card-header">Focus</div>
<div class="card-body">
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv auto-focus)" == "1" ]]
then
echo "<input class='form-check-input' name='auto-focus' id='auto-focus' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='auto-focus' id='auto-focus' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="auto-focus">Auto focus</label>
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="focus-threshold">Autofocus threshold</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="focus-threshold" id="focus-threshold" value="<%= `getenv focus-threshold` %>" placeholder="120">
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="delay-tr">Delay for triggered</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="delay-tr" id="delay-tr" value="<%= `getenv delay-tr` %>" placeholder="6">
</div>
</div>
</div>
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv focus-in)" == "1" ]]
then
echo "<input class='form-check-input' name='focus-in' id='focus-in' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='focus-in' id='focus-in' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="focus-in">Autofocus incoming/outgoing</label>
</div>
</div>
</div>
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv focus-control)" == "1" ]]
then
echo "<input class='form-check-input' name='focus-control' id='focus-control' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='focus-control' id='focus-control' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="focus-control">Focus control gpio/uart</label>
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="first-step">Initial number of scaling steps when</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="first-step" id="first-step" value="<%= `getenv first-step` %>" placeholder="4">
</div>
</div>
</div>
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label" for="focus-port">Uart № for control</label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="focus-port" id="focus-port" value="<%= `getenv focus-port` %>" placeholder="0">
</div>
</div>
</div>
<!--- <div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv save-zf)" == "1" ]]
then
echo "<input class='form-check-input' name='save-zf' id='save-zf' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='save-zf' id='save-zf' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="save-zf">Autosave manual zoom&focus</label>
</div>
</div>
</div> -->
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="col">
<div class="card h-100">
<div class="card-header">LTE, Wifi, Interfnal network settings</div>
<div class="card-body">
<div class="alert alert-danger"><b>&#1042;&#1085;&#1080;&#1084;&#1072;&#1085;&#1080;&#1077; &#1085;&#1077;&#1082;&#1086;&#1088;&#1088;&#1077;&#1082;&#1090;&#1085;&#1072;&#1103; &#1085;&#1072;&#1089;&#1090;&#1088;&#1086;&#1081;&#1082;&#1072; &#1084;&#1086;&#1078;&#1077;&#1090; &#1087;&#1088;&#1080;&#1074;&#1077;&#1089;&#1090;&#1080; &#1082; &#1087;&#1086;&#1083;&#1085;&#1086;&#1081; &#1087;&#1086;&#1090;&#1077;&#1088;&#1077; &#1089;&#1074;&#1103;&#1079;&#1080; &#1089; &#1082;&#1072;&#1084;&#1077;&#1088;&#1086;&#1081;.</b></div>
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv sim7600)" == "1" ]]
then
echo "<input class='form-check-input' name='sim7600' id='sim7600' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='sim7600' id='sim7600' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="sim7600">Sim7600</label>
</div>
</div>
</div>
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv ec200t)" == "1" ]]
then
echo "<input class='form-check-input' name='ec200t' id='ec200t' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='ec200t' id='ec200t' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="ec200t">EC200t-EU</label>
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv bbsw)" == "1" ]]
then
echo "<input class='form-check-input' name='bbsw' id='bbsw' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='bbsw' id='bbsw' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="bbsw">BBSW net enabled</label>
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="row mb-2 boolean">
<div class="col">
<div class="form-check form-switch">
<% if [[ "$(getenv apmode)" == "1" ]]
then
echo "<input class='form-check-input' name='apmode' id='apmode' type='checkbox' checked='' role='switch'>";
else
echo "<input class='form-check-input' name='apmode' id='apmode' type='checkbox' role='switch'>";
fi; %>
<label class="form-check-label" for="apmode">AP Mode enabled</label>
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label">AP Name: <b> gk300-<%= "$(gmnum)" %>-</b></label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control text-end" type="text" name="apname" id="apname" value="<%= `getenv apname` %>" placeholder="00">
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label">Key: </b></label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control" type="password" name="amkey" id="amkey" value="<%= `getenv amkey` %>">
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="alert alert"><b>Client mode settings.</b></div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label">SSID: </b></label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control" type="text" name="cmid" id="cmid" value="<%= `getenv cmid` %>" placeholder="ssid">
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
<div class="row mb-2 number">
<div class="col-md-7">
<label class="form-label">Key: </b></label>
</div>
<div class="col-md-5">
<div class="input-group">
<input class="form-control" type="password" name="cmkey" id="cmkey" value="<%= `getenv cmkey` %>">
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
</div>
</div>
</div>
<!--- ----------------------------------------------------------------------------------------------------------- --->
</div>
<input type="hidden" id="newdat" name="newdat" value="">
<button type="submit" class="btn btn-primary">Save changes</button>
</form>
</div>
<script type="text/javascript" language="javascript">
var d = new Date();
var e = formatDate(d);
document.getElementById('newdat').value = e;
</script>
<%in _footer.cgi %>

View File

@ -0,0 +1,10 @@
#!/usr/bin/haserl
content-type: text/plain
<%
cf=$(gf);
echo "{ \"gf\": $(gf), \"ld\": $(cat < /tmp/lt), \"lexp\": $(gexp), \"stf\": $(cat < /tmp/st), \"lst\": $(cat < /tmp/lst) }";
%>

View File

@ -0,0 +1,16 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
mkfs.vfat -n WTF /dev/mmcblk0p1
page_title="Rebooting..."
command="reboot -d 3"
output=$(reboot -d 3)
result=$?
if [ "0" -ne "$result" ]; then %>
<%in _header.cgi %>
<% report_command_error "$command" "output" %>
<%in _footer.cgi %>
<% else
redirect_to "/cgi-bin/progress.cgi"
fi
%>

View File

@ -0,0 +1,8 @@
#!/usr/bin/haserl
content-type: text/plain
<%
hostname
%>

View File

@ -0,0 +1,16 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
ll="";
while [[ -z "$ll" ]]
do
ll="$(cat /tmp/lt)"
done
if [[ "$ll" == "1" ]]
then
light 0
else
light 1
fi
%>

View File

@ -0,0 +1,30 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<% page_title="Camera Preview"
ipaddr=$(printenv | grep HTTP_HOST | cut -d= -f2 | cut -d: -f1)
%>
<%in _mheader.cgi %>
<div class="b1 parent">
<div class="block">
<img id="img1" align="middle" border="" width="100%" src="/img/mycam.jpg" onClick="fullscreen3(document.documentElement);return false;">
</div>
</div>
</main>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class= "control b3">
<tr>
<td width=20>&nbsp;</td>
<td width=60><% button "focus-plus.svg" "Focus plus" %><br>
<% button "focus-auto.svg" "Focus auto" %><br>
<% button "focus-minus.svg" "Focus minus" %></td>
<td width="100%" align=center onClick="fullscreen3(document.documentElement);return false;">&nbsp;</td>
<td width=60 align="right">
<% button "zoom-in.svg" "Zoom in" %><br><br>
<% button "zoom-out.svg" "Zoom out" %></td>
<td width=20>&nbsp;</td>
</tr>
</table>
<script type="text/javascript">
getserv();
</script>
</body>
</html>

View File

@ -0,0 +1,5 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
s_z_up
%>

View File

@ -0,0 +1,5 @@
#!/usr/bin/haserl
<%in _common.cgi %>
<%
s_z_down
%>

Some files were not shown because too many files have changed in this diff Show More