Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.jpg
5 changes: 0 additions & 5 deletions epic.desktop

This file was deleted.

6 changes: 3 additions & 3 deletions epic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
screen.fill((0,0,0))

# Display loading image
image = pygame.image.load(r"./loading.jpg")
image = pygame.image.load(r"/home/pi/code/epic/loadingimage/loading.jpg")
screen.blit(image, (0,0))
pygame.display.flip()

Expand Down Expand Up @@ -60,7 +60,7 @@ def save_photos(imageurls):
cropped.blit(image,(0,0),(125,125,830,830))
cropped = pygame.transform.scale(cropped, (480,480))

pygame.image.save(cropped,"./"+str(counter)+".jpg")
pygame.image.save(cropped,"/home/pi/code/epic/images/"+str(counter)+".jpg")
counter+=1
print("photos saved")

Expand All @@ -73,7 +73,7 @@ def rotate_photos(num_photos, rotate_delay):
pygame.quit()

# Create a surface object and draw image on it.
image = pygame.image.load(r"./"+str(counter)+".jpg")
image = pygame.image.load(r"/home/pi/code/epic/images/"+str(counter)+".jpg")

# Display image
screen.blit(image, (0,0))
Expand Down
17 changes: 17 additions & 0 deletions epic.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Epic Globe Display
Wants=network.target
After=network.target

[Service]
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority
ExecStart=/usr/bin/python3 /home/pi/code/epic/epic.py
Restart=always
RestartSec=10s
KillMode=process
TimeoutSec=infinity


[Install]
WantedBy=graphical.target
4 changes: 4 additions & 0 deletions images/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
File renamed without changes
22 changes: 14 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,22 @@ I've been fiddling with this for over a year now, so I've never followed these i
I'll assume you've already followed Pimoroni's instructions for getting the Hyperpixel Round screen going.

1. Use the terminal or log in as pi via ssh.
1. Create the directory `mkdir ~pi/code/epic/`
1. Go into the directory `cd ~pi/code/epic/`
1. Create the directory `mkdir ~/code/epic/`
1. Go into the directory `cd ~/code/epic/`
1. Crate image directory `mkdir images`
1. Copy the code from this repository in
* `git clone https://github.com/MattGrayYes/epic.git .`
1. make sure `start-epic.sh` is executable (`chmod +x start-epic.sh`)
1. Copy the autostart file `cp epic.desktop ~pi/.config/autostart/`
* `git clone https://github.com/vwillcox/epic.git .`
1. move Service file into place
* `sudo cp epic.service /etc/systemd/system`
* `sudo systemctl daemon-reload`
* `sudo systemctl enable epic.service`
* `sudo reboot`
1. On reboot the screen should load into the display with a slight delay.

## Errors running

1. Install any python requirements `pip3 install -r requirements.txt`
1. 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.
1. Test you can run it directly `python3 -u epic.py`
1. If the test works, kill it with CTRL+C
1. Reboot and hope it runs automatically `sudo reboot`

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pygame==1.9.4.post1
requests==2.21.0
pygame
requests
4 changes: 0 additions & 4 deletions start-epic.sh

This file was deleted.