WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: set time date in raspberry pi b+ without internet  (Read 14512 times)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
set time date in raspberry pi b+ without internet
« on: October 23, 2014, 09:17:29 PM »
hi
Which file/boot option should I edit so that picore does not try to access ntp server (as my device is on LAN without internet) & set time to some day in 2014 say 19-05-2014 9AM.
Otherwise , i have seen it defaults to january 1 1970 & says 'password expired' to ssh clients .

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: set time date in raspberry pi b+ without internet
« Reply #1 on: October 24, 2014, 12:52:54 AM »
Use date command in bootlocal.sh
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: set time date in raspberry pi b+ without internet
« Reply #2 on: October 25, 2014, 02:41:37 AM »
okay . will try .

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: set time date in raspberry pi b+ without internet
« Reply #3 on: October 25, 2014, 12:35:45 PM »
that worked.
does this try to get time from NTP ?
startup message shows 'skipping RTC' .

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: set time date in raspberry pi b+ without internet
« Reply #4 on: October 25, 2014, 12:54:15 PM »
It tries in the background few times but stops after few tries, doens't harm.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 402
Re: set time date in raspberry pi b+ without internet
« Reply #5 on: October 25, 2014, 01:54:39 PM »
startup message shows 'skipping RTC' .

RTC = real time clock (I think)

Offline manit123

  • Sr. Member
  • ****
  • Posts: 315
Re: set time date in raspberry pi b+ without internet
« Reply #6 on: October 25, 2014, 07:19:55 PM »
can i tell it not to try NTP & save time in boot ?

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: set time date in raspberry pi b+ without internet
« Reply #7 on: October 26, 2014, 01:17:57 AM »
can i tell it not to try NTP & save time in boot ?

Core waits 60 seconds for working network connection. If network is not available after 1 munute, do not check NTP time. As it was written in a previous it happenes in the background, do not slow down system,

No need to disable. Just do nothing :)
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Captain Murloc

  • Guest
Re: set time date in raspberry pi b+ without internet
« Reply #8 on: December 12, 2014, 01:32:21 AM »
Hello,

I'm quite new on Raspberry and I have to get automatically the date when my RPi is booting. You said :

Use date command in bootlocal.sh

My /opt/bootlocal.sh is void. Nothing is written in. Is it normal ? Maybe this /bootlocal.sh is not located into /opt folder but I only heard about this location.

If it is normal, how have I to use the date command here ?

Thanks for help and sorry for my english :x

-- Captain Murloc

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: set time date in raspberry pi b+ without internet
« Reply #9 on: December 12, 2014, 01:42:56 AM »
Is your RPi connected to Internet?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Captain Murloc

  • Guest
Re: set time date in raspberry pi b+ without internet
« Reply #10 on: December 12, 2014, 02:01:25 AM »
For now, it is. But I need it to be able to update the date without Internet.

-- Captain Murloc

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: set time date in raspberry pi b+ without internet
« Reply #11 on: December 12, 2014, 02:44:41 AM »
Without Internet, there are two option.

1) Manually using date command
2) Adding an RTC (search Forum for tipps)
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Captain Murloc

  • Guest
Re: set time date in raspberry pi b+ without internet
« Reply #12 on: December 12, 2014, 02:57:59 AM »
1) Manually using date command
Hum, OK. I understood that but I don't know how to correctly use this command. Actually, I need to get the true date on each boot of the RPi.
I assume that I need to use the date command on boot putting it in a specific file, but in which file have I to put it so it runs automatically ?

2) Adding an RTC (search Forum for tipps)
I really don't want to add any module to my RPi. :)

Thanks.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: set time date in raspberry pi b+ without internet
« Reply #13 on: December 12, 2014, 03:08:41 AM »
You must execute date command in a terminal.

Type

Code: [Select]
date --help
in terminal to get help on usage.

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Captain Murloc

  • Guest
Re: set time date in raspberry pi b+ without internet
« Reply #14 on: December 12, 2014, 03:20:52 AM »
In fact, when I type date in my terminal, I always get the following date :
Code: [Select]
Tue Sep   9 12:31:36 CEST 2014Only time is changing.
If I let my RPi turned on, of course, the date will change but when I turn it off and restart it, the date is still Tue Sep   9 xx:xx:xx CEST 2014

Of course, I used
Code: [Select]
dpkg-reconfigure tzdata and selected the good geographic area and time zone. But nothing changed.
« Last Edit: December 12, 2014, 03:24:12 AM by Captain Murloc »