Skip to content

tomasaas/bachelor-final

Repository files navigation

bachelor project notes

restart server shortcut

Start the server with this script instead of running python run.py directly:

./run_server.sh

The script uses .venv/bin/python if it exists, otherwise it uses normal python.

When the server is running in the terminal:

  • Ctrl+C stops the server like before.
  • Ctrl+Alt+R restarts the server. this is useful after changing config.py.
  • If VS Code uses that shortcut, type rs and press Enter instead.

The restart shortcut only works when the server was started with ./run_server.sh.

start web page on raspberry pi boot

The Raspberry Pi should run the Flask server as a systemd service. This is the normal Linux way to make a program start automatically in the background when the Pi gets power.

The service file is here:

systemd/rubiks-web.service

It is set up for this project path:

/home/username/bachelor

Install and start it on the Raspberry Pi with:

./install_systemd_service.sh

After that, the web app starts by itself on every boot.

Useful commands:

sudo systemctl status rubiks-web.service
sudo systemctl restart rubiks-web.service
sudo systemctl stop rubiks-web.service
journalctl -u rubiks-web.service -f

The Flask app already listens on all network interfaces with 0.0.0.0, so other computers on Ethernet can open:

http://<raspberry-pi-ip>:5000

If the Pi has hostname/mDNS enabled, this may also work:

http://raspberrypi.local:5000

For a direct cable with no router, give the Pi a fixed Ethernet IP, for example 192.168.50.1, and put the laptop on the same subnet. Then open:

http://192.168.50.1:5000

About

Final source code for my Bachelor's project. This code lives on a RPI5.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors