Change timezone

Hello,
I want to automatically set timezone each time FX30s powers on.
It works when i type export TZ=UTC-3 in terminal.
I added this command to /etc/init.d/startlegato.sh but it doesn’t work.

how about using this?:

root@swi-mdm9x28-wp:~# tzoneset 0 0 3
tzoneset: Changing timezone to [Etc/GMT-3]…
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# date
Thu Apr 1 11:37:48 UTC 2021
root@swi-mdm9x28-wp:~#

Thank you for your suggestion.

root@fx30s:~# tzoneset 0 0 3
-sh: tzoneset: not found

Actually, command export TZ=UTC-3 works fine but when i reboot fx30s it reverts to UTC again. So the question is how can i change TZ permanently?

you need to manually enter it to change shell environment variable.

Hi @axenos ,

If your wish is just changing timezone to UTC-3 every time your device power on. I will try to write an simple Legato app for this.

Please tell me:

  1. What is your device type?
  2. What FW and Legato version is your device running?
  3. Can you please show me the time showed after your device power on?

Thanks,

Hello @Donald,

By changing TZ to UTC-3 it syncs with my Local time. In other words it sets local datetime.

Legato version: 16.10.1.m3_f5d280aff1eaa96ea8459ca6effa50c5
Firmware Version: SWI9X15Y_07.12.09.00 r34123 CARMD-EV-FRMWR1 2017/04/26 23:34:19
Bootloader Version: SWI9X15Y_07.12.09.00 r34123 CARMD-EV-FRMWR1 2017/04/26 23:34:19
Linux Version: 3.14.29ltsi-a00e464379_499694411b #2 PREEMPT Tue Jun 12 16:49:03 PDT 2018
FX30 Version: R14.0.4.002

Time during power on: Thu Apr 1 14:30:56 UTC 2021
Current local time 17:30.

Hi @axenos ,

According to your information provided, your FX30 device is using wp85 chipset, right?

I made an Legato app to change your time after device power on ChangeTime.wp85.update.zip (8.5 KB) . Please note that:

  1. The time is changed as your wish after 3 minutes your device power on.

  2. This app is built on legato version 18.06.5 on FW Release 17.0.1.007. You can try to install this FW to your device without upgrading to this FW first. But in case it does not work, please upgrade to FW Release 17.0.1.007

  3. If the app does not work as your expected, please show me the log by:
    3.1. Right after device power on, make an ssh session to the device
    3.2 send command: logread -f

  4. If you don’t want to use this app anymore, ssh to device then remove the app by command: app remove ChangeTime

How to install local Legato app

  1. Open WINSCP software on window OS
  2. Select SCP method
  3. Enter IP: 192.168.2.2, user: root and pass:
  4. Copy the app (.update file) to the tmp folder (/tmp/)
  5. Make an ssh session to module
  6. Go to tmp folder: cd /tmp
  7. Install app by command: update ChangeTime.wp85.update

Thanks,

Thank you very much @Donald. Much appreciated!

A quick workaround i did was to create a scheduled task which opens ssh connection and sends the current datetime command manually.

I will try your solution and let you know!