Skip to content

Updating the GUI

Rachael Kemp edited this page Oct 17, 2019 · 1 revision

If a change is made to the GUI, extra steps must be performed to make sure the GUI runs on startup again.

  1. Remove the existing GUI files:
cd ~
rm -rf webserver/
  1. Download new GUI files using the method described in Pushing files to the Pi or by regaining internet connection and then pulling them from Github.

  2. Make sure the folder structure is as follows: ~/webserver/app.py

  3. Set the permissions of the server start script:

chown pi webserver/app.py
chmod +x webserver/app.py
  1. Reboot Pi.

  2. If changes have been made to the underlying SCUTE library, make sure to update that too.

Setting GUI to run on boot

If you're setting up the GUI for the first time on a fresh Pi (not using the provided image), you will have to also set up the system service which starts the Flask server on boot.

  1. Set app.py permissions:
chown pi webserver/app.py
chmod +x webserver/app.py
  1. Navigate to the services folder:
cd /etc/systemd/system/
  1. Create a new service:
sudo nano horizongui.service

Include the following text, correcting the directories if they don't match the location of the GUI start script:

[Unit]
Description=Arribada Horizon GUI
After=network.target

[Service]
User=pi
WorkingDirectory=/home/pi/webserver/
ExecStart=/usr/bin/python /home/pi/webserver/app.py
Restart=always

[Install]
WantedBy=multi-user.target
  1. Set the service file's permissions:
sudo chmod 644 horizongui.service
  1. Reload the service daemon so it refreshes its list of services:
sudo systemctl daemon-reload
  1. Start the Flask server:
sudo systemctl start horizongui
  1. Check it's running correctly:
sudo systemctl status horizongui
  1. If no errors appear, set the new service to run on boot:
sudo systemctl enable horizongui