It's all fine and dandy to have a script which we can manually run, but wouldn't it be nice to have the time and ip address pop up on the display when the Raspberry Pi boots up? This is done using an init script which runs our Python code every time your Raspberry Pi boots up. 

Download the service file

The following command will allow you to download the lcd.service file directly to your Pi.

Description=LCD date|time|ip



Place the lcd.service file

The lcd.service file needs to be copied into the correct location and the systemctl command can be used to start | stop | enable the service. It is a good idea to test this before enabling as there might be a minor path difference on your system. 

sudo cp lcd.service /etc/systemd/system

Test the lcd.service

sudo systemctl daemon-reload
sudo systemctl start lcd.service
ps auxww | grep -i 16x2

The following commands read the updates to the service file, start the lcd.service and confirm that the process is running. If the script shows up in the 'ps' command output you have done everything correctly and can now enable the service and reboot. The service should activate upon bootup automatically.

Enable lcd.service

sudo systemctl enable lcd.service

Now on each boot the LCD will automatically show the date/time/ip address on startup. This means you will know when the Pi is reachable and what the ip address is without having to plug a monitor in.

This guide was first published on Aug 17, 2012. It was last updated on Apr 17, 2024.

This page (Display Time & IP on Every Boot) was last updated on Apr 17, 2024.

Text editor powered by tinymce.