# Uptime wrong

**URL:** https://forum.syncthing.net/t/uptime-wrong/10387
**Category:** Support
**Created:** [August 17, 2017, 8:46am UTC](https://forum.syncthing.net/t/uptime-wrong/10387 "2017-08-17T08:46:42Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 17, 2017, 8:46am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/1 "2017-08-17T08:46:42Z")

</div>

My Pi Zero (Raspbian, st v0.14.36) is now showing an uptime of 19h 32m. This about 19h 20m too high as I’ve just switched it on.

cpu 1,2%, No traffic. 19h + uptime survives screen refresh.

Seem to remember something like this happening before (\>1 day out).

Is there any info I can gather?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [August 17, 2017, 8:53am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/2 "2017-08-17T08:53:06Z")

</div>

The clock on the pi and the machine accessing the UI might be out of sync.

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 17, 2017, 9:07am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/3 "2017-08-17T09:07:13Z")

</div>

david@pi:~$ date Thu 17 Aug 10:05:18 BST 2017 david@monocerus:~$ date Thu 17 Aug 10:05:20 BST 2017

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 17, 2017, 9:14am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/4 "2017-08-17T09:14:31Z")

</div>

Sorry, wrong pi.

david@pie:~$ date

Thu 17 Aug 10:13:07 BST 2017

david@monocerus:~$ date

Thu 17 Aug 10:13:07 BST 2017

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [August 17, 2017, 9:22am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/5 "2017-08-17T09:22:07Z")

</div>

Maybe Syncthing started at boot and the clock was wrong, then later corrected by NTP.

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 17, 2017, 9:38am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/6 "2017-08-17T09:38:03Z")

</div>

… so, restarting st should fix the problem.

It did.

The pi doesn’t have an RTC. It saves the time at shutdown, restores it at boot and corrects it via NTP when it can.

The time difference could well be the time it was off.

Good spot @calmh.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [August 17, 2017, 9:39am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/7 "2017-08-17T09:39:19Z")

</div>

> [@dinosore](#):
>
> The pi doesn’t have an RTC.

😧 Yeah that’s the most likely explanation then.

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 17, 2017, 9:55am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/8 "2017-08-17T09:55:28Z")

</div>

A small chunk of journal to prove it.

```
Aug 16 14:09:45 pie nice[455]: [B3IQ5] INFO: Ready to synchronize "zzPpictures" (ayfes-crvzx) (readwrite)
Aug 16 14:09:46 pie systemd-timesyncd[291]: Using NTP server 193.150.34.2:123 (2.debian.pool.ntp.org).
Aug 17 09:17:03 pie systemd-timesyncd[291]: interval/delta/delay/jitter/drift 32s/+68836.893s/0.058s/0.000s/+0ppm
Aug 17 09:17:03 pie systemd[1]: Time has been changed
Aug 17 09:17:05 pie syncthing-inotify[456]: [WARNING] Cannot connect to Syncthing: Get http://127.0.0.1:8384/rest/4
Aug 17 09:17:05 pie syncthing-inotify[456]: 2017/08/17 09:17:05 Failed to perform request /rest/system/config: Get
```

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 17, 2017, 9:57am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/9 "2017-08-17T09:57:09Z")

</div>

Also, this morning

Aug 16 14:09:09 pie kernel: Booting Linux on physical CPU 0x0

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [August 17, 2017, 10:11am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/10 "2017-08-17T10:11:04Z")

</div>

As much as I like the Pi in principle I’m amazed that they would omit a 50 cent chip that is present in like every other piece of electronics in the world and enables something as basic as (mostly) proper timekeeping. Ah well.

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 17, 2017, 11:15am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/11 "2017-08-17T11:15:24Z")

</div>

It’s not just the chip, it’s also the battery, and 50c is a substantial proportion of the cost of a Pi.

UK [Pi Zero WW](https://thepihut.com/products/raspberry-pi-zero-w?variant=30332705425) @ 9.60 GBP [(10.55 EUR)](https://duckduckgo.com/?q=convert+9.60+GBP+to+EUR&atb=v75-2_q&ia=currency)

You can buy RTCs for the Pi ([https://thepihut.com/pages/search-results?q=rtc](https://thepihut.com/pages/search-results?q=rtc)), but the cost approaches that of the Pi itself.

Given access to an NTP server, the Pi keeps remarkably good time.

Saving the tiime at shutdown helps prevent time going backwards an the impact on file timestamps.

There’s just that hiccup at boot.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [August 17, 2017, 11:17am UTC](https://forum.syncthing.net/t/uptime-wrong/10387/12 "2017-08-17T11:17:52Z")

</div>

Fair 'nuff 🙂

---

<div class="post-metadata">

### Author: ![dinosore](https://forum.syncthing.net/user_avatar/forum.syncthing.net/dinosore/32/4085_2.png) [@dinosore](https://forum.syncthing.net/u/dinosore)
#### Post date: [August 20, 2017, 2:09pm UTC](https://forum.syncthing.net/t/uptime-wrong/10387/13 "2017-08-20T14:09:43Z")

</div>

I tried to sort out something with systemd dependencies to get st to start a bit later, preferably after “clock” had been synced, without any success.

I’ve settled for a nasty frig

```
ExecStart=/bin/bash -c "/bin/sleep 60;/usr/bin/nice /usr/bin/syncthing -no-browser -no-restart -logflags=0
and
ExecStart=/bin/bash -c "/bin/sleep 120;/usr/bin/syncthing-inotify -logflags=0"

```

This seems to be good enough for now, but I’d like to do it better.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [September 19, 2017, 2:24pm UTC](https://forum.syncthing.net/t/uptime-wrong/10387/14 "2017-09-19T14:24:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
