Need help with configuing time on pi

The problem?
OK, I have a small problem that I don't know how to solve!
I have a functional Octopi system that is doing my prints with no real problem. However, for various reasons it cannot connect to the internet and therefore, cannot update the date/time correctly upon bootup.

So my question to the whole lot smarter people than I is how can I get the pi to time sync with the pc that is interfacing with the pi? The PC has internet connection and therefore has correct time.

What did you already try to solve it?
Tried googling the problem and only got more confused!

Logs (syslog, dmesg, ... no logs, no support)
Don't see a need for logs in this case as it is a config problem.

Additional information about your network (Hardware you are trying to connect to, hardware you are trying to connect from, router, access point, used operating systems, ...)
PC with browser to interface with Octopi:
Windows 7 Home and usually use Waterfox as the browser (currently up to date.
OctoPrint 1.4.0 running on OctoPi 0.15.

Any advice will be appreciated.

Thanks in advance.


If the pi is not connecting to the internet, you will not be able to get the time unless you add a RTC.

It is connected via wifi to my pc which has internet connection. I thought there might be a way to use NTP or something similar?

That would only work if your computer shared it's internet connection and your Pi was then set to use your PC as a gateway. But if your PC can connect to the internet, why can't the Pi, if they are on the same network? Is there a reason your don't want the pi to be able to access the internet? It's going to make it impossible to ever perform any updates. You would have to completely re-image the SD card every time there was an update. Also, you will never be able to install plugins or be notified of new plugins.

I googled a bit and found two options - either use the windows 10 internal services and create an ntp server or use a standalone ntp sever

since you're on windows 7 I would test the latter

To answer your first part, that is basically what I am trying to do. My router is wireless and freestanding (eg no ethernet connection to the pc) and my internet is a hot spot that is connected to the pc via an ethernet cable. But for some reason, I cannot get octopi to talk to the internet. Therefore my main concern is to setup a NTP server on the win7 machine and I am trying to understand how to get the pi to talk to it. I understand the basics, but need to know what I put on the pi to get it to talk to as the time server.

As for plugins and updates, I can do a temp. workaround. I say temp because if I feed through the hotspot, my isp charges all that bandwidth against my monthly allotment! With the plan I have, if I hit the max bandwidth, I am shut down for the rest of the month and if I try gaming, I will be terminated. Living in a rural part of the country does not afford may options for internet service!

Google has been my friend and this ole dog will learn new tricks somehow. That is a reason to ask on this site!

Thanks for all the advice so far.

OctoPi uses systemd-timesyncd which is configured via /etc/systemd/timesyncd.conf.

Try man timesyncd.conf, man 'systemd-timesyncd, and maybe man timedatectl

As @PrintedWeezl already stated, you will need to install NTP server on your PC first, then configure the RPi to talk to it instead of NTP servers on the internet.

Thanks, I think this is the info I need to finish this up. I have started the NTP server on my PC and was hoping to work on OctoPi this afternoon!