Close

Software setup

A project log for Italian Word Clock

It tells you the time with RGB leds, already working on a talking version that also moves the hands

esenesesenes 10/13/2024 at 20:200 Comments

Start with a fresh installation of raspbian OS, with internet access (either via ethernet or setup the wifi connection when you flash the SD card).

During the installation, create a sudo user called clockPi'.

Make sure that you run

sudo raspi-config

and select the appropriate time zone !

Keep the time synchronised:

Install the NTP service to keep the time synchronized via web. In this implementation there is no NTC module, so we will have to rely on the web for that.
Run in a terminal

sudo apt-get install ntp

 then configure it (for servers in Italy)

sudo nano /etc/ntp.conf

and write inside

server ntp1.inrim.it iburst
server ntp2.inrim.it iburst
server time.inrim.it iburst

then save and exit. Restart the service with

sudo service ntp restart

and you should be good. Check the status with 

sudo service ntp status 


Dowload the scripts from github:

Create a folder to host the scripts called "wordClock"

cd
mkdir wordClock 

download the scripts in the Scripts folder at https://github.com/esenes/Word-clock, and copy them inside the wordClock folder in the raspberry pi.

Install the Adafruit-Blinka library:

First of all you need to get the Adafruit-Blinka library

sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install python3-pip

sudo apt install --upgrade python3-setuptools

sudo apt-get install python3-full

then reboot the raspberry pi.

Create a virtual environment for the python script to run:

Move inside the script folder

cd 
cd ./wordClock

and create a virtual environment called "env"

python3 -m venv env --system-site-packages

 once it's done, activate the environment and install the neopixel libraries

source ./env/bin/activate


Install the libraries for the neopixel LED strips:

pip install rpi_ws281x 
pip install adafruit-circuitpython-neopixel 

And as last touch go to disable the audio on pin 18 if that's what you will be using. Go to /boot/firmware/config.txt and set dtparam=audio=off

Test that everything runs:

/bin/bash /home/clockPi/wordClock/run_clock.sh

 The clock should light up and visualize the time


Enable the script to run at startup:

Go edit the rc.local file

sudo nano /etc/rc.local

and add this line before the exit 0

/bin/bash /home/clockPi/wordClock/run_clock.sh &

 It's all set

You can reboot the pi and see what happens

sudo reboot 

Discussions