#!/bin/sh set_gpio() { test -e /sys/class/gpio/gpio$1 && echo $1 > /sys/class/gpio/unexport echo $1 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio$1/direction echo $2 > /sys/class/gpio/gpio$1/value sleep 1 } set_mmc() { mmc=/sys/devices/platform/jzmmc_v1.2.$1/present if [ "$(cat $mmc)" = "N" ]; then echo "INSERT" > $mmc fi } # RTL8189FS Generic if [ "$1" = "rtl8189fs-generic" ]; then set_mmc 1 modprobe 8189fs exit 0 fi # ATBM603x Generic if [ "$1" = "atbm603x-generic" ]; then set_mmc 1 cp /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm60xx_conf/set_rate_power.txt /tmp modprobe atbm603x_wifi_sdio exit 0 fi # T31 Wyze V3 / AtomCam 2 ATBM603x if [ "$1" = "atbm603x-t31-wyze-v3" ]; then set_gpio 57 0;set_gpio 57 1 set_mmc 1 cp /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm60xx_conf/set_rate_power.txt /tmp modprobe atbm603x_wifi_sdio atbm_printk_mask=0 exit 0 fi # T31 Wyze PanV2 ATBM603x if [ "$1" = "atbm603x-t31-wyze-pan-v2" ]; then set_gpio 58 0;set_gpio 58 1 set_mmc 1 cp /usr/share/atbm60xx_conf/atbm_txpwer_dcxo_cfg.txt /tmp cp /usr/share/atbm60xx_conf/set_rate_power.txt /tmp modprobe atbm603x_wifi_sdio atbm_printk_mask=0 exit 0 fi # T31 Wyze V3 RTL8189FTV if [ "$1" = "rtl8189ftv-t31-wyze-v3" ]; then set_gpio 57 1 set_mmc 1 modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 exit 0 fi # T31 Wyze DB3 RTL8189FTV if [ "$1" = "rtl8189ftv-t31-wyze-db3" ]; then set_mmc 1 modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 exit 0 fi # T20 Wyze V2 RTL8189FTV if [ "$1" = "rtl8189ftv-t20-wyze-v2" ]; then set_mmc 1 modprobe 8189fs rtw_power_mgnt=0 rtw_enusbss=0 exit 0 fi # T20 Wyze PanV1 RTL8189ES if [ "$1" = "rtl8189es-t20-wyze-pan-v1" ]; then set_mmc 1 modprobe 8189es rtw_power_mgnt=0 rtw_enusbss=0 exit 0 fi exit 1