-
-
Notifications
You must be signed in to change notification settings - Fork 24
03 Setup for Launch
lovebootcaptain edited this page Jun 30, 2020
·
1 revision
sadly pygame doesn't like to work well with systemd... so it has to run as init.d service. maybe someone can help to solve this one time.
cd
cd WeatherPi_TFT
sudo cp WeatherPiTFT.sh /etc/init.d/WeatherPiTFT
sudo cp PiButtons.sh /etc/init.d/PiButtons
- this is useful if you like to run your python scripts on boot and with sudo support in python
sudo chown -v root:root /usr/bin/python3
sudo chmod -v u+s /usr/bin/python3
- this should start your wanted python version just by typing
python
in the terminal - helps if you have projects in python2 and python3 and don't want to hassle with the python version in your service scripts
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2
you can always swap back to python2 with:
update-alternatives --config python
and choose your preferred version of python
- check if python3.x is now default with:
python --version
- it should say something like:
Python 3.7.x
- if everything is set up and updated correctly:
sudo reboot
- for the WeatherPiTFT Service
sudo service WeatherPiTFT start
sudo service WeatherPiTFT stop
sudo service WeatherPiTFT restart
sudo service WeatherPiTFT status
- for the PiButtons Service
sudo service PiButtons start
sudo service PiButtons stop
sudo service PiButtons restart
sudo service PiButtons status
- if this is doing what it should you can run the service every time you boot your pi
sudo update-rc.d WeatherPiTFT defaults
sudo update-rc.d PiButtons defaults