gtxaspec / wz_mini_hacks

wz camera mods... make your camera better.
1.23k stars 104 forks source link

With Hack WyzeCam3 loses wyze config if power is lost, and boots in pairing mode (blinking red led) #615

Open johnvprcam24573455623 opened 10 months ago

johnvprcam24573455623 commented 10 months ago

I guys, I love the wz_mini_hacks however I have a serious problem, if the cam lose power, then most of the time will reboot in wyze pairing mode (red led blinking) so no RTSP available and basically offline.

these are the versions: T31(WYZE_CAKP2JFUS) on 4.36.9.139 running wz_mini

This is my config image image image

gtxaspec commented 10 months ago

This could be an issue with your micro SD card, do you have another to test with?

biggt commented 9 months ago

I am having a similar issue. I pulled the /wz_mini/log/wz_init.log file and found that when it's stuck in this "pairing mode" that it is failing to start the wpa_supplicant. Follows is the entire wz_init.log file that references what I'm seeing.

welcome to wz_init.sh
PID 1

 __          ________  __  __ _____ _   _ _____
 \ \        / |___  / |  \/  |_   _| \ | |_   _|
  \ \  /\  / /   / /  | \  / | | | |  \| | | |
   \ \/  \/ /   / /   | |\/| | | | | . ` | | |
    \  /\  /   / /__  | |  | |_| |_| |\  |_| |_
     \/  \/   /_____| |_|  |_|_____|_| \_|_____|
                  ______
                 |______|

#####S00config#####
No Windows line endings detected. Configuration file is valid.
#####S01bind#####
Replace stock busybox
Replace stock fstab
Replace stock inittab
Replace /etc/profile for local/ssh shells
Mount kernel modules in /lib
Replace system hostname
#####S02tmpfs#####
Mount wz_mini tmpfs
Create workspace directory
Mounting global tmpfs
#####S03busybox#####
Install busybox applets
#####S04model#####
WYZE_CAKP2JFUS detected
#####S05mount#####
mounting /system
Current Mounts:
rootfs on / type rootfs (rw)
devtmpfs on /dev type devtmpfs (rw,relatime,size=46572k,nr_inodes=11643,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/mtdblock2 on / type squashfs (ro,relatime)
/dev/mmcblk0p1 on /opt type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /bin/busybox type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/fstab type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/inittab type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/profile type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /lib/modules type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/hostname type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /opt/wz_mini/tmp type tmpfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
/dev/mtdblock3 on /system type squashfs (ro,relatime)
#####S06car#####
Checking for CAR FW
#####S07inject#####
Copy stock rcS
Add verbose debugging to rcS
Inject init.d scripts to rcS
Modify Global Paths in rcS
Copy factory app_init.sh
Replace factory app_init.sh path
Enable libcallback
set path for iCamera
#####S08passwd#####
Replace stock password
#####S09firstboot#####
First boot already completed
#####S10kmod#####
Enable 8189fs
Enable atbm603x_wifi_sdio
Load video loopback driver at video1 video2
NFSv4 enabled
CIFS enabled
usb_storage enabled
ext4 support enabled
#####S11configbackup#####
Factory config backup directory exists
T31 platform backup
Backup /configs
#####S12ssh#####
Running dropbear ssh server
#####S14terminfo#####
Terminfo already present
#####S15fwupdate#####
Current stock firmware version:
[VER]
appver=4.36.9.139
#####S16factorycheck#####
Replace factorycheck with dummy, to prevent bind unmount
#####S18ntp#####
#####S20initsetup#####
grep: /configs/.user_config: No such file or directory
Initial setup not completed yet.
Waiting for WiFi settings from QR code...
#####S21killmisc#####
#####S30patchicamera#####
Patch already applied to current iCamera version.
iCamera patch applied successfully.
+ echo /sbin/mdev
+ /sbin/mdev -s
+ echo 'mdev is ok......'
mdev is ok......
+ echo ' __________________________________
|                                  |
|                                  |
|                                  |
|                                  |
| _   _             _           _  |
|| | | |_   _  __ _| |     __ _(_) |
|| |_| | | | |/ _| | |  _ / _| | | |
||  _  | |_| | (_| | |_| | (_| | | |
||_| |_|\__,_|\__,_|_____|\__,_|_| |
|                                  |
|                                  |
|_____2020_WYZE_CAM_V3_@HUALAI_____|
'
 __________________________________
|                                  |
|                                  |
|                                  |
|                                  |
| _   _             _           _  |
|| | | |_   _  __ _| |     __ _(_) |
|| |_| | | | |/ _| | |  _ / _| | | |
||  _  | |_| | (_| | |_| | (_| | | |
||_| |_|\__,_|\__,_|_____|\__,_|_| |
|                                  |
|                                  |
|_____2020_WYZE_CAM_V3_@HUALAI_____|

+ export 'PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/wz_mini/bin'
+ export 'PATH=/system/bin:/bin:/sbin:/usr/bin:/usr/sbin:/opt/wz_mini/bin'
+ export 'LD_LIBRARY_PATH=/system/lib:/opt/wz_mini/lib'
+ export 'LD_LIBRARY_PATH=/thirdlib:/system/lib:/opt/wz_mini/lib'
+ ifconfig lo up
+ mount -t squashfs /dev/mtdblock3 /system
mount: mounting /dev/mtdblock3 on /system failed: Resource busy
+ mount -t jffs2 /dev/mtdblock6 /configs
+ /opt/wz_mini/etc/rc.d/K03rcd
+ /opt/wz_mini/etc/rc.d/K01network
#####S01swap#####
Swap archive missing, not extracting
Swap file found, enable
ifconfig: wlan0: error fetching interface information: Device not found
K01network: Network HW not ready yet, try again in 5 seconds
#####S03ethernet#####
USB Ethernet disabled
#####S04usbdirect#####
USB Direct disabled
USB RNDIS disabled
No alternate iface enabled
#####S10firmware#####
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
Firmware updates disabled
#####S14nightdrop#####
Night Drop Disable, Enabled
#####S17motor#####
Motor enabled
#####S18fps#####
System FPS greater than default, setting.
cat: can't open '/configs/.user_config': No such file or directory
sed: /configs/.user_config: No such file or directory
#####S19video#####
+ /opt/wz_mini/tmp/.storage/app_init.sh
ifconfig: wlan0: error fetching interface information: Device not found
S20cron: IP Address not acquired yet, try again in 5 seconds
#############ubootddr = 540.000MHz ########
################## to wait wifi vendor id ####################
################## [vendor:0x007a] atbm603x wifi ###################
(O _ o) welcome to the config file repair script [start part]!
(O _ o) this is valid mac!
(O _ o) set [/configs/.product_config] to read-only!
(O _ o) to mount kback...
(^ _ ^) kback mount ok!
(O _ o) found the md5 file in kback! [/mnt/MD5.72e8ac3711bf776d52d0e5e95c04b059.config]
(O _ o)  real  md5 is [72e8ac3711bf776d52d0e5e95c04b059]
(O _ o) record md5 is [72e8ac3711bf776d52d0e5e95c04b059]
(^ _ ^) check md5 file [/mnt/MD5.72e8ac3711bf776d52d0e5e95c04b059.config] is ok!
(^ _ ^) the md5 file in kback is ok!
(- _ -) to umount kback...
(- _ -) i will exit!
Updating device time to:
Fri May 13 20:22:36 UTC 2022
===========welcome to ver-comp tool=========
[ver-comp]dbg: appver:  4.36.9.139
[ver-comp]dbg: rootver: 4.36.3.19
[ver-comp]exec cmd: cp -rf /system/bin/app.ver /configs/
#######################
#   IS USER PROCESS   #
#######################
[FC] mount tfcard finish!
[FC] Test.tar no exist
[FC] umount tfcard finish!
[FC] In [user] mode!
kernel.core_pattern = |/system/bin/ucoredmp_collector.sh --pid %p --signal %s --name %e --time %t --output-dir /media/mmc/cores
kernel.core_pipe_limit = 1
net.unix.max_dgram_qlen = 128
Waiting for WiFi settings from QR code...
#####S01wlanhw#####
Waiting for wlan hw init
#####S03ipv6#####
net.ipv6.conf.all.disable_ipv6 = 1
ipv6 disabled
#####S04wireguard#####
Wireguard disabled
#####S08hostname#####
Set hostname to WCV3
#####S10httpd#####
: IP Address not acquired yet, try again in 5 seconds
wz_mini.conf is missing the line WEB_SERVER_OPTIONS <br >
to populate it with full capabilities:<pre>WEB_SERVER_OPTIONS="cam config car jpeg multicam diag status"</pre>
httpd enabled
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
#####S13mp4write#####
Default position not defined for X-axis
Setting CH0 FPS
Starting imp_monitor.sh in daemon mode...
S20cron: IP Address not acquired yet, try again in 5 seconds
#####S21syslog#####
mp4_write enabled
optarg = 0:80:4:30
### chn = 0, offset = 80, size = 4, data = 30
 
Setting CH1 FPS
optarg = 1:80:4:15
### chn = 1, offset = 80, size = 4, data = 15
 
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds

Here is a log file from 2 boots ago where it successfully boots:

welcome to wz_init.sh
PID 1

 __          ________  __  __ _____ _   _ _____
 \ \        / |___  / |  \/  |_   _| \ | |_   _|
  \ \  /\  / /   / /  | \  / | | | |  \| | | |
   \ \/  \/ /   / /   | |\/| | | | | . ` | | |
    \  /\  /   / /__  | |  | |_| |_| |\  |_| |_
     \/  \/   /_____| |_|  |_|_____|_| \_|_____|
                  ______
                 |______|

