Вы находитесь на странице: 1из 37

Electronic Engineering Education and Innovation

Home

Course Notes

Embedded Systems

General

Blog

Other

Automatically Setting the Beaglebone


Black Time Using NTP

Previous

Next

Derek Molloy

Follow

Search ...

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Tags

Analog Discovery angstrom


avconv

beaglebone
beaglebone
black bitbake build
building

c++ C920 connman

cpu curl disk distribution easydriver

ffmpeg flash Flip-Flop


gparted

git

https iso Java kernel

LED LEDs linux live-cd Logic


Automatically Setting the Beaglebone Black Time Using NTP
Setting the Time on a Once-off Basis

Analyzer

nmap

opencv portscan

re-size resize

RTP source

stepper motor

UDP vdi Video

virtualbox

VLC Wordpress

x264

On my current distribution the Beaglebone Black does not come with a working NTP installation
in order to set the time. Because the board doesnt have a battery backup, this means that we

Categories

need a way to set the time when the board is running. If you wish to set the time you could do it
on a once-off basis

Analog

When you boot the Beaglebone black, the time comes up as:

Beaglebone

Blog

1 root@beaglebone:~# date
2 Sat Jan 1 12:27:56 GMT 2000
open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Digital Electronics

Embedded Systems

General

Linux

need a way to update this each time the Beaglebone boots.

Main Blog

Install the NTP Software

Raspberry PI

Tools

Uncategorized

Which is quite some time ago! I noticed this because I did a git commit and in the github status it
said that I did the update 13 years ago!
To set the date once off you could use something like:
1 root@beaglebone:~# ntpdate -b -s -u pool.ntp.org
2 root@beaglebone:~# date
3 Sat May 18 22:52:56 BST 2013

However, if you reboot your Beaglebone the time will be back to the good old year 2000. So, we

Next, we need to install the ntp software on the Beaglebone black so, at the command prompt (I
am using Angstrom here):
1 opkg update
2 opkg list|grep ntp
3 opkg install ntp

Next, find a NTP server that is close to your location. We need to do this to be good ntp citizens
as it is not good to use a NTP root server as they are already heavily loaded it is better to use
a NTP pool server that is close to your location in order to help with load balancing.
A Google search for my location ntp server ireland returns the website http://www.pool.ntp.org/
which you can search for your location. For Ireland I get:
1 server 0.ie.pool.ntp.org

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

1
2
3
4

server
server
server
server

0.ie.pool.ntp.org
1.ie.pool.ntp.org
2.ie.pool.ntp.org
3.ie.pool.ntp.org

So, I have edited my /etc/ntp.conf file to contain:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# This is the most basic ntp configuration file


# The driftfile must remain in a place specific to this
# machine - it records the machine specific clock error

Recent Posts

driftfile /etc/ntp.drift
logfile /var/log/ntpd.log

# NTP Servers for Ireland from www.pool.ntp.org


server 0.ie.pool.ntp.org
server 1.ie.pool.ntp.org
server 2.ie.pool.ntp.org
server 3.ie.pool.ntp.org
#
#
#
#

Using local hardware clock as fallback


Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself
server 127.127.1.0
fudge 127.127.1.0 stratum 14

# Defining a default security setting


restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

The driftfile specifies the file that is used to store information about previous responses from the

Tools and Techniques for


Building with Embedded Linux

Analog Discovery: Getting

Started with the Analog and


Digital Tools

Analog Discovery: Getting

Started with the Logic


Analyzer and Digital Pattern
Generator

NTP servers you are using. This file contains internal information for NTP leave it at /etc/ntp.drift

If you only want to allow machines within your own network to synchronize their clocks with your

Exploring BeagleBone:

Beaglebone: Controlling the

on-board LEDs using Java

server, but ensure they are not allowed to configure the server, set the restrict value as above. In
Beaglebone: Controlling the

my case, 192.168.1.0 is the IP address of my network and 255.255.255.0 is my networks

netmask.

on-board LEDs using C++

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Important make sure that you comment out the server and fudge lines or the server will sync to
itself!

Archives

Setting the logfile above is very useful as it allows you to check the /var/log/ntpd.log file to see
what is going wrong if you are having problems.

June 2014

Set your localtime file according to your time zone

January 2014

December 2013

November 2013

October 2013

July 2013

June 2013

May 2013

April 2013

Next you need to set your /etc/localtime file according to your timezone. If you go into the
directory /usr/share/zoneinfo you will see a lot of different timezone files, e.g.
1
2
3
4
5

