How-To: Rasberry Pi Fullscreen Digital Wall Clock

Ampron Digital Wall Clock
Create a device that will display big nice green clock on a TV or LED video wall that is connected to a Raspberry Pi HDMI.

Following is our contribution to community of Raspberry Pi lovers. As we didn’t find any very decent and simplest solution, we did this how-to with the purpose of helping others.

If you are not skilled enough to create this on your own, then please let us know and we will ship you the preconfigured device. Send note to: team@ampron.eu

Applicability

Applicable and tested with:

Raspbian Stretch Lite
Minimal image based on Debian Stretch
Version: November 2018
Release date:2018-11-13

Download link:
https://downloads.raspberrypi.org/raspbian_lite_latest.torrent

Following detailed instructions are made with Mac in mind. If you will do in Windows or Linux, then some details may differ.

Download and unpack Raspbian image

Open Terminal

curl http://director.downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2018-11-15/2018-11-13-raspbian-stretch-lite.zip -o rasp.zip
unzip -a rasp.zip
rm rasp.zip

Create Raspbian SD Card for your Raspberry Pi

Insert SD card into your Mac or Linux

diskutil list

Replace [n] with the number of the disk, ie: /dev/disk2

sudo diskutil unmountDisk /dev/disk[n]
sudo dd bs=1m if=2018-11-13-raspbian-stretch-lite.img of=/dev/rdisk[n]

Leave Terminal to do its thing

When the copy is finished, enable ssh:

Eject and put back SD

cd /Volumes/boot
touch ssh
cd /Volumes
sudo diskutil eject /dev/disk[n]

Put SD card to Raspberry Pi, connect LAN cable and power up.

Create new user

First login:

user: pi
pswd: raspberry

create user with root access:

sudo adduser clock

add user to sudo group:

sudo usermod -aG sudo clock

Remove Pi user

exit
ssh clock@YOUR-RASPBERRY-IP
sudo deluser -remove-home pi

Change hostname

change raspberrypi to clock:

sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot

Set screen black on boot

We want the display stay clean without the rubbish during the starting of the clock.

sudo nano /boot/cmdline.txt

Add this to the end of the row:

consoleblank=1 logo.nologo quiet loglevel=0 plymouth.enable=0 vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fastboot noatime nodiratime noram

[IMPORTANT] You can add the any of the options to the end of the cmdline.txt file make sure it is all on the same line or else it will break your boot sequence!!!

Disable large rainbow screen on initial boot

sudo nano /boot/config.txt

Add Rows:

#Disable large rainbow screen on initial boot
disable_splash=1
sudo reboot

Web-based Wifi connect

More details: https://github.com/jasbur/RaspiWiFi

ssh through LAN into your Raspberry Pi

ssh clock@YOUR_RASPBERRY-IP-NO

sudo apt-get update

sudo apt-get install git -q

git clone https://github.com/jasbur/RaspiWiFi.git

cd RaspiWiFi && sudo python3 initial_setup.py

Answer the questions and installation begins.

Usage:

Connect to the “RaspiWiFi[xxxx] Setup” access point using any other WiFi enabled device. Navigate to 10.0.0.1. Select the preferred WiFy and enter password.

Install X-server and Chromium

sudo apt-get update
sudo apt-get install xorg openbox -q
sudo apt install xserver-xorg xinit -q
sudo apt-get install chromium-browser -q
sudo apt-get install unclutter

Allowing X server to be started by all users

By default, X server can only be started by root. To change this behavior:

sudo nano /etc/X11/Xwrapper.config

Change to this:

allowed_users=anybody

Configuring X server start-up parameters and disable screen blanking

X server uses ~/.xserverrc at startup. Create /home/screen/.xserverrc and add the below content. It disables power management at startup in addition to starting an X server. This ensures that our display never goes to sleep and is always available.

sudo nano /home/clock/.xserverrc
#!/bin/sh
#Start an X server with power management disabled so that the screen never goes blank.
exec /usr/bin/X -s 0 -dpms -nolisten tcp "$@"

Configure post X server start behaviour

X server users ~/.xsession at start-up to launch applications. In our case, we need Chromium to start. Do this:

sudo nano /home/clock/.xsession

Add content:

