openipcamera / openipc-firmware

OpenIPC Firmware for Wyze Cameras
https://openip.cam
894 stars 129 forks source link

WyzeCam V2 loses Connection to Blue Iris #51

Open ark-git opened 6 years ago

ark-git commented 6 years ago

I was successful in installing Alpha V2 image onto to my WyzeCam v2. I was able to connect to Blue Iris using RTSP. However after sometime it will lose connection and the only way to connect back to Blue Iris is to reboot. Could you provide steps to debug this issue.

hofmand commented 6 years ago

I'm having the same problem in Synology Surveillance Station. It works for a few days at a time (last time it was 63 hours) before I have to power cycle the camera.

Edit: It just lost connection again to my NAS (7 weeks 12 hours uptime). When I tried to connect to the camera's web server, it was very slow. But I was able to tell it to reboot, then my NAS was able to reconnect to it automatically.

MatthewNinety commented 6 years ago

A nice workaround would be to schedule a nightly reboot. For those of us who are already up and running, it would be good to just get something quick and dirty. I have been poking around, and this version of busybox doesn't seem to have support for crond or crontab. It does have a timer in the ping command. So 2 lines could be added to the /system/rc init script (I don't remember the name) to ping a non-existent ip address 50000 times (I believe it defaults to once per second) but to exit ping early with a -w 43000 So the lines would look like: ping 999.999 -c 50000 -w 43000 /sbin/reboot

MatthewNinety commented 6 years ago

Okay I wrote up a quick and dirty workaround. I found a sleep command. Also the /system/sdcard/config/autostart folder is writable, and it survives a reboot. So if you want to do this, ssh to the camera.

So create a file in /system/sdcard/config/autostart named zbooter make it executable cd /system/sdcard/config/autostart chmod +x zbooter add these 3 lines to it

!/bin/sh

sleep 86400 reboot

then just reboot. This is a quick and dirty hack so it will reboot every 86400 seconds It's just temporary until the authors determine why it stops responding after a day or 2.

Bboy486 commented 6 years ago

@MatthewNinety would a WeMo switch or a Wi-Fi switch do the same thing via Hardware that this script is doing?

MatthewNinety commented 6 years ago

Yes it would :)

neeksor commented 6 years ago

It would probably be easier on the SD card to just restart the rtsp server instead of rebooting the camera.. If you have video server log files you can provide from the cameras with the issue, that would help in determining what's causing it to stop serving..

mhtoto commented 6 years ago

Exact same problem with blue iris running the latest dafang hacks on a v2 wyzecam. Can log into the web console and reset camera which fixes the issue though I need a method while I am away from my local Lan.

ark-git commented 6 years ago

Using the "Xiaomi-Dafang-Hacks" from "EliasKotlyar", my blue Iris connection has been stable. I disabled "keep-alives" from Blue Iris configuration and enabled "-vv" in the RTSP-server config file.

mhtoto commented 6 years ago

thanks @ark-git for the advice. I've disable 'keep-alives' To add '-vv' in the RTSP-server config file, do I just add '-vv' to the rtspserver.conf.dist file and then rename to rtspserver.conf?

mhtoto commented 6 years ago

Here are the current contents of the rtspserver.conf.dist file: #######################################################################

Edit this file and move it to /system/sdcard/config/rtspserver.conf

if you need to add options, otherwise defaults will be used

#######################################################################

Configure RTSP Servers

Use /system/sdcard/bin/v4l2rtspserver-master -h to see available options

PORT=8554

H264 RTSP server options

Examples:

RTSPH264OPTS="-W960 -H540"

To enable authentication:

RTSPH264OPTS="-U user:password"

RTSPH264OPTS=""

MJPEG RTSP server options

Examples:

RTSPMJPEGOPTS="-W960 -H540"

To enable authentication:

RTSPMJPEGOPTS="-U user:password"

RTSPMJPEGOPTS=""

Video

BITRATE=5000

Framerate

FRAMERATE_DEN=1 FRAMERATE_NUM=25

AudioFormat

Can be: OPUS | MP3 | PCM | PCMU

AUDIOFORMAT=MP3

Audio sampling rate

AUDIOINBR=16000

Audio streaming sampling rate

AUDIOOUTBR=44100 HWVOLUME=70 SWVOLUME=-1 FILTER=4 HIGHPASSFILTER=ON AECFILTER=ON

Sorry I'm new to this... Looks like I can also decrease my bitrate and fps in this file...(save bandwidth and speed up my system?)

ark-git commented 6 years ago

@mhtoto I would first try and see if by disabling the keep-alives should fix the problem.