The Empire State Light Display project retrieves information about the Empire State Building tower lights schedule from its official website and displays it on an e-ink display.
- Retrieves tower lights schedule information from the Empire State Building website.
- Displays the schedule information on an e-ink display.
- Checks throughout the day for changes.
- Automatically runs system updates and reboots once a week
Setup directions and project files are built on the user being named 'administrator'. Current code will not work with a different username.
-
Open the Raspberry Pi terminal and enter the following command in the config interface:
sudo raspi-config
-
Choose Interfacing Options -> SPI -> Yes Enable SPI interface
-
Reboot your Raspberry Pi:
sudo reboot
-
Check
/boot/firmware/config.txt
, and you can see 'dtparam=spi=on' was written in.
sudo apt update
sudo apt upgrade
-
Clone repo to /home/administrator/empirestate:
sudo git clone https://github.com/gittygitlab/empirestate-light-display.git /home/administrator/empirestate
-
Run setup script:
sudo python ./empirestate/setup.py
- Run the update_and_run.py script. This will pull the latest update and then run the display script.
python ./empirestate/update_and_run.py
- NOTE: rpi-connect is in beta. Please refer to the following link for the latest setup instuctions, https://www.raspberrypi.com/documentation/services/connect.html
The current /etc/logrotate.conf file sets global settings for log rotation. However, the configuration you provided doesn’t specifically include a rule for rotating /var/log/cron.log. Here’s how you can set it up:
-
Create a New Configuration File:
You can create a new file specifically for the cron logs, for example /etc/logrotate.d/cron. This way, it won’t interfere with other log files.
-
Edit the /etc/logrotate.d/cron File:
Add the following configuration to rotate the /var/log/cron.log file:
/var/log/cron.log { weekly rotate 4 create missingok notifempty postrotate /usr/bin/systemctl reload crond > /dev/null 2>&1 || true endscript }
weekly: Rotates the log weekly.
rotate 4: Keeps the last 4 rotated logs.
create: Creates a new empty log file after rotation with default permissions.
missingok: Ignores errors if the log file is missing.
notifempty: Skips rotation if the log file is empty.
postrotate: Reloads the cron service to apply changes after log rotation.
-
Verify the Configuration:
Test the configuration by running:
sudo logrotate -d /etc/logrotate.conf
This will display the logrotate actions without actually performing them, allowing you to check for errors.
-
Before we can increase our Raspberry Pis swap file, we must first temporarily stop it.
sudo dphys-swapfile swapoff
-
Next, we need to modify the swap file configuration file.
sudo nano /etc/dphys-swapfile
-
Within this config file, find the following line of text.
CONF_SWAPSIZE=100
This number is the size of the swap in megabytes.
CONF_SWAPSIZE=1024
<-- This would be 1GBWhatever size you set, you must have that space available on your SD card. Check disk space with:
df -h
-
Once you have made the change, save the file by pressing CTRL + X, followed by Y, then ENTER.
-
We can now re-initialize the Raspberry Pis swap file by running the command below.
sudo dphys-swapfile setup
-
With the swap now recreated to the newly defined size, we can now turn the swap back on.
sudo dphys-swapfile swapon
-
If you want all programs to be reloaded with access to the new memory pool, then the easiest way is to restart your device.
sudo reboot