#####S00config#####
No Windows line endings detected. Configuration file is valid.
#####S01bind#####
Replace stock busybox
Replace stock fstab
Replace stock inittab
Replace /etc/profile for local/ssh shells
Mount kernel modules in /lib
Replace system hostname
#####S02tmpfs#####
Mount wz_mini tmpfs
Create workspace directory
Mounting global tmpfs
#####S03busybox#####
Install busybox applets
#####S04model#####
WYZE_CAKP2JFUS detected
#####S05mount#####
mounting /system
Current Mounts:
rootfs on / type rootfs (rw)
devtmpfs on /dev type devtmpfs (rw,relatime,size=46572k,nr_inodes=11643,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/mmcblk0p1 on /opt type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mtdblock2 on / type squashfs (ro,relatime)
/dev/mmcblk0p1 on /bin/busybox type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/fstab type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/inittab type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/profile type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /lib/modules type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /etc/hostname type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /opt/wz_mini/tmp type tmpfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime)
/dev/mtdblock3 on /system type squashfs (ro,relatime)
#####S06car#####
Checking for CAR FW
#####S07inject#####
Copy stock rcS
Add verbose debugging to rcS
Inject init.d scripts to rcS
Modify Global Paths in rcS
Copy factory app_init.sh
Replace factory app_init.sh path
Enable libcallback
set path for iCamera
#####S08passwd#####
Replace stock password
#####S09firstboot#####
First boot already completed
#####S10kmod#####
Enable 8189fs
Enable atbm603x_wifi_sdio
Load video loopback driver at video1 video2
NFSv4 enabled
#####S11configbackup#####
Factory config backup directory exists
T31 platform backup
Backup /configs
#####S12ssh#####
Running dropbear ssh server
#####S14terminfo#####
Terminfo already present
#####S15fwupdate#####
Current stock firmware version:
[VER]
appver=4.36.9.139
#####S16factorycheck#####
Replace factorycheck with dummy, to prevent bind unmount
#####S18ntp#####
#####S20initsetup#####
Initial setup not completed yet.
Waiting for WiFi settings from QR code...
#####S21killmisc#####
#####S30patchicamera#####

====> Calling patch_out_calls_to_test_cloud_url

Original at 0x89938
00000000: 2a24 120c                                *$..
Patched
00000000: 0000 0000                                ....

Original at 0x89858
00000000: 2a24 120c                                *$..
Patched
00000000: 0000 0000                                ....

====> Calling patch_out_jobs_after_connect

Original at 504196
00000000: 5500 073c                                U..<
Patched
00000000: 0000 0000                                ....

Original at 504200
00000000: 4800 043c                                H..<
Patched
00000000: 0000 0000                                ....