root@beaglebone:/usr/share/zoneinfo# ls
Africa
CET
EST5EDT GMT
Greenwich
America
CST6CDT Etc
GMT+0 HST
Asia
EET
Europe
GMT-0 MET
Australia EST
GB
GMT0
MST

MST7MDT
NZ
NZ-CHAT
PRC

PST8PDT
Pacific
ROC
ROK

UCT
UTC
Universal
W-SU

WET
Zulu
iso3166
zone

You can copy the file directly or use one of the presets. In my case, Irish time is the same as
London time. So,
1
2
3
4
5
6
7
8

root@beaglebone:/usr/share/zoneinfo# cd Europe/
root@beaglebone:/usr/share/zoneinfo/Europe# ls -al
total 20
drwxr-xr-x 2 root root 4096 Mar 18 2013 .
drwxr-xr-x 9 root root 4096 Jan 1 11:42 ..
-rw-r--r-- 1 root root 3661 Mar 19 2013 London
-rw-r--r-- 1 root root 1464 Mar 19 2013 Moscow
-rw-r--r-- 1 root root 2945 Mar 19 2013 Paris

So, I am going to use the London file back to the /etc directory:

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

1 root@beaglebone:/etc# rm localtime
2 root@beaglebone:/etc# ln -s /usr/share/zoneinfo/Europe/London /etc/localtime

by setting a symbolic link from /etc/localtime to the timezone file. The advantage of this over
copying the file is that you can see the timezone that was set when you ls:
1
2
3
4

root@beaglebone:/etc# ls -al|grep localtime


lrwxrwxrwx 1 root root
33 Jan 1 12:05 localtime -> /usr/share/zoneinfo/
root@beaglebone:/etc# ls -al localtime
lrwxrwxrwx 1 root root
33 Jan 1 12:05 localtime -> /usr/share/zoneinfo/

Okay, next we need to start the services. Follow the steps carefully

Enabling the NTP Services


Setup the ntpd server by typing:
1 root@beaglebone:/etc# systemctl enable ntpdate.service
2 root@beaglebone:/etc# systemctl enable ntpd.service

This installs two services:


1
2
3
4
5
6
7
8
9
10
11

root@beaglebone:/lib/systemd/system# more ntpd.service


[Unit]
Description=Network Time Service
After=network.target
[Service]
Type=forking
PIDFile=/run/ntpd.pid
ExecStart=/usr/bin/ntpd -p /run/ntpd.pid
[Install]

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

11 [Install]
12 WantedBy=multi-user.target

and a second service:


1
2
3
4
5
6
7
8
9
10
11
12

root@beaglebone:/lib/systemd/system# more ntpdate.service


[Unit]
Description=Network Time Service (one-shot ntpdate mode)
Before=ntpd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/ntpdate-sync silent
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

However, and importantly on the Beaglebone black you have to modify the second service to:
1
2
3
4
5
6
7
8
9
10
11
12

root@beaglebone:/lib/systemd/system# more ntpdate.service


[Unit]
Description=Network Time Service (one-shot ntpdate mode)
Before=ntpd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/ntpd -q -g -x
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