#!/bin/sh
#This tells X server to start Chromium at startup
chromium-browser --start-fullscreen --window-size=1920,1080 --disable-infobars --noerrdialogs --incognito --kiosk https://ampron.eu/clock

Install lighttpd webserver to your Raspberry Pi

FOR ADVANCED USERS: If you want to host the clock at your raspberry, then go and download files from https://ampron.eu/clock and host them locally. Easiest way to di it is to install lightweright http server.

run in a terminal:

sudo apt-get install lighttpd

the root of the web server is at “/var/www/html”. Download files there.

cd /var/www/html

sudo wget https://ampron.eu/clock/digital-7.ttf

sudo wget https://ampron.eu/clock/index.html

Then you also have to change the content of the .xsession file. For this:

sudo nano /home/clock/.xsession

Add content:

#!/bin/sh
#This tells X server to start Chromium at startup
chromium-browser --start-fullscreen --window-size=1920,1080 --disable-infobars --noerrdialogs --incognito --kiosk http://localhost

Start the clock at boot and during failure

Now that we have Chromium and X server configured, all we need is some way of starting and managing it. A systemd service does the job perfectly. Do this:

sudo nano /etc/systemd/system/clock.service

Insert content:

[Unit]
Description=Clock
After=network-online.target
DefaultDependencies=no

[Service]
User=clock
ExecStart=/usr/bin/startx
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Enable this service by running

sudo systemctl enable clock

Finally, start it

sudo systemctl start clock

To see the status of the service:

sudo systemctl status clock

To stop the service:

sudo systemctl stop clock

Display the status

systemctl status clock

More detailed status with logs:

journalctl -u clock -f

Restart to see if it boots up with clock in fullscreen

sudo reboot

If everything went well, then this is how it should look at the screen:

Rasberry Pi Fullscreen Wall Clock

Final Thoughts

Hopefully you now have nice fullscreen clock on your computer screen if you connected monitor or TV to HDMI port of you Raspberry Pi. If you would like to have it on some of our Rugged LED Message Boards or LED Video Wall, then please contact us and we will advise you the right size and model suitable to your needs and expectations.

If you had troubles during the setup and Google couldn’t help you out, then please send pic from the error on console and we will try to help you out. Send message to: team@ampron.eu.

Liked the article? Share it!

The Value of Experience: Why the Best Clients Are Those Who Have Tried Cheaper Alternatives

The Value of Experience: Why the Best Clients Are Those Who Have Tried Cheaper Alternatives

Our CEO and ​Business Development Executive Gen Vagula’s article explores why experienced clients, who have previously opted for cheaper alternatives, often become the most loyal and valuable customers. He will also discuss the futility of convincing inexperienced clients of your product’s value, as they lack the context to appreciate what you’re offering.

Read More »
Ampron's Sustainability Goals

Ampron’s Sustainability Goals

At Ampron, we are dedicated to responsible business practices and sustainability across all areas of our operations. Our aim is to create a positive impact throughout the entire value chain, promoting both environmental and social responsibility.

Read More »
The Importance of Sustainable Growth and Maintaining a Competitive Edge in the Smart City Industry

The Importance of Sustainable Growth and Maintaining a Competitive Edge in the Smart City Industry

In today’s rapidly evolving tech landscape, staying competitive is essential for success, especially in industries like Smart City solutions and LED guidance systems. However, the drive for growth must be balanced with sustainability and integrity. At Ampron, we believe in a long-term strategy that prioritizes sustainable growth while maintaining our competitive edge. This approach not only benefits our business but also ensures that we continue to provide the best possible solutions for our customers.

Read More »

Mobility Improvement Analysis

Our Mobility Improvement Analysis service is designed to streamline traffic flow and enhance operational efficiency in ports and logistics hubs by integrating cutting-edge LED guidance displays. We conduct thorough evaluations of traffic patterns, vehicle movements, and operational challenges, leveraging advanced data analytics to deliver actionable insights.

Read More »
Exploring Modern Interfaces for LED Message Boards

Exploring Modern Interfaces for LED Message Boards

At Ampron, we pride ourselves on delivering cutting-edge LED message boards equipped with our proprietary communication protocol. We’re always eager to share insights that highlight the unique advantages and applications of our technology.

Read More »