New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Showing correct time in OSD (snx_isp_ctl) #78
Comments
I'm aware of this issue, but I don't think there's much we can do about it... The snx_isp_ctl tool only toggles osd settings, the actual updating is handled by closed-source sonix libraries/drivers. I did receive some reports from others who had a correct osd timestamp (could be related to mi home settings?) but I'm not sure if both the system time (as shown on the status web page) and osd were correct in those cases. Maybe they just set the system time 2 hrs early to compensate. There's also the possibility to update the osd yourself, i.e. create a script that writes a date/time string to the osd every second. It's just a shame we have to resort to this instead of using the internal hardware-supported method. |
Because of this post I checked my OSD. I noticed that I am 1 hour off, earlier. |
I did a check with wireshark and the camera only connects to google NTP server with enabled "Disable cloud applications". So no more cloud traffic and camera seems to do no more talking back home.
|
I've been digging around in the sonix sdk and found what it uses for timestamp.
When i get time I'm going to create a standalone binary to see if it outputs correct or utc and maybe see where i can go from there |
@ZeroPoints |
The code referred to by @ZeroPoints is part of snx_isp_ctl. So it might be used to set the time once, it is certainly not used to keep it updated every second since that would require snx_isp_ctl to run continously. |
@Tommy032017 Not sure if you've noticed, but ntpd is started by my scripts (data/etc/scripts/02-ntpd), and is also updated once by running ntpd -q when you change TZ on status page. This should run regardless of cloud apps being enabled. |
@samtap Yes, I know this. Every time you change TZ, an update will be done. I also did a capture by wireshark and the camera does continuously and periodically synchronize with the NTP server. This should't be the problem! |
Well it's handled by any compliant C library for the last ~ 30 years (reads /etc/TZ or something similar to create a time that corresponds with the local timezone i.e. localtime(). I just think the Chinese tried to reinvent the wheel and produced a square one instead of round. |
I have a same problem with "Sander456654". |
I change time - command "date", but after a while, it itself returned back - correction is must UTC +5, but now the script does not accept it from forms. |
@Sander456654 I have tested the command "date" after telnet connecting. it works. but the date and time is back after rebooting. How can I set the timezone for date/time on screen. |
Let's wait, maybe @samtap will recommend Something |
I solved it! but I am not sure this is correct... |
Does the insertion in the video also show the right time? |
Hi folks :) After a little bit of messing around I found that the following seems to work for me just fine: /etc/init.d/rcS > un-comment this line > modprobe snx_rtc /etc/fang_hacks.sh > add the following to the end of the file:
That's it. Now just reboot and wait patiently for the camera to start. Please note that the camera must be able reach the NTP server within the 6s sleep, so please extend this if required. Let me know if it works for you :) |
kamel83=king! 👍 Great work, pal! |
@kamel83 Thanks for the suggestion; turns out the RTC module isn't needed. I ended up adding a It's a curious solution, but |
Another way would be uncommenting modprobe snx_rtc and hwclock -s in rcS. That way you don't need to call ntpd twice. If you worry too much about rtc module being loaded, you can as well unload it afterwards... |
Thanks @BlaY0, I've switched to using |
@davidjb do you execute "modprobe snx_rtc && hwclock -s && modprobe -r snx_rtc" instead of ntpd under "start"? Could someone please explain howto fix this please? |
@tam481 That date/time in the year 2000 is the default set in the hardware RTC. |
For anyone else struggling with this, the final solution isn't quite enough. You have to run hwclock -t at least once (it survives a reboot). So something like this on the command line:
Just to be clear, this does NOT have to go in a script or anything, just run once manually. David's hwclock -s line might still be needed in a script though. |
@sshaikh Can you please give a full step by step instructions how to fix the +1hr time zone in OSD? I read this thread and tried some of the info here, but still showing incorrect +1hr time in my OSD. Also is there two different methods to fix this problem? |
Alas I cannot. I have three of these running and checking just now I see 2 of them with the correct TZ. I don't think I've treated them any differently, and following all the commands (including my own) doesn't fix it.... so it all seems a bit of a lucky dip really :) |
@sshaikh Did you follow #78 (comment) script? I tried @kamel83 method and my camera stop displaying the rstp stream and I couldn't ssh or access the web page. |
@kamel83 Hi I tried your script change #78 (comment) but why now the RSTP stop streaming and why I can't access ssh or viewing the status page shows 404? Basically the script change didn't work (as far as I can tell) and made the camera non functional and not working. |
Hi there I just made everything worked well as @davidjb said here. start()
{
echo "Starting ntpd..."
ntpd -q -n $NTPD_OPTS && hwclock -t
ntpd $NTPD_OPTS
} Reboot the camera and both OSD and date is set to your timezone. |
@toshichi your script change works and showing correct time 20-rtsp-server | NOK |
Worked for me. Interestingly he's evolved solution in #78 (comment) is what wasn't working for me. |
Glad to hear that it works. I also suffer this NOK status now and then. It looks like the process is not very stable. |
@toshichi all working now.. |
@toshichi experiencing a new problem... |
@madmax2 Sorry I have no idea about DST, perhaps you can change your timezone to a 1-hour-ahead one? |
I have the problem, that the time shown in the OSD is -2 h as compared to the time shown in the main web page of the hack.
I did following changes in 20-rtsp-server:
And stop and start again the 20-rtsp-script shows:
Could somebody give me pls some help.
The text was updated successfully, but these errors were encountered: