Skip to content
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

Cannot set timezone - Read-only file system #8

Closed
TimDowker opened this issue Apr 23, 2020 · 19 comments
Closed

Cannot set timezone - Read-only file system #8

TimDowker opened this issue Apr 23, 2020 · 19 comments
Labels
enhancement New feature or request

Comments

@TimDowker
Copy link

Trying to set the appropriate timezone and receive this error after trying to run the command

echo TimeZone > /etc/TZ

-ash: can't create /etc/TZ: Read-only file system

Found at
https://github.com/TheCrypt0/yi-hack-v4/wiki/Setting-the-Timezone

@roleoroleo
Copy link
Owner

The rootfs is read only.
It's different from the previous cams.
To solve this issue we should rewrite the rootfs increasing the risk of brick.

@gmarfjan
Copy link

I've done an ugly fix in /home/yi-hack/script/system.sh by adding export TZ="GMT-2" before starting all services (GMT-2 is my timezone). So all process start with this environment variable. Now watermark on snapshot displays the right date. When I'm connected by ssh, I have a wrong date because TZ is not set (should be set in /etc/profile but the fs is read-only). When I set it manually, it looks good.
We could add TZ parameter in /home/yi-hack/etc/system.conf and add export TZ=$(get_config TZ) in /home/yi-hack/script/system.sh . Web UI should be modified by adding a droplist of all timezones.
Do you think that's a good way ?

@roleoroleo
Copy link
Owner

roleoroleo commented Apr 24, 2020

In this manner, only "hacked" services start with new TZ.
Yi services start without it.
If it is enough it could be a good solution

@gmarfjan
Copy link

That's not the right way. For completely resolve this issue, I agree with you, we have to fix the TZ on OS level. It's just a temporary fix.

@TimDowker
Copy link
Author

Thank you for adding the setting in the config. However it doesn't seem to be retaining the setting.

@roleoroleo
Copy link
Owner

I retested it now and it seems to work.

@TimDowker
Copy link
Author

What timezone are you using? I'm trying America/Toronto which is

"EST5EDT,M3.2.0,M11.1.0"

And it doesn't work. Also tried just "EST5EDT" and same thing.

@roleoroleo
Copy link
Owner

roleoroleo commented Apr 26, 2020

CET-1CEST,M3.5.0,M10.5.0/3

You are using version 0.1.4 I guess

@TimDowker
Copy link
Author

TimDowker commented Apr 26, 2020

Still no go. What can I do to help diagnose this?

Yes, I was on 0.1.3 and upgraded through the web interface to 0.1.4

@roleoroleo
Copy link
Owner

Check if the file /home/yi-hack/etc/system.conf contains the item "TIMEZONE".

@TimDowker
Copy link
Author

TimDowker commented Apr 26, 2020

It does.

root@yi-b73d:/home/yi-hack/etc# cat system.conf
HTTPD=yes
TELNETD=no
SSHD=yes
FTPD=no
BUSYBOX_FTPD=no
DISABLE_CLOUD=yes
REC_WITHOUT_CLOUD=yes
MQTT=yes
RTSP=yes
RTSP_STREAM=both
ONVIF=no
ONVIF_PROFILE=both
NTPD=yes
NTP_SERVER=pool.ntp.org
PROXYCHAINSNG=no
RTSP_PORT=554
RTSP1_PORT=8554
ONVIF_PORT=80
HTTPD_PORT=8080
USERNAME=
PASSWORD=
FREE_SPACE=10
ONVIF_WM_SNAPSHOT=no
TIMEZONE=
root@yi-b73d:/home/yi-hack/etc#

@roleoroleo
Copy link
Owner

Try to add a new line after TIMEZONE=

@TimDowker
Copy link
Author

Ok, so adding the line didn't work but I was able to manually add it to system.conf. It still doesn't show anything in the "Timezone" text box on the Configurations page however the correct time is shown on the main information page.

@TimDowker
Copy link
Author

date doesn't return the correct date though.

@roleoroleo
Copy link
Owner

I can't understand...

@roleoroleo
Copy link
Owner

I restored 0.1.3 and upgraded again to 0.1.4.
I have no problems.

@roleoroleo roleoroleo added the enhancement New feature or request label Apr 26, 2020
@roleoroleo
Copy link
Owner

Has anyone tested this functionality with version 0.1.4?

@emeins
Copy link

emeins commented Apr 30, 2020

I tested with version 1.4.0. I added the TZ string (CET-1CEST,M3.5.0,M10.5.0/3) in the general settings of the web interface and it works well. I can see the TIMEZONE=CET-1CEST,M3.5.0,M10.5.0/3 in the /home/yi-hack/etc/system.conf without adding additional lines manually. I was a bit confused when I checked with #date command in ssh shell - still GMT time. But the snapshot and motion events present the right timezone.

@roleoroleo
Copy link
Owner

In shell you can't have the variable because there isn't profile file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants