Closed ghost closed 4 months ago
If you open the internet access (just for this test) does the cam work? If you don't call a snapshot but you read rtsp stream does the cam work?
I'm unable to allow internet access on my network right now but I have been using a hacky solution.
So it doesn't matter if I view the rtsp or snapshot, both fail in less than 10 minutes. When I manually restart the avencode it will stay up for a few hours, maybe 4 maybe 8 or so, but it will go down again.
My hacky solution is to create this file:
/mnt/mmc/sonoff-hack/script/restart_avencode.sh
#!/bin/ash
is_running=$(ps | grep '/mnt/mtd/ipc/app/a[v]encode' | awk '{print $1}');
echo $is_running;
if [ -z $is_running ]; then
/mnt/mtd/ipc/app/avencode
fi
After creating this file I add a crontab input in the web ui.
* * * * * /mnt/mmc/sonoff-hack/script/restart_avencode.sh
Sure it could take up to a minute to restart the service, but realistically the service only stays down a max of 2 or 3 minutes a day now which is great for me.
I wanted to use /etc/inittab
to auto restart the service there, but it seems I can't change the inittab functionality after boot.
I will add a watchdog to control avencode like in the yi cams.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The device is connected via ethernet, but I've fully blocked it from accessing the WAN through my router. I've disabled cloud access and set the ntp server to my router. Swap File is enabled.
After a few minutes (<10) of being turned on, the RSTP streams and the snapshot become unresponsive. I would watch them function normally on VLC and then lose connection and not be able to reconnect until I reboot the device.
I don't know how different this is from yi-hack-Allwinner but they seem to have a problem viewing RTSP when the internet is blocked.
I'm not sure how to debug or where logs are located but I can upload them if someone tells me where they are.
Thanks
Edit: After the failure I found that running "/mnt/mtd/ipc/app/avencode" again will bring the stream back up and it will stay back up indefinitely(so far). So if nobody can fix crash issue, could someone help me make a script to automatically restart avencode when it fails? I'm not used the the process management system under busybox.