So, importantly you must replace the line ExecStart=/usr/bin/ntpdate-sync silent with the
line ExecStart=/usr/bin/ntpd -q -g -x. The time will not automatically update unless you make
this change. The reason for this is given in the ntpd man page (http://linux.die.net/man/8/ntpd):
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Most operating systems and hardware of today incorporate a time-of-year


(TOY) chip to maintain the time during periods when the power is off. When
the machine is booted, the chip is used to initialize the operating system
time. After the machine has synchronized to a NTP server, the operating
system corrects the chip from time to time. In case there is no TOY chip or
for some reason its time is more than 1000s from the server time, ntpd
assumes something must be terribly wrong and the only reliable action is for
the operator to intervene and set the clock by hand. This causes ntpd to exit
with a panic message to the system log. The -g option overrides this check
and the clock will be set to the server time regardless of the chip time.
However, and to protect against brok en hardware, such as when the CMOS
battery fails or the clock counter becomes defective, once the clock has
been set, an error greater than 1000s will cause ntpd to exit anyway.

Finally, reboot and the date/time should be fine:


1 root@beaglebone:~# reboot

Note: If your ssh client ever hangs on a reboot type ~. and it should kill the ssh client session.
When the system comes up:
1 root@beaglebone:/lib/systemd/system# date
2 Sat May 18 23:27:49 BST 2013

And, this could be the case from now on. Enjoy, and remember to remain a good NTP citizen.

Fixing the Hardware Clock


open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Thanks to Louis Thiery in the comments below he pointed out that the RTC Time was still out
after you perform the steps above. I have made one additional change to the configuration and it
seems to do the trick It is probably a bit of a hack! but it seems to work
Modify the ntpdate.service file to add one more line:
1
2
3
4
5
6
7
8
9
10
11
12
13

[Unit]
Description=Network Time Service (one-shot ntpdate mode)
Before=ntpd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/ntpd -q -g -x
ExecStart=/sbin/hwclock --systohc
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
root@beaglebone:/lib/systemd/system#

that calls the hwclock and requests it to use the system time to set the hardware clock. This
appears to work as when you reboot and call timedatectl, you get the following output:
1 root@beaglebone:/lib/systemd/system# timedatectl
2
Local time: Sun 2013-06-09 01:06:26 BST
3
Universal time: Sun 2013-06-09 00:06:26 UTC
4
RTC time: Sun 2013-06-09 01:06:26
5
Timezone: Europe/London (BST, +0100)
6
NTP enabled: no
7 NTP synchronized: yes
8
RTC in local TZ: no
9
DST active: yes
10 Last DST change: DST began at
open in browser PRO version Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

10 Last DST change: DST began at


11
Sun 2013-03-31 00:59:59 GMT
12
Sun 2013-03-31 02:00:00 BST
13 Next DST change: DST ends (the clock jumps one hour backwards) at
14
Sun 2013-10-27 01:59:59 BST
15
Sun 2013-10-27 01:00:00 GMT
16 root@beaglebone:/lib/systemd/system#

You can see here that the RTC time is now the same as Local time and all appears to be in order
And, in case you are concerned, yes, it is actually 1:06am, time for my bed!

+36 Recommend this on Google

By Derek | May 18th, 2013 | Beaglebone, Blog | 61 Comments

Share This Story, Choose Your Platform!

About the Author: Derek


Dr. Derek Molloy is a Senior Lecturer in the School of Electronic Engineering,
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Faculty of Engineering & Computing at Dublin City University, Ireland. He lectures


in Object-oriented Programming, Embedded Systems, 3D Computer Graphics
and Digital Electronics at postgraduate and undergraduate levels. This is his
personal blog site.

Related Posts

61 Comments
Dev May 23, 2013 at 9:15 pm - Reply

Thanks for sharing this.


Just a quick note in the latest BeagleBone black image (2013-05-20) they
automatically sync the time. All what you need to do is to override /etc/localtime with your
timezone otherwise it is UTC by default
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Derek May 23, 2013 at 9:30 pm - Reply

Thanks, that is good news. I would still recommend that people edit
/etc/ntp.conf to set the servers to local ntp pools.

Georg January 24, 2014 at 8:21 pm - Reply

Dear Derek,
it worked straight forward, only the RTC synchronization went different
because it didnt worked the way above. Instead of
root@beaglebone:/lib/systemd/system#
I used
hwclock -w
And my RTC was set to the system time

Joerg May 29, 2013 at 11:07 am - Reply

Hello Dev,
are You sure? I just installed the image and it do not work.

Louis June 8, 2013 at 10:52 pm - Reply

Hi Derek
Thanks for writing this up!
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

First off, I think that the current BBB image still doesnt do this automatically, so Im not sure if
the previous comment is accurate. The only thing about the new BBB image is that linking is no
longer necessary but I see that you already removed that part of the tutorial.
Secondly, I noticed that although this change allows us to synch the OS clock with the ntpd pool,
our hwclock is left with a silly time which can be observed by typing: timedatectl (or hwclock)
What Id like to do is correct the hwclock so that we have it giving an accurate value should we
reboot without Internet connectivity. I think that I should create another systemd process that runs
when ntpdate.service is successful, which would simply be the command hwclock --systohc
but Im still trying to figure how to create that dependancy of processes with system.d
Anyway, I just wanted to write up the idea in case someone has good resources on this. Ill have
time to tinker with it tomorrow.
Louis

Derek June 9, 2013 at 1:09 am - Reply

Thanks Louis,
Well spotted and described! I have found one solution and added it to the page
description. If you find a better solution, please let me know.
Thanks again,
Derek.

Louis June 11, 2013 at 10:04 pm - Reply

Hi Derek,
Ah thats really easy the way you did it. I was complexifying it and thinking I needed
to make another systemd task that would watch for this one to finish. Simple adding another
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

ExecStart line the way you did is a lot easier and makes sense. If we were doing a completely
different not clock related task that depended on the clock, a separate service might be
appropriate.
Thanks,
Louis

paul June 16, 2013 at 4:00 pm - Reply

Hi Derek,
and thanks a lot for your excellent blog posts on the Beagleboard Black! Its always a
lot of fun to read through them. One question popped to my mind: Is the BBB making actually use
of its onboard RTC so you can use the hwclock command?

Mark June 16, 2013 at 4:51 pm - Reply

Thanks for the tutorial however I am on the (currently) latest build 2013-06-06 and
when I run:
enable ntpd.service
I get:
-sh: enable: ntpd.service: not a shell builtin
I tried to see if ntpd was something I could install using opkg however no luck. Any suggestions
would be greatly appreciated. As silly as it seems my shiny new BBB is completely useless to
me until I can get the time to update at boot. Back to the Raspberry Pi until the next update.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Snehal August 30, 2013 at 1:40 am - Reply

Mark, even I had the same problem ntpd.service was not present in my board
too. I manuaaly created and modified it. Could you please tell me what the
solution could be to this problem?

Erik P September 12, 2013 at 3:30 pm - Reply

Just a not on this old comment, you didnt type the whole command line. it is:
systemctl enable
not
enable

Yves June 16, 2013 at 7:19 pm - Reply

Wow! A lot more complex than I would have thought when I set out to get my BBB to
set its clock to nist. But it worked perfectly. Thanks Derek.

Mark June 16, 2013 at 10:22 pm - Reply

Correction to above. When I enter:


systemctl enable ntpd.service
I get:
Failed to issue method call: No such file or directory

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Derek June 21, 2013 at 7:16 pm - Reply

Hi Mark, Im afraid I have no idea, Derek.

Stephen June 21, 2013 at 6:50 pm - Reply

Hi,
I am running
Linux beaglebone 3.8.13 #1 SMP Wed Jun 5 11:21:00 CEST 2013 armv7l GNU/Linux
This command worked
ntpdate -b -s -u pool.ntp.org
I followed instructions to set up the processes and could not get it to run. I got these errors
root@beaglebone:/etc# systemctl status ntpd.service
ntpd.service Network Time Service
Loaded: loaded (/lib/systemd/system/ntpd.service; enabled)
Active: failed (Result: exit-code) since Fri 1999-12-31 19:03:27 EST; 13 years 5 months ago
Process: 141 ExecStart=/usr/bin/ntpd -p /run/ntpd.pid (code=exited, status=0/SUCCESS)
Main PID: 147 (code=exited, status=255)
CGroup: name=systemd:/system/ntpd.service
root@beaglebone:/etc# systemctl status ntpdate.service
ntpdate.service Network Time Service (one-shot ntpdate mode)
Loaded: loaded (/lib/systemd/system/ntpdate.service; enabled)
Active: failed (Result: exit-code) since Fri 1999-12-31 19:00:04 EST; 13 years 5 months ago
Process: 130 ExecStart=/sbin/hwclock systohc (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/ntpdate.service
root@beaglebone:/etc# date
Any suggestions?
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Derek June 21, 2013 at 7:13 pm - Reply

Hi Stephen,
Did you do the part where you modify the line to:
ExecStart=/usr/bin/ntpd -q -g -x
Derek

FrankCo June 24, 2013 at 7:47 am - Reply

It work great on my BBB when I use it on SSH. But I can not use it on the GUI mode
with external monitor and keyboard and mouse after I reboot. It seem hang, but I can
still use the SSH.
I have try the 5.27 and 6.6 image it both get hang on GUI.

Johan Henselmans June 26, 2013 at 8:53 pm - Reply

Derek,
Thanks for these instructions, and the others.
I noticed that installing ntp also created an init file as /etc/init.d/ntpd. Does that not interfere with
the systemd installation?

Derek Molloy June 28, 2013 at 2:58 pm - Reply

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Hi Johan, if memory serves me right, because the beaglebone is using the


systemctl system manager, the /etc/init.d/ntpd does not start ntpd. I had
started not realising this fact and initially I didnt understand why changes within init.d were
having no effect. Kind regards, Derek.

Franky September 1, 2013 at 3:58 pm - Reply

Finally i know the resaon (i.e. there is no resaon !) the ntp standard linux
command does not work on Asus EeePc Xandros o.s. !Anyway, the hint
proposed works fine: thanks a lot.

Maddox July 4, 2013 at 1:55 am - Reply

There is a typo on line 3 of the Install the NTP Software


okpg install ntp SHOULD BE opkg install ntp
Not a big deal unless you are cutting and pasting like I was

Derek July 4, 2013 at 2:48 pm - Reply

Thanks for that! Fixed.

haris s July 23, 2013 at 7:06 am - Reply

i thing there is a bug, look at this:


open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

root@beaglebone:~# date
Tue Jul 23 13:00:38 GMT-7 2013
root@beaglebone:~# timedatectl
Local time: Tue 2013-07-23 13:00:47 GMT-7
Universal time: Tue 2013-07-23 06:00:47 UTC
RTC time: Sat 2000-01-01 00:07:10
Timezone: Etc/GMT-7 (GMT-7, +0700)
NTP enabled: no
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
root@beaglebone:/etc# ls -la localtime
lrwxrwxrwx 1 root root 29 Jul 17 11:51 localtime -> /usr/share/zoneinfo/Etc/GMT-7
im in GMT+7 area, but i have to set GMT-7 into beaglebone. GMT+x is flip over with GMT-x

Matt Richardson July 24, 2013 at 7:40 pm - Reply

Thanks for this guide. I was wondering since ntpdate -b -s -u pool.ntp.org updates
the time why that couldnt be set as a system service. At first it didnt work, but then I
configured systemd to restart the process if it fails. My /lib/systemd/system/ntpdate.service looks
like this:
[Unit]
Description=Network Time Service (one-shot ntpdate mode)
Before=ntpd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/ntpdate -b -s -u pool.ntp.org
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

RemainAfterExit=yes
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Is there any reason why I shouldnt do it this way?

bo herrmannsen September 5, 2013 at 10:54 pm - Reply

Matt Richardsons method did the trick for me.

Dermot August 2, 2013 at 12:32 pm - Reply

Hi,
I have following the steps on a BBB running the latest image from Angstrom.
Everything looks ok, but the time does not update (connected via Ethernet to the web).
If I try to manually update the time using:
ntpdate pool.ntp.org
I get:
__libc_res-Nquery: Assertion hp != hp failed.
Which is not very helpful to me.
Using the following:
opkg update
opkg install ntpdate
opkg install ntp
confirms that ntp and ntpdate are both up to date.
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Where may I have gone wrong?

William C Bonner August 4, 2013 at 6:11 pm - Reply

Ive been having problems with my time not being set even after I followed your
instructions. I think it has to do with my wireless networking issues immediately after
booting. Im still working on getting my 5.8GHz wireless to be stable and consistent.
I happened to be looking into another problem and was thinking about putting something into the
cron jobs to happen and ran the command crontab -e while logged in as root. I was surprised to
see a command configured to be run every 30 minutes /usr/bin/ntpdate-sync so I looked at its
contents. If you put a list of ntpservers in /etc/default/ntpdate it should keep your Angstrom
distribution synced with even less effort than following your instructions.

Dick August 17, 2013 at 12:58 am - Reply

I followed the instructions and it works. But my question is why does it need both
ntpdate and ntp? I thought that ntpdate was deprecated and the functionality is now
included in ntp.

Ulf August 18, 2013 at 5:25 pm - Reply

I use only ntp on my Beaglebone


ARMv7 Processor rev 2 (v7l)
Linux 3.8.13
The time on my Beaglebone lags considerably behind the true time. This may be related to the
new Linux version. Can anybody replicate this?
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

The following commands will reset the time


/etc/init.d/ntpd stop
ntpd -q -g
/sbin/hwclock systohc
/etc/init.d/ntpd start

shine August 20, 2013 at 6:29 pm - Reply

Hi.
Thanks for the writeup. I am not able to find my region listed in the /etc/localtime
folder. I am in GMT + 5:30. How do I proceed?
Thank you.

Philipp August 21, 2013 at 12:34 pm - Reply

Setting the hardware clock as described seems to ignore the timezone. Heres my
ntp log.
1 Jan 03:18:23 ntpd[255]: DNS 3.ch.pool.ntp.org -> 130.60.204.10
21 Aug 12:04:33 ntpd[135]: ntpd: time set +430386363.526481 s
(here also the hardware clock was set)
21 Aug 12:05:51 ntpd[344]: ntpd exiting on signal 15
21 Aug 14:06:13 ntpd[128]: Deferring DNS for 0.ch.pool.ntp.org 1
21 Aug 12:06:27 ntpd[128]: ntpd: time set -7200.366256 s
After the reboot there is a 2 hour delay (Im in Paris timezone) which presumably is the
hardwareclock. This gets corrected by the ntpd call, but thats not the goal.
Any idea how to set the hardware clock by taking correctly into account the timezone?
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Tee Eff November 11, 2013 at 11:47 am - Reply

To set the hardware clock with UTC time, use the utc option.
By the way, why using a ln command to set the time zone.
timedatectl list-timezones and timedatectl set-timezone do the job

Snehal August 30, 2013 at 12:41 am - Reply

Hi,
I need some help. I followed the exact procedure and my timezone is changed but as
mentioned by Stefan the the date is Fri 1999-12 31 and NTP Synchronized = NO. Could you
please help me? I am not being able to figure out the problem.

Snehal August 30, 2013 at 12:47 am - Reply

Also when I put ntpdate -b -s -u pool.ntp.org I get an error saying cannot


resolve pool.ntp.org Name or server not found

Terrence September 4, 2013 at 8:17 am - Reply

Hi Derek
I just updated Angstrom with the latest image and I this is what I get
root@beaglebone:~# opkg update
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Collected errors:
* opkg_conf_load: Could not create lock file /var/lib/opkg/lock: Read-only file system.
I cant install any packages
any ideas?

Snehal September 8, 2013 at 1:20 am - Reply

Hey,
Just delete the file. even I had the same error. It works!

Ipar September 5, 2013 at 1:37 pm - Reply

Hello, Im able to synchronize the Beaglebone when its connected to my LAN, but if
instead I of connecting to that I connect the beagle to a 3G/GPRS router, the beagle
is unable to get the date. I can transfer some files across the router, but not to synchronize the
board.

leo September 9, 2013 at 9:16 am - Reply

Ive update to the 2013-09-04 image on my BBB and followed the steps and
succeeded finally. I am grateful for the detailed explanation and wanna add the
following from my experience:
1) NTP is installed on my BBB, i.e. I can call ntp. But somehow the ntpd is not installed. So, I
think several problems mentioned above are the same type, that the ntpd is not installed.
2) Following the steps with the ntpd did NOT solve the issue. After reboot the time was simply still
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

