This script looks for new images from the Earth Polychromatic Imaging Camera on NASA's Deep Space Climate Observatory satellite, and displays them on screen.
This is designed for a 2.1" Hyperpixel Round Touch display from Pimoroni, with a Raspberry Pi Zero W.
It displays each image for 20s then moves to the next one.
It currently checks the EPIC "Blue Marble" API for new images every 120 mins, but I think they only upload new images once a day, so it probably doesn't need to be this often.
This is programmed using Python3 and PyGame.
Some other features have been added:
- The rotation between images is with fade
- Touching the screen jumps to the next image
- Holding the mousebutton or screen >5 seconds exits the application
- It is more api friendly downloading only images is doesn't already have
- It caches images because the api sometimes offers less. guaranteeing a beatiful picture even without internet or api downtime.
- It automatically crops the downloaded image to the right size.
Because the DSCOVR is in an Lissajous orbit around L1 the size of the earth in the photos is variable. Code has been added to use the metadata from the api to calculate how much the crop should be.
This procedure works regardless of your host OS.
- Create a bare Raspberry Pi (Legacy) Debian Buster image.
- Make sure to tell the Raspberry pi imager tool to also setup WiFi en SSH.
- Download and put the
./install/install-all.sh
script on the boot partition the imager just made for you on the SD card. - Bring the Raspberry Pi live and login over SSH:
ssh [email protected]....
- Copy the install script to your user directory:
cp /boot/install-all.sh ./
- Run it
./install-all.sh
- if it complains about rights,
chmod +x ./install-all.sh
- if it complains about rights,
- Follow on screen instructions and wait... It will:
- setup the USB-Console (the console available on the GPIO ports, over the OTG port)
- download and install the display drivers.
- download and install EPIC with python requirements.
- place two scripts on the desktop you can run via the touchscreen.
- download and install comitup, a tool to be able to provision new wifi
networks using your phones wifi and browser.
- This last step will hang your SSH session,, because the networking is re-arranged in the rpi, just wait, until the unit reboots. It should in a few minutes.
- Setup the WiFi (again, sorry) via the AP it now makes named
EPIC-###
. - Done!
If installation of comitup fails for some reason, recreate the image and do the installation in two parts,
./install-epic.sh
first over SSH. Then./install-comitup.sh
but this time while logged in via the USB-Console.
Use these instructions to only setup the EPIC program. Follow the instructions of the display on the page from Pimoroni.
- Use the terminal or log in as pi via ssh.
- Create the directory
mkdir ~pi/code/epic/
- Go into the directory
cd ~pi/code/epic/
- Copy the code from this repository in
git clone https://github.com/Jeroen6/epic.git .
(the dot is intentional)
- make sure
start-epic.sh
is executable (chmod +x start-epic.sh
) - Copy the autostart file
cp epic.desktop ~pi/.config/autostart/
- The autostart folder may not exist yet
mkdir ~pi/.config/autostart/
- The autostart folder may not exist yet
- Install any python requirements
pip3 install -r requirements.txt
- Test you can run it
./start-epic.sh
- If that doesn't work, test you can run it directly
python3 -u epic.py
- If it still doesn't work check the output for errors, and google them.
- If that doesn't work, test you can run it directly
- If the test works, kill it with CTRL+C
- Reboot and hope it runs automatically
sudo reboot
- You may want to put a copy of
start-epic.sh
on the desktop (in the middle) to restart it via the touchscreen if it crashed.
If there are, and you want to, update the EPIC python program do the following:
- Login over USB-Console of SSH.
- Go to
cd ~/code/epic
- Stop the program.
./stop-epic.sh
- Update
git pull
- Start it
./start-epic.sh &
To update the raspberry pi os itself (or comitup) run:
sudo apt update
sudo apt upgrade
There will be many packages to update, not all are relevant. The installation script does not remove any unused programs.