Closed bchiu2000 closed 4 years ago
I looked at the memory. its at 3% right now, but still working. So I am not really sure what causes the rtsp service to quit every few days. I am on the latest firmware.
My same problem How to set up to reboot every day Can only be rebooted to solve this problem
I am having the same problem. Latest firmware. Restarting RTSP doesn't fix it, it requires a full reboot.
I had the same issue before updating to the latest version too.
Anyone has a solution?
same issue in here, every couple hour stop working, need reboot it video configuration 1280x720, CBR, 700 bitrate, 10 frame/sec
This issue is probably related to log files, because for some reason, every time if you have open the main web page with your camera view, information about an every image is written to /tmp (the biggest log file for me was lighttpd-access.log) , each second. I have noticed that, if the folder /tmp reaches around 40 mb (for my case), rtsp server just crashes and i have to reboot my camera.
Issue is kind of explained here: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/877
with 2 major possibilities to fix it: -don't use web page view at all, -change your configuration file to save logs to /dev/null , as it was mentioned in the thread above.
I have experienced this same issue and would like a fix/scheduled restart functionality.
the same issue. Help stop and start RTSP
ps "RTCPInstance::RTCPInstance error: totSessionBW parameter should not be zero!"
For me, i deside to restart rtsp service and add script
/system/sdcard/controlscripts/rtsp-h264 stop sleep 3 /system/sdcard/controlscripts/rtsp-h264 start
How about a cronjob to delete the log files in /tmp every week?
How about a cronjob to delete the log files in /tmp every week?
system/sdcard/config/cron/pediodic/weekly
find /tmp/* -delete
@AMyskin Are you insinuating that this is already possible by placing scripts at the locations you are specifying?
@AMyskin Are you insinuating that this is already possible by placing scripts at the locations you are specifying?
For me, its work :)
Tue Aug 20 13:00:00 MSK 2019 script chechRTPS stop service Tue Aug 20 13:00:03 MSK 2019 script chechRTPS starts service Tue Aug 20 13:30:00 MSK 2019 script chechRTPS stop service Tue Aug 20 13:30:03 MSK 2019 script chechRTPS starts service Tue Aug 20 14:00:00 MSK 2019 script chechRTPS stop service Tue Aug 20 14:00:03 MSK 2019 script chechRTPS starts service Tue Aug 20 14:30:00 MSK 2019 script chechRTPS stop service Tue Aug 20 14:30:03 MSK 2019 script chechRTPS starts service
That sounds like it would do the trick, I will try it out! Thanks for the heads up!
For me, its work :)
EDIT: After about a week, the cameras seem much more stable, thank you for the suggestion @AMyskin!
Hostiss solution worked. My camera had been running for a month now.
Now that I just need to know how to make the video recording works again. Anyone able to record when motion detected?
For me, i deside to restart rtsp service and add script
!/bin/sh
/system/sdcard/controlscripts/rtsp-h264 stop sleep 3 /system/sdcard/controlscripts/rtsp-h264 start
Hiya,
Would you mind to share with me what commands do I need to add these crob jobs ? Woud love to add these lines because I´m having same problem. Thanks !!
Hostiss solution worked. My camera had been running for a month now.
Now that I just need to know how to make the video recording works again. Anyone able to record when motion detected?
If you don't mind using a 3rd party program, motioneye is pretty nice after you set it up! https://github.com/ccrisan/motioneye/wiki/Installation
For me, i deside to restart rtsp service and add script
!/bin/sh
/system/sdcard/controlscripts/rtsp-h264 stop sleep 3 /system/sdcard/controlscripts/rtsp-h264 start
Hiya,
Would you mind to share with me what commands do I need to add these crob jobs ? Woud love to add these lines because I´m having same problem. Thanks !!
After you login to the camera using SSH, you can just place the script that you quoted in the cron folder you wish and chmod +x the file.
e.x. Weekly cron folder '/system/sdcard/config/cron/pediodic/weekly'
and
chmod +x restartrtsp.sh
For me, i deside to restart rtsp service and add script
!/bin/sh
/system/sdcard/controlscripts/rtsp-h264 stop sleep 3 /system/sdcard/controlscripts/rtsp-h264 start
Hiya, Would you mind to share with me what commands do I need to add these crob jobs ? Woud love to add these lines because I´m having same problem. Thanks !!
After you login to the camera using SSH, you can just place the script that you quoted in the cron folder you wish and chmod +x the file.
e.x. Weekly cron folder '/system/sdcard/config/cron/pediodic/weekly'
andchmod +x restartrtsp.sh
Hi mate,
Still don´t get it I would need a newby step by step but I don´t want to bother you like this. Thanks anyway, very appreciated :)
And dont name it .sh there is a busy box bug that causes the script not to execute.
And dont name it .sh there is a busy box bug that causes the script not to execute.
Hi Mate My cron tasks saved under /system/sdcard/config/cron/pediodic/daily foler is not executing as I can see. I do not know how to the command to list it from the log
you mentioned not to name the file as name.sh so if I use a name such as daily.tx will it work or how should it be named?
Thanks
I would use any ending.
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.
system/sdcard/config/cron/pediodic/weekly
I would suggest emptying the most space-consuming log every day leaving just some last lines (in the below example 300 lines) for information
echo '#!/bin/sh' > /system/sdcard/config/cron/periodic/daily/truncate_log
echo 'tail -n 300 /tmp/lighttpd-access.log > /tmp/lighttpd-access.log' >> /system/sdcard/config/cron/periodic/daily/truncate_log
chmod +x /system/sdcard/config/cron/periodic/daily/truncate_log
I also have issues with RTSP stopping after some hours, so I'm very glad for the suggestions in this issue! In order to prevent lighttpd-access.log
growing so big in the first place, I disabled logging only for updating the web UI current picture:
Edit /system/sdcard/config/lighttpd.conf
and add the last line in this block:
$HTTP["url"] !~ "^/.well-known/(.*)" {
$HTTP["scheme"] == "https" {
auth.backend = "htdigest"
auth.backend.htdigest.userfile = "/system/sdcard/config/lighttpd.user"
auth.require = ( "/" => ("method" => "basic", "realm" => "all", "require" => "user=root"))
alias.url = ( "/viewer" => "/system/sdcard/DCIM/" )
$HTTP["url"] =~ "^/viewer($|/)" { server.dir-listing = "enable" }
# disable logging of the currentpic since it makes accesslog grow very fast
$HTTP["url"] == "/cgi-bin/currentpic.cgi" { accesslog.filename = "" }
}
additionally I use @NikZak suggestion to reduce the log lines every day. I hope this makes my RTSP stream more reliable now.
EDIT: this did not solve my issues. I went with restarting the RTSP server every hour (!). Annoying but functional at the moment...
It's weird. I set my video to like 720 x 540 and had the recording service on. It was at around 45% free mem. After every couple days the rtsp will stopped working. I can still access the camera from the web and everything seems to be working. The memory got down to around 3%. I had to restart the rtsp service and the rtsp service will work again on my network again. After restart, the mem goes back up to 16%.
Not sure if it is a memory problem. But not sure how to fix it too.