MudPi was built on python 3 and everything is loaded from one main script. All you need to do after you have configured MudPi is run
mudpi.py script from the root folder of your MudPi installation.
cd your/path/to/mudpi python3 mudpi.py
You will have some nice output on the status of the program and it will continue to output while the MudPi is running. However if you power off the pi and encounter an error you will need to run the script again. We can make this much easier for ourselves and automatically start the script on boot and restart if any errors occur using a task monitor called supervisor.
Using a task monitor like supervisord is excellent to keep MudPi running in the background and only is a
pip install supervisor away. Using a tool like supervisor allows you to keep MudPi running in the event of errors or system restarts. This is what I do personally. Here is a example config file for supervisord once you get that installed. In my case this was located under
/etc/supervisor/conf.d/ on my raspberry pi. Change the paths and log files names as you need.
[program:mudpi] directory=/var/www/mudpi command=python3 -u /var/www/mudpi/mudpi.py autostart=true autorestart=true stderr_logfile=/var/www/mudpi/logs/mudpi.err.log stdout_logfile=/var/www/mudpi/logs/mudpi.out.log
You can then control your program through supervisor using the
supervisorctl. You will need to make note of the program name you specificed in your supervisor config. In the example provided above the name is
mudpi. You can then use the following commands to start, stop and restart your program through supervisor.
supervisorctl start mudpi supervisorctl restart mudpi supervisorctl stop mudpi
|✔||Preparing the SD Card||4:02|
|✔||Booting Up & Configuring Raspbian||4:48|
|✔||SSH and SSH Keys||(Video Coming Soon)|
|✔||Install Redis on Raspberry Pi from Compiled Source||(Video Coming Soon)|
|✔||Updating Python on Raspbian & Installing Useful Packages||(Video Coming Soon)|