the same. I was able to fix it with the reply from Matt Richardson above. So, the question for me
after following these lines, if I really need to do the opkg install ntp or not. i.e. Would it have
succeed with just the installed image processes or not? After removing the ntpd.service the
function was still available. I dont mind too much since it works now
3) The trick with the hwclock is the one I like really
4) Does anybody know how to make the above steps as a script? This would be very useful in
case of an image-update.

Daniel September 22, 2013 at 6:16 am - Reply

Derek
Your blog is very helpfull and appreciated
the time and date my new BBB is (finally) correct
but after some fiddling and without the last mod
this message is sent via the BBB driven from a vnc windows box
(1h16 am enougn for tonight

Jos Henrique October 26, 2013 at 11:03 pm - Reply

Hi Derek, hi Matt,
Thanks a lot for your tutorial and, of course, your time to participating on this
discussion.
I could get the correct RTC, after your and Matt Richardson directions, but after rebooting and
timedatectl command I received the answers:
..
NTP enabled: no
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

NTP synchronized: no
RTC in local TZ: no
..
Questions: what means NTP enabled: no? And the others questions?
Best regards,
Jos Henrique

Jos Henrique October 26, 2013 at 11:18 pm - Reply

Observing better the timedatectl answer, Ive gotten also: RTC time: Sat 2000-01-01
01:09:11.
Thanks again,
JH

Vinh Dam November 22, 2013 at 10:12 pm - Reply

I am new to Linux. Its been time consuming to follow the steps to make my BBB
update the date and time. It worked perfectly.
After I try Ubuntu I reloaded the Angstrom OS and the BBB went back the year 2000. I had to
repeat all the steps again.
Is it possible build a script to do this?
My regards and thanks

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Nigel Brown December 4, 2013 at 10:40 am - Reply

Using 2013-09-04 followed all your steps and time not correct after reboot, followed
Matt Richardsons method and it works now.

Mike G December 7, 2013 at 9:16 pm - Reply

Hi Derek,
I just wanted to thank you for your clear & informative posts here and on YouTube.
Im something of a newbie to Linux so your information is a real lifeline to me. Your students are
lucky to have you!
Regards,
Mike

Florian Floimair January 5, 2014 at 2:09 am - Reply

Instead of linking the timezone file into /etc/localtime you can also run
sudo dpkg-reconfigure tzdata
on any Debian-based system. Saves you a lot of hassle IMHO.

WW January 15, 2014 at 9:19 pm - Reply

I wanted to disable the automatic date sync. I already removed ntp but BBB is getting
date when I connected to internet from somewhere that I do not know. Do you what
process is syncing when I connect the ethernet cable?
Thank you
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Pujan February 4, 2014 at 5:59 am - Reply

Hello all ,
What should I do if I want to set Indian standard time on to BBB.???? I have tried it
but i m not able to set IST on to my BBB. Please help]

