Skip to content

OSD Displays GMT time, not local time. #216

Description

@w35m17h

Model: GK-200MP2B
Sonoff-hack version: 0.2.0

The OSD timestamp always displays UTC/GMT regardless of the timezone
configured via the web GUI.

Investigation:

  • ZoneTimeName is correctly written to the DB (value 11 = America/Chicago)
    sqlite3 /mnt/mtd/db/ipcsys.db "select c_param_value from t_sys_param
    where c_param_name='ZoneTimeName';"
    result: 11

  • system.sh reads ZoneTimeName, looks up the timezone string from
    t_zonetime_info, and exports TZ — however $TZ is empty in the
    running system, suggesting the export does not persist beyond
    system.sh's own execution context
    echo $TZ
    result: (empty)

  • /etc/localtime is present and matches /share/America/Chicago
    ls -la /etc/localtime /share/America/Chicago
    result: both 3543 bytes

  • System clock shows correct local time
    date
    result: Sun Apr 19 14:xx:xx CDT 2026

  • NTP is syncing correctly
    ps | grep ntpd
    result: ntpd -p pool.ntp.org

Despite all of the above, avencode (stock firmware binary) displays GMT
on the OSD. It appears to call gmtime() rather than localtime(), ignoring
both /etc/localtime and the TZ environment variable. Since avencode is
already running before system.sh executes, it would not inherit TZ even
if the export did persist.

Is there a known workaround, or any way to pass the correct timezone
to avencode at startup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions