yi-hack-v5 icon indicating copy to clipboard operation
yi-hack-v5 copied to clipboard

47US getting boot loop after sometime.

Open phuonglm opened this issue 2 years ago • 11 comments

After 1 or 2 days of use I reboot/ cut power/ WIFI AP restart then 47US camera got boot loop ( blue yelow bink - long yellow - led off - then reboot again. Inspect log.txt in log_no_wifi_dev.tar.gz I got this.

system call back libsns_ov9732.so_____________________
[./rmm][1/1/0:0:25:858]: sns_call_backsns_call_back
[./rmm][1/1/0:0:25:860]: HI_MPI_ISP_3A SUCCESS
[./rmm][1/1/0:0:26:131]: 
_____Gamma test for table 4__________
[./rmm][1/1/0:0:26:150]: 
---------Rock_COMM_VENC_BindVpss VeChn = 0, VpssGrp = 0, VpssChn = 0
[./rmm][1/1/0:0:26:156]: rc set success! venc(0)
[./rmm][1/1/0:0:26:159]: 
---------Rock_COMM_VENC_BindVpss VeChn = 1, VpssGrp = 0, VpssChn = 1
[./rmm][1/1/0:0:26:165]: rc set success! venc(1)
[./rmm][1/1/0:0:26:167]: rmm_init success[./rmm][1/1/0:0:26:169]: font:/home/base/iso8859-1-16x32.bin
[./rmm][1/1/0:0:26:170]: filesize=16384
[./rmm][1/1/0:0:26:183]: init font /home/base/iso8859-1-16x32.bin ptr size(4)[./rmm][1/1/0:0:26:184]: font:/home/base/iso8859-1-8x16.bin
[./rmm][1/1/0:0:26:186]: filesize=4096
[./rmm][1/1/0:0:26:188]: init font /home/base/iso8859-1-8x16.bin ptr size(4)[./rmm][1/1/0:0:26:190]: load_font success[./rmm][1/1/0:0:26:191]: msg_proc success[./rmm][1/1/0:0:26:192]: zbar_proc success[./rmm][1/1/0:0:26:196]: pid[928][./rmm][1/1/0:0:26:206]: pid[970][./rmm][1/1/0:0:26:207]: pid[973][./rmm][1/1/0:0:26:208]: pid[972][./rmm][1/1/0:0:26:209]: pid[974][./rmm][1/1/0:0:26:210]: pid[971][./rmm][1/1/0:0:26:213]: pid[975][./rmm][1/1/0:0:26:216]: rmm_vpp_create_bmp 1 success![./rmm][1/1/0:0:26:218]: rmm_vpp_create_bmp 0 success![./rmm][1/1/0:0:26:245]: AiGetLPCMStream start
 [./rmm][1/1/0:0:26:245]: pid[976][./rmm][1/1/0:0:26:265]: VencGetH264Stream vechn=1
 [./rmm][1/1/0:0:26:265]: VencGetH264Stream vechn=0
 [./rmm][1/1/0:0:26:464]: set ai volume via himm 0x201200d8 0x1e1ec001[./rmm][1/1/0:0:26:530]: set ai volume via himm 0x201200c8 0x23c2e[./rmm][1/1/0:0:26:633]: set ao volume via himm 0x201200d4 0x03122424[./dispatch][11/26/19:14:17:98]: DISPATCH_SET_DEFAULT_TIME 1637954057[./dispatch][11/26/19:14:23:700]: wpa may crashed, now reset
[./dispatch][11/26/19:14:23:850]: no usb dev

Since nodmesg log or serial connection I can find the root cause yet. But I guess maybe at that moment swap file is corrupted without working swapfile the next startup won't work because out of memory.

sometime dmesg give me this error although swapfile created.

init phy power successful!
load hi_mipi.ko ...OK!
Load hi_cipher.ko success.
[CPLD_PERIPH] Timer closed.
[CPLD_PERIPH] Timer opened.

[CPLD_PERIPH] led_blue_pwm_value = 100
Hisilicon Watchdog Timer: 0.01 initialized. default_margin=60 sec (nowayout= 0, nodeamon= 0)
WATCHDOG @Hi3518v200
WATCHDOG @Hi3518v200
[CPLD_PERIPH] Timer closed.
Unable to find swap-space signature

Now I'm testing with this to make sure corrupted swap still fine at boot . Will report back in next weekend.

if [[ $(get_config SWAP_FILE) == "yes" ]] || [[ $MODEL_SUFFIX == "yi_dome" ]] || [[ $MODEL_SUFFIX == "yi_home" ]] ; then
    SD_PRESENT=$(mount | grep mmc | grep -c ^)
    if [[ $SD_PRESENT -eq 1 ]]; then
        if [[ -f /tmp/sd/swapfile ]]; then
            chmod 600 /tmp/sd/swapfile
            mkswap /tmp/sd/swapfile
            swapon /tmp/sd/swapfile
        else
            dd if=/dev/zero of=/tmp/sd/swapfile bs=1M count=64
            chmod 0600 /tmp/sd/swapfile
            mkswap /tmp/sd/swapfile
            swapon /tmp/sd/swapfile
        fi
        sysctl -w vm.dirty_background_ratio=2
        sysctl -w vm.dirty_ratio=5
        sysctl -w vm.dirty_writeback_centisecs=100
        sysctl -w vm.dirty_expire_centisecs=500
        sysctl -w vm.vfs_cache_pressure=200
        sysctl -w vm.swappiness=30
        echo 5 > /proc/sys/vm/laptop_mode
        echo 30 > /proc/sys/vm/swappiness
    fi
fi

phuonglm avatar Nov 27 '21 12:11 phuonglm

It didn't work. After 1 or 2 days when some thing wrong happened ( power cut, reboot, Access point disconnect ) the camera reboot it self and not able to start again. Boot then restart after lens click. I tried remove sd card/ reset camera but still in boot loop. I guess something wrong saved to flash.

phuonglm avatar Dec 04 '21 19:12 phuonglm

I have the same problem. As sometimes the RTSP hangs up, i rebootet the camera. After that it didnt came back and went into the boot loop. Only a new flash (older firmware, newer firmware) brings it back to life. its 5 time, i got this with different cameras (but all 47us)

evilchen0815 avatar Dec 11 '21 18:12 evilchen0815

Got the serial connection to my 47US and here is the boot log when failed https://gist.github.com/phuonglm/6dc31f834156e1b1827419d4755120b3

ln: /etc/resolv.conf: No space left on device

I assume that some process write data to rootfs without clean up then make rootfs run out of space. I Tested this by created big file on rootfs then reboot then same problem happen.

Since free space left on rootfs pretty small so I will have to.

  • Find which process leave trash on rootfs and fix it.
  • If process is critical for me then I have to delete everything I don't need for on rootfs ( ie, ssh/ mqtt )....

phuonglm avatar Dec 12 '21 08:12 phuonglm

@evilchen0815 I found my problem and fixed that but your problem maybe different with me. I have a script that continuous login (via telnet) to camera every 5 mins to sync camera status with my smart home. /var/run/utmp is the file which save log about login status and get bigger after every login. And when it big enough wpa stop work because no space left.

995.5K  bin
4.0K    dev
49.0K   etc
12.7M   home
674.0K  lib
512     linuxrc
512     mnt
0       proc
0       root
11.0K   sbin
0       sys
35.0K   usr
10.5K   var
/var/run # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 1.3M      1.2M     88.0K  93% /
tmpfs                     9.1M      4.0K      9.1M   0% /dev
/dev/mtdblock5           12.7M      7.5M      5.2M  59% /home
tmpfs                    16.0M    728.0K     15.3M   4% /tmp
/dev/mmcblk0p1           28.9G     20.5G      8.4G  71% /tmp/sd
/dev/mmcblk0p1           28.9G     20.5G      8.4G  71% /tmp/sd/yi-hack-v5/www/record

Here is my du -sh /* after clean flash. You could try with your camera and see any different ( some directory may getting bigger than mind ) and find trash file in these.

Another file could potential make /home/ run out of space is /home/yi-hack-v5/.ash_history this file save command history when you login camera but /home have alot of free space so I don't think that would be problem soon. However run ln -s /dev/null /home/yi-hack-v5/.ash_history is recommend.

phuonglm avatar Dec 13 '21 19:12 phuonglm

@alienatedsec could we have /home/yi-hack-v5/.ash_history and /var/run/utmp symlink to /dev/null in next release?

phuonglm avatar Dec 18 '21 01:12 phuonglm

I've had node_exporter running on my camera for about a week. / is now stable with those two symlinks. Thanks!

sordfish avatar Dec 19 '21 12:12 sordfish

I too have the same issue but on the 48us. After about maybe a week or 2 of continuous use, the camera stops working continuous boot loop with or without sd card. I will sym link these 2 files and feedback. The only way to fix it to flash it again, which is annoying because it is mounted on the roof.

mfizz1 avatar Jan 29 '22 11:01 mfizz1

same problem on my side. added the two symlinks, but the used space is getting bigger. after a couple of weeks "/dev/root" expanded from 93% to now 96%. There seems to be another process, which "pollutes" the storage.

Any suggestions or a hint where a can take a look? Perhaps even a cronjob for deleting files? Some investigative hint for me, would be awesome :-)

Thx chrizza

chrizza87 avatar Apr 06 '22 22:04 chrizza87

same problem on my side. added the two symlinks, but the used space is getting bigger. after a couple of weeks "/dev/root" expanded from 93% to now 96%. There seems to be another process, which "pollutes" the storage.

Any suggestions or a hint where a can take a look? Perhaps even a cronjob for deleting files? Some investigative hint for me, would be awesome :-)

Thx chrizza

Mine after add symlink, free space still reduce after sometime but no more boot loop. When free space reach 99% and camera reboot it will reclaim free space. It seem related to garbage collector of JFFS2 https://en.wikipedia.org/wiki/JFFS2 .

phuonglm avatar Apr 07 '22 17:04 phuonglm

Thx for the hint. So if i would set up a cronjob to run once a month to reboot the camera, this will be the "solution"?

chrizza87 avatar Apr 14 '22 10:04 chrizza87

I reboot it weekly via cronjob

phuonglm avatar Apr 15 '22 02:04 phuonglm

Please upgrade to 0.3.6 to fix many other and similar issues

alienatedsec avatar Dec 05 '22 21:12 alienatedsec