Original at 504204
00000000: 2128 0000                                !(..
Patched
00000000: 0000 0000                                ....

Original at 504208
00000000: 2130 0000                                !0..
Patched
00000000: 0000 0000                                ....

Original at 504212
00000000: 5411 e724                                T..$
Patched
00000000: 0000 0000                                ....

Original at 504216
00000000: ef2a 120c                                .*..
Patched
00000000: 0000 0000                                ....

Original at 504220
00000000: 38b8 8424                                8..$
Patched
00000000: 0000 0000                                ....

Original at 504224
00000000: 8b63 120c                                .c..
Patched
00000000: 0000 0000                                ....

Original at 504228
00000000: 0100 0424                                ...$
Patched
00000000: 0000 0000                                ....

Original at 504232
00000000: de5b 110c                                .[..
Patched
00000000: 0000 0000                                ....

Original at 504236
00000000: 0100 0424                                ...$
Patched
00000000: 0000 0000                                ....

Original at 504240
00000000: 4200 043c                                B..<
Patched
00000000: 0000 0000                                ....

Original at 504244
00000000: 5500 073c                                U..<
Patched
00000000: 0000 0000                                ....

Original at 504248
00000000: f462 8424                                .b.$
Patched
00000000: 0000 0000                                ....

Original at 504252
00000000: 2128 0000                                !(..
Patched
00000000: 0000 0000                                ....

Original at 504256
00000000: 2130 0000                                !0..
Patched
00000000: 0000 0000                                ....

Original at 504260
00000000: ef2a 120c                                .*..
Patched
00000000: 0000 0000                                ....

Original at 504264
00000000: 6011 e724                                `..$
Patched
00000000: 0000 0000                                ....

Original at 504268
00000000: 27ff 0010                                '...
Patched
00000000: 0000 0000                                ....

====> Calling patch_out_network_reset_to_idle

Original at 563620
00000000: 7805 0224                                x..$
Patched
00000000: 0000 0000                                ....

Original at 563624
00000000: 1000 a2af                                ....
Patched
00000000: 0000 0000                                ....

Original at 563628
00000000: 5500 033c                                U..<
Patched
00000000: 0000 0000                                ....

Original at 563632
00000000: 5500 023c                                U..<
Patched
00000000: 0000 0000                                ....

Original at 563636
00000000: c050 4224                                .PB$
Patched
00000000: 0000 0000                                ....

Original at 563640
00000000: cc45 6324                                .Ec$
Patched
00000000: 0000 0000                                ....

Original at 563644
00000000: 1400 a2af                                ....
Patched
00000000: 0000 0000                                ....

Original at 563648
00000000: 1800 a3af                                ....
Patched
00000000: 0000 0000                                ....

Original at 563652
00000000: a057 6426                                .Wd&
Patched
00000000: 0000 0000                                ....

Original at 563656
00000000: 0700 0524                                ...$
Patched
00000000: 0000 0000                                ....

Original at 563660
00000000: 9048 8626                                .H.&
Patched
00000000: 0000 0000                                ....

Original at 563664
00000000: 4c55 2726                                LU'&
Patched
00000000: 0000 0000                                ....

Original at 563668
00000000: db08 120c                                ....
Patched
00000000: 0000 0000                                ....

Original at 563672
00000000: 0400 e0ae                                ....
Patched
00000000: 0000 0000                                ....

Original at 563676
00000000: 6c01 f98e                                l...
Patched
00000000: 0000 0000                                ....

Original at 563680
00000000: 9500 2013                                .. .
Patched
00000000: 0000 0000                                ....

Original at 563684
00000000: 0000 0000                                ....
Patched
00000000: 0000 0000                                ....

====> Calling patch_out_code_test_enable

Original at 0x7dfcc
00000000: cbf0 110c                                ....
Patched
00000000: 0000 0000                                ....

Patching done.
816a42f5f35dd41ad9aae19163e98c49  iCamera
Installed.
iCamera patch applied successfully.
+ echo /sbin/mdev
+ /sbin/mdev -s
+ echo 'mdev is ok......'
mdev is ok......
+ echo ' __________________________________
|                                  |
|                                  |
|                                  |
|                                  |
| _   _             _           _  |
|| | | |_   _  __ _| |     __ _(_) |
|| |_| | | | |/ _| | |  _ / _| | | |
||  _  | |_| | (_| | |_| | (_| | | |
||_| |_|\__,_|\__,_|_____|\__,_|_| |
|                                  |
|                                  |
|_____2020_WYZE_CAM_V3_@HUALAI_____|
'
 __________________________________
|                                  |
|                                  |
|                                  |
|                                  |
| _   _             _           _  |
|| | | |_   _  __ _| |     __ _(_) |
|| |_| | | | |/ _| | |  _ / _| | | |
||  _  | |_| | (_| | |_| | (_| | | |
||_| |_|\__,_|\__,_|_____|\__,_|_| |
|                                  |
|                                  |
|_____2020_WYZE_CAM_V3_@HUALAI_____|

+ export 'PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/wz_mini/bin'
+ export 'PATH=/system/bin:/bin:/sbin:/usr/bin:/usr/sbin:/opt/wz_mini/bin'
+ export 'LD_LIBRARY_PATH=/system/lib:/opt/wz_mini/lib'
+ export 'LD_LIBRARY_PATH=/thirdlib:/system/lib:/opt/wz_mini/lib'
+ ifconfig lo up
+ mount -t squashfs /dev/mtdblock3 /system
mount: mounting /dev/mtdblock3 on /system failed: Resource busy
+ mount -t jffs2 /dev/mtdblock6 /configs
+ /opt/wz_mini/etc/rc.d/K03rcd
+ /opt/wz_mini/etc/rc.d/K01network
#####S01swap#####
Swap archive missing, not extracting
Swap file found, enable
ifconfig: wlan0: error fetching interface information: Device not found
K01network: Network HW not ready yet, try again in 5 seconds
#####S03ethernet#####
USB Ethernet disabled
#####S04usbdirect#####
USB Direct disabled
USB RNDIS disabled
No alternate iface enabled
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
#####S10firmware#####
Firmwware updates enabled, monitor script running
#####S14nightdrop#####
Night Drop Disable, Enabled
#####S17motor#####
Motor enabled
#####S18fps#####
sh: 20: unknown operand
#####S19video#####
+ /opt/wz_mini/tmp/.storage/app_init.sh
ifconfig: wlan0: error fetching interface information: Device not found
S20cron: IP Address not acquired yet, try again in 5 seconds
#############ubootddr = 540.000MHz ########
################## to wait wifi vendor id ####################
################## [vendor:0x007a] atbm603x wifi ###################
(O _ o) welcome to the config file repair script [start part]!
(O _ o) this is valid mac!
(O _ o) set [/configs/.product_config] to read-only!
(O _ o) to mount kback...
(^ _ ^) kback mount ok!
(O _ o) found the md5 file in kback! [/mnt/MD5.a5e362c56a2d03b132facd095cec1532.config]
(O _ o)  real  md5 is [a5e362c56a2d03b132facd095cec1532]
(O _ o) record md5 is [a5e362c56a2d03b132facd095cec1532]
(^ _ ^) check md5 file [/mnt/MD5.a5e362c56a2d03b132facd095cec1532.config] is ok!
(^ _ ^) the md5 file in kback is ok!
(- _ -) to umount kback...
(- _ -) i will exit!
Updating device time to:
Fri May 13 20:22:36 UTC 2022
===========welcome to ver-comp tool=========
[ver-comp]dbg: appver:  4.36.9.139
[ver-comp]dbg: rootver: 4.36.3.19
[ver-comp]exec cmd: cp -rf /system/bin/app.ver /configs/
#######################
#   IS USER PROCESS   #
#######################
[FC] mount tfcard finish!
[FC] Test.tar no exist
[FC] umount tfcard finish!
[FC] In [user] mode!
kernel.core_pattern = |/system/bin/ucoredmp_collector.sh --pid %p --signal %s --name %e --time %t --output-dir /media/mmc/cores
kernel.core_pipe_limit = 1
net.unix.max_dgram_qlen = 128
Waiting for WiFi settings from QR code...
#####S01wlanhw#####
Waiting for wlan hw init
#####S03ipv6#####
net.ipv6.conf.all.disable_ipv6 = 1
ipv6 disabled
#####S04wireguard#####
Wireguard disabled
#####S08hostname#####
Set hostname to WCV3
: IP Address not acquired yet, try again in 5 seconds
#####S10httpd#####
wz_mini.conf is missing the line WEB_SERVER_OPTIONS <br >
to populate it with full capabilities:<pre>WEB_SERVER_OPTIONS="cam config car jpeg multicam diag status"</pre>
httpd enabled
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
#####S13mp4write#####
Default position not defined for X-axis
fps channel 0 is empty
fps channel 1 is empty
Starting imp_monitor.sh in daemon mode...
#####S21syslog#####
S20cron: IP Address not acquired yet, try again in 5 seconds
mp4_write enabled
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Detected WiFi configs. 
Failed to connect to non-global ctrl_ifname: wlan0  error: No such file or directory
Waiting for WiFi settings from QR code...
: IP Address not acquired yet, try again in 5 seconds
S14storemac: wpa_supplicant not initialized yet, try again in 5 seconds
S09coredump: wpa_supplicant not initialized yet, try again in 5 seconds
S12remoteaccessory: IP Address not acquired yet, try again in 5 seconds
S20cron: IP Address not acquired yet, try again in 5 seconds
Detected WiFi configs. 
WiFi connection seems Good. Updating bindOk=1.
#####S09dnsmasq#####
wait for resolv.conf creation from iCamera
#####S14storemac#####
store original mac
#####S15v4l2rtspserver#####
Enable video ch 0
#####S09coredump#####
Killing dumpload
Enable audio ch 0
#####S12remoteaccessory#####
Remote accessory support disabled
Enable video ch 1
Enable video ch 1
Setting kernel core pattern
delay RTSP for iCamera
#####S20cron#####
ok
 bindOk=1
dnsmasq enabled
Starting RTSP server
#####S16rtmp#####
#####S17go2rtc#####
go2rtc disabled
No custom script configured in wz_mini.conf
Store dmesg logs
Deleting logs older than 5 boots...
sh: /opt/wz_mini/log: out of range
sh: /opt/wz_mini/log/wz_init.log: out of range
sh: /opt/wz_mini/log/daemon.log: out of range
sh: /opt/wz_mini/log/v4l2rtspserver.log: out of range
sh: /opt/wz_mini/log/go2rtc.log: out of range
sh: /opt/wz_mini/log/dmesg.log: out of range

This is happening the same way for multiple cameras. One camera I have up in place and because I have 2 reboots on it, it no longer responds to ping on the network. So I have to take that down and get it reconfigured for network again.

gtxaspec commented 9 months ago

do you have self hosted mode enabled on all of the cameras you are having issues on?

biggt commented 9 months ago

Yes. This is the exact config file I am using for all of my cameras.

#wz_mini configuration

#### W E B CAMERA###
##THIS MODE DISABLES EVERYTHING AND IT WILL
## WORK AS A WEB CAMERA FOR YOUR PC ***ONLY***
WEB_CAM_ENABLE="false"
WEB_CAM_BIT_RATE="8000"
WEB_CAM_FPS_RATE="25"

#####NETWORKING#####
CUSTOM_HOSTNAME="WCV3"

ENABLE_USB_ETH="false"
ENABLE_USB_ETH_MODULE_AUTODETECT="true"
ENABLE_USB_ETH_MODULE_MANUAL=""
USB_ETH_MAC_ADDR=""

ENABLE_USB_DIRECT="false"
USB_DIRECT_MAC_ADDR="02:01:02:03:04:08"

ENABLE_USB_RNDIS="false"

ENABLE_IPV6="false"

ENABLE_WIREGUARD="false"
WIREGUARD_IPV4=""
WIREGUARD_PEER_ENDPOINT=""
WIREGUARD_PEER_PUBLIC_KEY=""
WIREGUARD_PEER_ALLOWED_IPS=""
WIREGUARD_PEER_KEEP_ALIVE=""

ENABLE_IPTABLES="false"

ENABLE_NFSv4="true"

ENABLE_RTL8189FS_DRIVER="true"
ENABLE_ATBM603X_DRIVER="true"

NTP_SERVER=""

##### NETWORK INTERFACE BONDING #####
BONDING_ENABLED="false"
BONDING_PRIMARY_INTERFACE="eth0"
BONDING_SECONDARY_INTERFACE="wlan0"
BONDING_LINK_MONITORING_FREQ_MS="100"
BONDING_DOWN_DELAY_MS="5000"
BONDING_UP_DELAY_MS="5000"
BONDING_FAIL_OVER_MAC="0"

#####ACCESSORIES#####
REMOTE_SPOTLIGHT="false"

####MOTOR OPTIONS####
MOTOR_DISABLE="false"
MOTOR_DEFAULT_X=""
MOTOR_DEFAULT_Y=""

#####VIDEO STREAM#####
RTSP_LOGIN="admin"
RTSP_PASSWORD="[REDACTED]"
RTSP_PORT="8554"

RTSP_HI_RES_ENABLED="true"
RTSP_HI_RES_ENABLE_AUDIO="true"

RTSP_LOW_RES_ENABLED="true"
RTSP_LOW_RES_ENABLE_AUDIO="false"

RTSP_AUTH_DISABLE="false"

VIDEO_0_MAX_BITRATE="2048"
VIDEO_0_TARGET_BITRATE="2048"
VIDEO_0_ENC_PARAMETER="2"
VIDEO_0_FPS="30"

VIDEO_1_MAX_BITRATE="1024"
VIDEO_1_TARGET_BITRATE="1024"
VIDEO_1_ENC_PARAMETER="2"
VIDEO_1_FPS="15"

GO2RTC_SERVER_ENABLED="true"
GO2RTC_HI_RES_ENABLED="true"
GO2RTC_HI_RES_ENABLE_AUDIO="true"
GO2RTC_LOW_RES_ENABLED="true"
GO2RTC_LOW_RES_ENABLE_AUDIO="false"

#####RTMP STREAMING#####
#### REQUIRES RTSP ####
### AND RTSP AUDIO ###
RTMP_STREAM_ENABLED="false"
RTMP_STREAM_FEED="video1_unicast"
RTMP_STREAM_SERVICE="youtube"
RTMP_STREAM_DISABLE_AUDIO="false"
RTMP_STREAM_YOUTUBE_KEY=""
RTMP_STREAM_TWITCH_KEY=""
RTMP_STREAM_FACEBOOK_KEY=""

#####GENERAL#####
LIBCALLBACK_ENABLE="true"
ENABLE_SWAP="true"
ENABLE_USB_STORAGE="true"
ENABLE_EXT4="true"
ENABLE_CIFS="true"
DISABLE_FW_UPGRADE="true"
AUDIO_PROMPT_VOLUME="50"
ENABLE_MP4_WRITE="true"
NIGHT_DROP_DISABLE="true"
ENABLE_FSCK_ON_BOOT="true"
ENABLE_CAR_DRIVER="false"
ENABLE_LOCAL_DNS="true"
ENABLE_CRONTAB="true"
ENABLE_SELFHOSTED_MODE="true"

#####DEBUG#####
#drops you to a shell via serial, doesn't load app_init.sh
DEBUG_ENABLED="false"
DEBUG_INITRAMFS_ENABLED="false"
DEBUG_PASSWORD="false"
ENABLE_SYSLOG_SAVE="false"

####WEB####
WEB_SERVER_ENABLED="true"
WEB_SERVER_AUTH="true"
WEB_SERVER_LOGIN="admin"
WEB_SERVER_PASSWORD="[REDACTED]"

#####SCRIPTING#####
CUSTOM_SCRIPT_PATH=""
johnvprcam24573455623 commented 9 months ago

This is my config with the same issue:

`

wz_mini configuration

WEB_CAM_ENABLE="false" WEB_CAM_BIT_RATE="8000" WEB_CAM_FPS_RATE="25"

NETWORKING

CUSTOM_HOSTNAME="WCV3"

ENABLE_USB_ETH="false" ENABLE_USB_ETH_MODULE_AUTODETECT="true" ENABLE_USB_ETH_MODULE_MANUAL=""

ENABLE_USB_DIRECT="false" USB_DIRECT_MAC_ADDR="02:01:02:03:04:08"

ENABLE_USB_RNDIS="false"

ENABLE_IPV6="false"

ENABLE_WIREGUARD="false" WIREGUARD_IPV4="" WIREGUARD_PEER_ENDPOINT="" WIREGUARD_PEER_PUBLIC_KEY="" WIREGUARD_PEER_ALLOWED_IPS="" WIREGUARD_PEER_KEEP_ALIVE=""

ENABLE_IPTABLES="false"

ENABLE_NFSv4="false"

ENABLE_RTL8189FS_DRIVER="true" ENABLE_ATBM603X_DRIVER="true"

NTP_SERVER=""

NETWORK INTERFACE BONDING

BONDING_ENABLED="false" BONDING_PRIMARY_INTERFACE="eth0" BONDING_SECONDARY_INTERFACE="wlan0" BONDING_LINK_MONITORING_FREQ_MS="100" BONDING_DOWN_DELAY_MS="5000" BONDING_UP_DELAY_MS="5000" BONDING_FAIL_OVER_MAC="0"

ACCESSORIES

REMOTE_SPOTLIGHT="false" REMOTE_SPOTLIGHT_HOST="0.0.0.0"

VIDEO STREAM

RTSP_LOGIN="YYYY" RTSP_PASSWORD="XXXXXX" RTSP_PORT="8554"

RTSP_HI_RES_ENABLED="false" RTSP_HI_RES_ENABLE_AUDIO="false"

RTSP_LOW_RES_ENABLED="false" RTSP_LOW_RES_ENABLE_AUDIO="false"

RTSP_AUTH_DISABLE="false"

VIDEO_0_MAX_BITRATE="" VIDEO_0_TARGET_BITRATE="" VIDEO_0_ENC_PARAMETER="" VIDEO_0_FPS=""

VIDEO_1_MAX_BITRATE="" VIDEO_1_TARGET_BITRATE="" VIDEO_1_ENC_PARAMETER="" VIDEO_1_FPS=""

GO2RTC_SERVER_ENABLED="true" GO2RTC_HI_RES_ENABLED="true" GO2RTC_HI_RES_ENABLE_AUDIO="true" GO2RTC_LOW_RES_ENABLED="true" GO2RTC_LOW_RES_ENABLE_AUDIO="true"

RTMP STREAMING

REQUIRES RTSP

AND RTSP AUDIO

RTMP_STREAM_ENABLED="false" RTMP_STREAM_FEED="video1_unicast" RTMP_STREAM_SERVICE="youtube" RTMP_STREAM_DISABLE_AUDIO="false" RTMP_STREAM_YOUTUBE_KEY="" RTMP_STREAM_TWITCH_KEY="" RTMP_STREAM_FACEBOOK_KEY=""

GENERAL

LIBCALLBACK_ENABLE="true" ENABLE_SWAP="true" ENABLE_USB_STORAGE="false" ENABLE_EXT4="false" ENABLE_CIFS="false" DISABLE_FW_UPGRADE="true" AUDIO_PROMPT_VOLUME="50" ENABLE_MP4_WRITE="false" NIGHT_DROP_DISABLE="false" DISABLE_MOTOR="false" ENABLE_FSCK_ON_BOOT="false" ENABLE_CAR_DRIVER="false" ENABLE_LOCAL_DNS="false" ENABLE_CRONTAB="false" ENABLE_SELFHOSTED_MODE="false"

DEBUG

drops you to a shell via serial, doesn't load app_init.sh

DEBUG_ENABLED="false" DEBUG_INITRAMFS_ENABLED="false" DEBUG_PASSWORD="false" ENABLE_SYSLOG_SAVE="false"

WEB

WEB_SERVER_ENABLED="true" WEB_SERVER_AUTH="true" WEB_SERVER_LOGIN="admin" WEB_SERVER_PASSWORD="XXXXXXX"

SCRIPTING

CUSTOM_SCRIPT_PATH="" `

gtxaspec commented 9 months ago

@kohrar any ideas on this? I don't personally use the self hosted mode.

kohrar commented 9 months ago

That's interesting. I've been using my cameras in self hosted mode without them ever connecting to the internet and through many unexpected power cycles. The only reason the startup script gets triggered is if the WiFi configs aren't available under /configs.

After reviewing @johnvprcam24573455623's logs, I think I might have a hunch on what's going wrong.

The config file under /configs/.user_config is read by iCamera on start up. I recall the iCamera process will reset the WiFi settings if bindOk isn't set to 1. My startup script will try to set this to 1, but only if that line already exists. For a new camera that has no connection to the outside, this might not be happening.

From the logs, this bindOk value isn't set at all as it should have been printed out at this line on the script https://github.com/gtxaspec/wz_mini_hacks/blob/4719cb563448a7a1e9b6f65ce42f7c99f12de6c2/SD_ROOT/wz_mini/etc/init.d/S20initsetup#L52

@johnvprcam24573455623, do you have SSH access to the camera? If you do, could you check if /configs/.user_config contains these lines? If they don't, could you add it in and try rebooting the camera?

[NET]
bindOk=1
p2pid=
r_encr=
johnvprcam24573455623 commented 9 months ago

@kohrar This is my /configs/.user_config It looks like it has the 3 lines

[NET]
bindOk=1
p2pid=1TXXXXXXXXXXXX111A
r_encr=MAtXXXXXXXXXXNX

[SETTING]
bitRate=120
timezone=-7

[CAMERA_INFO]
TZ_STR=PST+0800PDT+0700,M3.2.0/02:00:00,M11.1.0/02:00:00 
kohrar commented 9 months ago

That looks good.

Can you see whether /configs has the wifi settings saved? There should be a .wifipasswd and .wifissid with your WiFi SSID/password there. If they're all there, does a reboot somehow still cause the camera to come up without its WiFi settings?

johnvprcam24573455623 commented 9 months ago

Now it is working when I reboot, I have 8 cameras however 6 of them went in pairing mode while I was in vacation, one by one.

there is only one line in my .wifipasswd

yXXXXXXXXXXDL

and one line in .wifissid

rYYYYYYYYY2
kohrar commented 9 months ago

I reviewed your logs again and noticed this:

#####S20initsetup#####
grep: /configs/.user_config: No such file or directory

That would suggest that file wasn't there at startup which would explain why it would go into the 'wifi pairing' mode.

A couple things to try for the remaining cameras that you have issues with:

  1. When they go into the 'wifi pairing' mode, can you scan the QR code containing your wifi configs and see if it comes back online? If it comes online, can you try rebooting (by disconnecting the power) and see if it goes back into the 'wifi pairing' mode again? (It shouldn't since the .user_config file should be created when the QR code is scanned)

  2. Alternatively, could you check if /configs/.user_config on the other 6 cameras exist and have the bindOk line set? Once you're sure they exist, try rebooting (by disconnecting the power again) and see if it comes back up.

If the .user_config file disappears, then there's something wonky with the internal flash that's causing the file to disappear when power's abruptly lost. Perhaps a corrupt MTD filesystem? If this is the case, you could try reflashing the camera again and see if the issue goes away.

That's the only thing I can think of right now which could cause the behavior that you're seeing.

biggt commented 9 months ago

I reviewed your logs again and noticed this:

#####S20initsetup#####
grep: /configs/.user_config: No such file or directory

That would suggest that file wasn't there at startup which would explain why it would go into the 'wifi pairing' mode.

A couple things to try for the remaining cameras that you have issues with:

1. When they go into the 'wifi pairing' mode, can you scan the QR code containing your wifi configs and see if it comes back online? If it comes online, can you try rebooting (by disconnecting the power) and see if it goes back into the 'wifi pairing' mode again? (It shouldn't since the .user_config file should be created when the QR code is scanned)

2. Alternatively, could you check if /configs/.user_config on the other 6 cameras exist and have the bindOk line set? Once you're sure they exist, try rebooting (by disconnecting the power again) and see if it comes back up.

If the .user_config file disappears, then there's something wonky with the internal flash that's causing the file to disappear when power's abruptly lost. Perhaps a corrupt MTD filesystem? If this is the case, you could try reflashing the camera again and see if the issue goes away.

That's the only thing I can think of right now which could cause the behavior that you're seeing.

When I checked whether the .user_configs and .wifipasswd and .wifissid were present, they were not. Hence the error message in my logs. I manually created these with my info ... the camera did not reconnect to the network. I attempted to re-scan a QR code and it announces that it connected to the network, yet, I can see that in a constant ping test, the camera does not come up and even on my WiFi access points management console the MAC address is not populated, thus it's not actually trying to connect. Restarting the camera does not help in this case. While after it claimed that it connected to the network and then I restarted the camera, it did not go back into pairing mode... it's very clearly not on the network.

biggt commented 9 months ago

I reviewed your logs again and noticed this:

#####S20initsetup#####
grep: /configs/.user_config: No such file or directory

That would suggest that file wasn't there at startup which would explain why it would go into the 'wifi pairing' mode. A couple things to try for the remaining cameras that you have issues with:

1. When they go into the 'wifi pairing' mode, can you scan the QR code containing your wifi configs and see if it comes back online? If it comes online, can you try rebooting (by disconnecting the power) and see if it goes back into the 'wifi pairing' mode again? (It shouldn't since the .user_config file should be created when the QR code is scanned)

2. Alternatively, could you check if /configs/.user_config on the other 6 cameras exist and have the bindOk line set? Once you're sure they exist, try rebooting (by disconnecting the power again) and see if it comes back up.

If the .user_config file disappears, then there's something wonky with the internal flash that's causing the file to disappear when power's abruptly lost. Perhaps a corrupt MTD filesystem? If this is the case, you could try reflashing the camera again and see if the issue goes away. That's the only thing I can think of right now which could cause the behavior that you're seeing.

When I checked whether the .user_configs and .wifipasswd and .wifissid were present, they were not. Hence the error message in my logs. I manually created these with my info ... the camera did not reconnect to the network. I attempted to re-scan a QR code and it announces that it connected to the network, yet, I can see that in a constant ping test, the camera does not come up and even on my WiFi access points management console the MAC address is not populated, thus it's not actually trying to connect. Restarting the camera does not help in this case. While after it claimed that it connected to the network and then I restarted the camera, it did not go back into pairing mode... it's very clearly not on the network.

Funny thing is that after this, the camera is just constantly sitting there flashing blue light and still unavailable on the network.

kohrar commented 9 months ago

I manually created these with my info ... the camera did not reconnect to the network.

How did you manually create this if it wasn't connected to the network?

I attempted to re-scan a QR code and it announces that it connected to the network, yet, I can see that in a constant ping test, the camera does not come up and even on my WiFi access points management console the MAC address is not populated, thus it's not actually trying to connect.

Could you try these steps in this exact order:

  1. Press the setup button. When you hear it say "ready to connect", the camera will be in the setup mode and its WiFi settings will have been erased. If you don't hear "ready to connect", then power cycle it first before trying again.
  2. Power-cycle (disconnect / reapply power) the camera. It should now come up without a connection. Press the setup button again. It should say "ready to connect".
  3. Scan the QR code with the new WiFi settings. It should say "wifi connected" and connect to your network. At this point, you should be able to ping the camera.

If that is still not working, repeat the steps above without the SD card containing wz_mini_hacks and see if the behavior is any different.

Also -- try to make a new QR code using https://codepen.io/ril3y/full/gXyzmO/ just to rule out that you didn't accidentally put in the wrong credentials in your QR code.

Funny thing is that after this, the camera is just constantly sitting there flashing blue light and still unavailable on the network.

This may be an issue with the current self hosted mode. This may be an issue with the script where it terminates after finding WiFi credentials rather than looping forever and wasting resources. I can replicate this with these steps:

  1. power cycle
  2. press the setup button
  3. scan QR code, (it connect and is pingable; I assume scanning a QR code with bad WiFi settings would also trigger this behavior)
  4. press the setup button again (which wipes its connection settings and is no longer pingable. It does not say "ready to connect" on this button press either)
  5. The camera enters this failure state. LED is blinking, setup button is unresponsive, and is no longer pingable.

I can recover from this state by power cycling, pressing the setup button once, and scanning the QR code, however.

biggt commented 9 months ago

I manually created these with my info ... the camera did not reconnect to the network.

How did you manually create this if it wasn't connected to the network?

I unplugged the camera, mounted the sd card on another computer and created the files

I attempted to re-scan a QR code and it announces that it connected to the network, yet, I can see that in a constant ping test, the camera does not come up and even on my WiFi access points management console the MAC address is not populated, thus it's not actually trying to connect.

Could you try these steps in this exact order:

1. Press the setup button. When you hear it say "ready to connect", the camera will be in the setup mode and its WiFi settings will have been erased. If you don't hear "ready to connect", then power cycle it first before trying again.

2. Power-cycle (disconnect / reapply power) the camera. It should now come up without a connection. Press the setup button again. It should say "ready to connect".

3. Scan the QR code with the new WiFi settings. It should say "wifi connected" and connect to your network. At this point, you should be able to ping the camera.

It scans the QR code (hear the ding) and then just sits there for like 2 minutes trying to connect. It never connects, nothing shows on ping.

If that is still not working, repeat the steps above without the SD card containing wz_mini_hacks and see if the behavior is any different.

I took out the SD card with wz_mini_hacks, rescanned the QR code and it scans it, and shortly thereafter I see that it connects to the network (responds to ping) for like 15 seconds, then says it couldn't connect to the network, disconnects (stops being ping-able).

Also -- try to make a new QR code using https://codepen.io/ril3y/full/gXyzmO/ just to rule out that you didn't accidentally put in the wrong credentials in your QR code.

  • put in my credentials to this qr code generator (without wz_mini_hacks card) and same as above where it temporarily connects, then says that connection timed out, and disconnects. (I'm assuming it's looking for the Wyze connection, but even when scanning the QR code the wyze app generates doesn't allow the camera to connect properly.
  • put in the wz_mini_hacks card and rescanned using this qr code generator (haven't touched the page since the above test) ... it scans the code, shortly thereafter says wifi connected, and then interrupts itself trying to say it can't connect... and does not respond through all of this.
  • after this second test, i power cycled, pressed setup, scanned qr code (again haven't touched the webpage) and it sits there and doesn't do anything.

Funny thing is that after this, the camera is just constantly sitting there flashing blue light and still unavailable on the network.

This may be an issue with the current self hosted mode. This may be an issue with the script where it terminates after finding WiFi credentials rather than looping forever and wasting resources. I can replicate this with these steps:

1. power cycle

2. press the setup button

3. scan QR code, (it connect and is pingable; I assume scanning a QR code with bad WiFi settings would also trigger this behavior)

4. press the setup button again (which wipes its connection settings and is no longer pingable. It does not say "ready to connect" on this button press either)

5. The camera enters this failure state. LED is blinking, setup button is unresponsive, and is no longer pingable.

I can recover from this state by power cycling, pressing the setup button once, and scanning the QR code, however.

while it was sitting there doing nothing from last test above, I pressed setup button, says ready to connect but is unable to scan the qr code. it doesn't ding, doesn't say anything. I repeated this 3 times and it will not scan qr code again.

Habile2019 commented 9 months ago

Just to say I see this very behaviour. Seemingly randomly the entire /configs/* content 'disappears'. I can tell when this has occurred as the timezone is lost and the timestamp shows UTC on the camera image.

When this happens I usually ssh in and copy the configs from /opt/wyze_config_backup/configs/ to /configs, otherwise I know on reboot it will need to be paired again using the app.

I'll keep trying to debug what wipes out /configs.

awdark commented 8 months ago

That's an interesting thing to notice with the time zone. I can confirm my camera was in UTC and the folder was basically empty,

day1118 commented 8 months ago

I have also had this happen a few times (/configs is empty after a reboot) Is there any useful information that I can collect afterwards to assist with debugging? Most recently was after making some edits and clicking reboot in the cgi-bin/config.cgi page.

johnvpr commented 8 months ago

it just happened again to me this is the log:

`+ echo 'welcome to wz_mini initramfs' welcome to wz_mini initramfs

stncttr908 commented 7 months ago

Also having this problem with several cameras. The time zone resetting is a giveaway, so I try to copy the config out of /opt/wyze_config_backups over to /configs, which fixes it up for a while, but then it seems like /configs gets blasted seemingly at random. I might have to put a cron entry in just to keep refreshing that directory. This sometimes seems to prevent the need to re-pair the camera with the Wyze app, sometimes not.

vic4news commented 7 months ago

I am experiencing this problem as well. Most of the files in /configs disappear randomly. It is easy to tell if this has happened because the time displayed on the camera is wrong. If the camera loses power or is rebooted when the /configs files are missing then the camera will enter pairing mode. Copying the files from the backup always fixes the issue for me as long as the camera wasn’t restarted when the files were missing.

kzaoaai commented 7 months ago

I noticed that the files disappear from /configs/ when I access the webserver page at cgi-bin/config.cgi

They will disappear the second I access it, without any settings modifications.

Also, I'm using command cp -rT /opt/wyze_config_backup/configs /configs to copy back, as the suggested one was skipping hidden files.

gtxaspec commented 7 months ago

@virmaior checkout @kzaoaai's comment above, I don't have access to a wz_mini setup at the moment for testing.

virmaior commented 7 months ago

@kzaoaai That's really bad behavior. I'll try to figure this out.

can you tell me

  1. what version wz_mini you'er running?
  2. whether you're using the cam in wifi mode or over ethernet or usb?
Habile2019 commented 7 months ago

@kzaoaai That's really bad behavior. I'll try to figure this out.

can you tell me

  1. what version wz_mini you'er running?
  2. whether you're using the cam in wifi mode or over ethernet or usb?

If it helps, as I also see this behaviour, here's my version:

I'm wondering if /configs is getting unmounted somehow.

kzaoaai commented 7 months ago

@virmaior

  1. Latest, Nov 20 build
  2. Built-in WIFI
virmaior commented 7 months ago

@Habile2019

I experience periodic /configs clobbering on some but not all of my cameras -- even over spans of time where I don't use /cgi-bin/config.cgi

I'll try to look through the code but won't be at a place where I can for about 12 hours.

My current hypothesis is that the cameras can get overloaded in a way that somehow causes this, because those cameras are using the longest micro-usb cables.

If @kzaoaai 's cameras get this every single time that /cgi-bin/config.cgi is accessed that actually makes this easier to debug as I can only sporadically create this my self. Does it still clobber if you change line 16 of /cgi-bin/config.cgi to exit?

#!/bin/sh
# This serves a rudimentary webpage based on wz_mini.conf
. /opt/wz_mini/www/cgi-bin/shared.cgi

test_area_access config
title="$camver on $camfirmware running wz_mini $hackver as $HOSTNAME"
updated=false

echo "HTTP/1.1 200"
echo -e "Content-type: text/html\n\n"
echo ""

exit

? if so that basically isolates the problem to /wz_mini/www/cgi-bin/shared.cgi

also, does it crash if you use jpeg.cgi ?

vic4news commented 7 months ago

Current version: T31(WYZE_CAKP2JFUS) on 4.36.9.139 running wz_mini Sun Oct 15 12:16:27 AM PDT 2023 But was occurring on earlier versions of wz_mini as well.

Using WiFi

Habile2019 commented 7 months ago

My current hypothesis is that the cameras can get overloaded in a way that somehow causes this, because those cameras are using the longest micro-usb cables.

Thanks. I'll try to pay attention to dmesg and uptime etc. when it occurs again. My events are also usually independent from /cgi-bin/config.cgi, and to be honest haven't done it in a while. Possibly helped by turning off event recording, not sure.

kzaoaai commented 7 months ago

so I inadvertently cleared cache from Safari by quitting and re-opening, and was presented with the screen saying something like "WEBSERVER Options missing, use WEB_SERVER_OPTIONS="cam config car jpeg multicam diag status...".

I added this line to the conf file, and now the issue is not happening everytime I access the config.cgi page.

My current hypothesis is that the cameras can get overloaded in a way that somehow causes this,

However, leaving this page open in the foreground does definitely cause the config files to disappear more often. Maybe having the page open adds stress causing this.

virmaior commented 7 months ago

@kzaoaai leaving the page open the only additional strain is the jpeg.cgi image refreshing (nothing else on the page connects to the server after initial load until you submit something).

kzaoaai commented 7 months ago

it makes sense that jpeg.cgi is the reason. I misdiagnosed the issue since it happend on the config page, but the underlying reason seems to be the same. Also, when I was experiencing this earlier, the thumbnail was intermittently failing and showing the error question mark in place of the thumbnail.

virmaior commented 7 months ago

some further progress on this.

for cameras that are still using v4l2rtspserver

echo jpeg | /usr/bin/nc localhost 4000 (https://github.com/mnakada/atomcam_tools/blob/4568a2c5a7a6f0cf9155a627031ec906034e60ba/overlay_rootfs/var/www/cgi-bin/get_jpeg.cgi#L2) runs significantly faster that cmd jpeg

would like to figure if go2rtc has a similar fast image capture to jpeg.

gtxaspec commented 7 months ago

in go2rtc you can use api/frame.jpeg?src=<camera_name>

stncttr908 commented 7 months ago

in go2rtc you can use api/frame.jpeg?src=<camera_name>

As far as I can tell from the docs and source that's only for MJPEG streams

gtxaspec commented 7 months ago

it works for normal streams as well.

stncttr908 commented 7 months ago

it works for normal streams as well.

Thanks, I must be doing something wrong, because it returns

exit status 1

When I call http://[camera hostname]:1984/api/frame.jpeg?src=1080p (I assume that's the stream name here)

gtxaspec commented 7 months ago

@stncttr908 are you using the latest versions?

stncttr908 commented 7 months ago

@stncttr908 are you using the latest versions?

Crap, nope, a commit or two behind. Will try and update this comment. 👍

EDIT Still no luck, same return code. I can do frame.mp4?src= but that just gives me a blank result

virmaior commented 7 months ago

same here...

virmaior commented 7 months ago

@gtxaspec is https://github.com/gtxaspec/wz_mini_hacks/issues/10 FiveLeavesLeft's code implemented?

I've been looking to figure out how jpeg files are created by cmd jpeg to see if there's an issue and I just noticed that FiveLeavesLeft states his code writes to /config because its rw ... and well /config is getting clobbered if you the jpeg code is called too frequently.

I haven't used C since about 2002 but if I'm grasping the code correctly (https://github.com/mnakada/atomcam_tools/blob/4568a2c5a7a6f0cf9155a627031ec906034e60ba/custompackages/package/ingenic_samples/include/imp/imp_encoder.h#L656 , https://github.com/mnakada/atomcam_tools/blob/4568a2c5a7a6f0cf9155a627031ec906034e60ba/libcallback/jpeg.c )

the centerpiece is ret = IMP_Encoder_GetStream(ENC_JPEG_CHANNEL, &stream, 1); where &stream is being passed such that the data gets put in there, ENC_JPEG_CHANNEL is presumably a constant and then the result is getting written somewhere.

Habile2019 commented 7 months ago

the centerpiece is ret = IMP_Encoder_GetStream(ENC_JPEG_CHANNEL, &stream, 1); where &stream is being passed such that the data gets put in there, ENC_JPEG_CHANNEL is presumably a constant and then the result is getting written somewhere.

Interesting. I can only add that I do believe the issue only occurs after accessing the web interface where the snapshot appears, so it's a good candidate!

I also know it's a lot easier to break stuff unintentionally in C than it is in bash!

gtxaspec commented 7 months ago

This is how we capture jpeg: https://github.com/gtxaspec/libcallback/blob/master/jpeg.c we don't do anything with /config at all, it's all done in memory. Even if we were to hammer the endpoint for jpeg images, I don't think this has anything to do with the configs issue though. Remember, cmd returns the jpeg through the console's stdout. It's never written anywhere.

amandamana commented 5 months ago

I experienced /configs/ getting repeated wiped on a couple v3s. I can't reliably reproduce it but am sure it's related to the webserver. There may be some state that it gets into, perhaps after editing the wz_mini.conf or issuing the reboot command, or perhaps related to some LAN "flood" traffic or browser requests from open pages. In one case, after one v3 started clobbering /configs/, it seems to trigger the issue on another camera. I've disabled the web servers for now. I'll update this comment if it happens with them off or if I find time to figure out how to trigger the wipe using the web server.

virmaior commented 5 months ago

I experienced /configs/ getting repeated wiped on a couple v3s. I can't reliably reproduce it but am sure it's related to the webserver.

There may be some state that it gets into, perhaps after editing the wz_mini.conf or issuing the reboot command, or perhaps related to some LAN "flood" traffic or browser requests from open pages.

I don't think it's related to the reboot command or the editing of the config at this point. In part, because I've seen the behavior and don't edit the config and one contributor pointed out that they get this problem when they leave the page open. This led to my previous hypothesis that jpeg.cgi and some issue in the screenshot render was causing it, but after adding in some debug code, it seems like the clobber happens outside of production of the jpeg.

My current working theory is that when the busybox httpd server gets overloaded something is wiping /configs, but I don't know why that would be the case Or alternately the TCP/IP stack has some sort of issue.

Other possibility is that the (b)ash code I wrote for the web page is clobbering it but nothing in that code touches /configs leaving me lost as to how it would clobber it.

In one case, after one v3 started clobbering /configs/, it seems to trigger the issue on another camera.

This is an intriguing claim. It's hard to think how this would happen.

I've disabled the web servers for now. I'll update this comment if it happens with them off or if I find time to figure out how to trigger the wipe using the web server.