Ankit February 13, 2014 at 8:22 am - Reply

Hello All,
Sub While booting Beaglebone Board hangs and shell promt is not coming
I used prebuild bootloader (MLO and u-boot.img) provided with the
board, then I am facing this issue
systemd-fsck[86]: rootfs: clean, 5551/172832 files, 43656/691200 blocks
1) I checked in three computer . In two , it is working correctly and
shell promt is coming also.
(i checked ls, cd ,uname command)
But in one computer in last at the time beaglebone login it hangs
and message comes like:
systemd-fsck[86]: rootfs: clean, 5551/172832 files, 43656/691200 blocks
Will you please guide

Michael February 22, 2014 at 2:37 am - Reply

Hi Derek,
Im using Linux beaglebone 3.8.13 #1 SMP Thu Sep 12 10:27:06 CEST 2013 armv7l
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

GNU/Linux
I just caught this and it might help others. Ive noticed that the file /etc/resolv.conf is not persistent
across the reboot. Adding the nameserver to the file was lost. So I placed the line echo
nameserver 8.8.8.8 >> /etc/resolv.conf into /usr/bin/g-ether-load.sh hoping that would work. It did
not and I think the reason is that /etc/resolv.conf is overwritten after g-ether-load.sh executes
during boot.
I know this is a leading question but could you tell me where to put it?

