-
Notifications
You must be signed in to change notification settings - Fork 0
Updating the GUI
If a change is made to the GUI, extra steps must be performed to make sure the GUI runs on startup again.
- Remove the existing GUI files:
cd ~
rm -rf webserver/
-
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.
-
Make sure the folder structure is as follows:
~/webserver/app.py
-
Set the permissions of the server start script:
chown pi webserver/app.py
chmod +x webserver/app.py
-
Reboot Pi.
-
If changes have been made to the underlying SCUTE library, make sure to update that too.
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.
- Set app.py permissions:
chown pi webserver/app.py
chmod +x webserver/app.py
- Navigate to the services folder:
cd /etc/systemd/system/
- 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
- Set the service file's permissions:
sudo chmod 644 horizongui.service
- Reload the service daemon so it refreshes its list of services:
sudo systemctl daemon-reload
- Start the Flask server:
sudo systemctl start horizongui
- Check it's running correctly:
sudo systemctl status horizongui
- If no errors appear, set the new service to run on boot:
sudo systemctl enable horizongui