gtxaspec / wz_mini_hacks

wz camera mods... make your camera better.
1.33k stars 114 forks source link

isolated network - timestamp is not correct, how to set time? #673

Closed borgqueenx closed 1 year ago

borgqueenx commented 1 year ago

I have rejected outward traffic on my wyze cams, preventing them from accessing the internet. I am using the RTSP firmware and enabled rtsp in the wyze app, selfhosted set to true in mini hacks. However, i noticed that the timestamp of my wyze cam is now off by quite some hours, also quite some minutes.

I tried setting the date/time with the date command through ssh, but this setting is not saved. How do i proceed to set the date and time for the timestamp to be correct, also after a reboot?

thanks!

virmaior commented 1 year ago

know: the system tries to connect to an ntp server. believe: the list is hard-wired into iCamera

solutions:

  1. give it a false dns pointing to your own ntp server
  2. setup a cron job to have it get the time from a server under your control to set it.
borgqueenx commented 1 year ago

know: the system tries to connect to an ntp server. believe: the list is hard-wired into iCamera

solutions:

  1. give it a false dns pointing to your own ntp server
  2. setup a cron job to have it get the time from a server under your control to set it.

for point 2, how do we set a time? i know that when using the date command in ssh, it will not update the timestamp in the rtsp stream, and a restart makes the set time invalid again, so the timestamp never gets changed. with point 1, do you have some easy guide how to proceed with that to make this function? I have a Openwrt router that has ntp server enabled, so i can simply use 192.168.1.1. I tried this on my Annke cameras that are also cut off from the internet and it works.

virmaior commented 1 year ago

set NTP_SERVER in wz_mini.conf

(see https://github.com/gtxaspec/wz_mini_hacks/blob/07c7f29b0ea3c637ef452db28136af670a2248d8/SD_ROOT/wz_mini/etc/init.d/S18ntp#L4 ) for where it happens.

borgqueenx commented 1 year ago

Thank you! Initially it didn't work, but when i specified the port (so 192.168.1.1:123) it worked! Thank you for the assistance!

borgqueenx commented 1 year ago

Closing this issue then.

amandamana commented 10 months ago

I got stuck on the same problem until finding this post. It may be helpful to include this on the wiki.

Ideally, the default port would be automatic if not specified.

Even more ideally, the NTP server address would be taken from the DHCP field if provided.