ashish March 4, 2014 at 8:47 am - Reply

Hi,
I have developed an application (running on Beagle bone Black) which uses msmtp as
its smtp client. Now, When I run this application from BBB command prompt, application can
send email successfully. But after that, I have created a service which will start my application
automatically every time BBB boot-up but in this case, application can not send email.
Also, I have added some debug messages in my application. When I run this application manually
from command line, I can see debug messages on command window but in case of auto startm
these debug messages are not there.
Can you please share your inputs in this regard.
Thanks,
Ashish

realdark April 6, 2014 at 10:16 pm - Reply

nother solution for auto update date and hwclock


1. Open /etc/rc.local
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

nano /etc/rc.local
2. Enter this commands before exit 0
ntpdate -b -s -u pool.ntp.org
hwclock -w
exit 0
3. That`s it all
Hint: replace pool.ntp.org whit correct zone. Example: my is bg.pool.ntp.org
P.S. /etc/rc.local script that is executed at the end of startup.

Jeff Mulliken May 1, 2014 at 10:21 pm - Reply

Thanks so much for doing the leg work on this, and then being kind enough to share
the fruits of your labor. Youre a prince.
Cheers,
Jeff

Kishan May 31, 2014 at 12:19 pm - Reply

Thank You Mr.Derek!


Followed your steps and got the problem solved.
Thanks again.

Dima June 5, 2014 at 2:55 pm - Reply

Hi everybody,
Ive some problems with installing NTP software when I type opkg update I get such
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

errors:
Collected errors:
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/Packages.gz, wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/machine/beaglebone/Packages.gz,
wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/debug/Packages.gz, wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/gstreamer/Packages.gz, wget returned
1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/all/Packages.gz, wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/perl/Packages.gz, wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/Packages.gz, wget returned 1.
And after opkg install ntp command I get:
Unknown package ntp.
Collected errors:
* opkg_install_cmd: Cannot install package ntp.
What should I do with this?
Thank you,
Dima

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

John P August 4, 2014 at 2:45 am - Reply

Dima,
Did you ever find a solution for your BBB? I have been having the same issues.

Yong July 2, 2014 at 4:21 am - Reply

Hi,
I am working on my own board which I have RTC and the board is 90% reference from
BeagleBone Black. I would like to know how can I get the NTP installed (default) in my OS
(Wheezy) image when I distribute my boards to customers? I could not afford to install/repeat the
process in every single boards.
Thank you!
Yong

Fisher July 7, 2014 at 5:12 pm - Reply

Hi all,
I have read that one may connect a rechargeable battery to the power management IC
pins on the board (they are unpopulated), then it may be possible to have an almost permanent
RTC functionality such as wake up events etc.
I hope to investigate it if I get one of these boards:
http://electronics.stackexchange.com/questions/98553/how-can-i-power-beagle-bone-black-with-37v-lipo
http://www.element14.com/community/community/designcenter/single-board-computers/nextgen_beaglebone//blog/2013/08/10/bbbrechargeable-on-board-battery-system
https://groups.google.com/forum/#!topic/beagleboard/vnu8sC9fgYo
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Luis July 15, 2014 at 8:15 pm - Reply

Hi Derek I have a problem , How active DST active? In my beagle appear DST
active:n/a
greetings from Mexico

Bart August 13, 2014 at 4:23 pm - Reply

Hi Luis,
Whats your timezone? I had the same issue with timezone UTC, changed that
to Paris and all works fine now.
Regards,
Bart

John P August 4, 2014 at 2:44 am - Reply

I am having the same issue as Dima. When following Dereks instructions I get the
following:
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfpneon/base/Packages.gz.
wget: bad address feeds.angstrom-distribution.org
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfpneon/machine/beaglebone/Packages.gz.
wget: bad address feeds.angstrom-distribution.org
open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfpneon/debug/Packages.gz.
wget: bad address feeds.angstrom-distribution.org
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfpneon/gstreamer/Packages.gz.
wget: bad address feeds.angstrom-distribution.org
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/all/Packages.gz.
wget: bad address feeds.angstrom-distribution.org
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfpneon/perl/Packages.gz.
wget: bad address feeds.angstrom-distribution.org
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfpneon/python/Packages.gz.
wget: bad address feeds.angstrom-distribution.org
Collected errors:
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/Packages.gz, wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/machine/beaglebone/Packages.gz,
wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/debug/Packages.gz, wget returned 1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/gstreamer/Packages.gz, wget returned
1.
* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/all/Packages.gz, wget returned 1.
* opkg_download: Failed to download http://feeds.angstromopen in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/perl/Packages.gz, wget returned 1.


* opkg_download: Failed to download http://feeds.angstromdistribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/python/Packages.gz, wget returned 1.
Anybody have a solution to this problem? Any help is greatly appreciated.

Andy November 11, 2014 at 11:14 am - Reply

I have managed to install the NTP daemon and get it synchronizing to the internet fine
by following the instructions above. However, I would like to get the board synced to a
GPS time reference. I have inherited a LC2750 GPS time reference from these guys:
http://www.TimeToolsGlobal.com. Has anyone used one of these or have any information on how
to use GPS for syncing in general?

Leave A Comment

Name (required)

open in browser PRO version

Email (required)

Are you a developer? Try out the HTML to PDF API

Website

pdfcrowd.com

Comment...

POST COMMENT

ABOUT:

RECENT COMMENTS

TAG CLOUD:

This site brings together all of

tabish on The Beaglebone

Analog Discovery angstrom

The full source code for

avconv

my new book Exploring

the video content on the Derek


Molloy YouTube channel and
structures it so that you can
follow the videos as lessons. It
also integrates associated

Richard on Beaglebone Images,


Video and OpenCV
Richard on Beaglebone Images,
Video and OpenCV

documentation, datasheets and


open in browser PRO version

Are you a developer? Try out the HTML to PDF API

beaglebone
beaglebone
black bitbake build
building

c++ C920 connman

RECENT TWEETS

BeagleBone
http://t.co/iLftfplvnw is
now available at
https://t.co/a0PWn7v8hI.
Enjoy! Derek
pdfcrowd.com

tools to allow you to get the


best from the video series. It

TomPe on Qt with Embedded


Linux on the Beaglebone

also has a blog to allow me to


post new videos, articles and
useful information that may not
be in video form

Nick on Beaglebone: An I2C


Tutorial Interfacing to a BMA180
Accelerometer

Like

Derek Molloy

Share

151

63 videos

Subscribe

cpu curl disk distribution easydriver

ffmpeg flash Flip-Flop


gparted

4 days ago

git

https iso Java kernel

LED LEDs linux live-cd Logic


Analyzer

nmap

opencv portscan

re-size resize

RTP source

stepper motor

UDP vdi Video

virtualbox

VLC Wordpress

@laurensvalk Thanks!
6 months ago

Follow @DerekMolloyIE

258 follow

x264

23K

Copyright 2013- Derek Molloy | All Rights Reserved | Powered by WordPress | DCU Homepage

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Вам также может понравиться