Python Server - CodeClubLuxembourg/plottybot-toolkit-web GitHub Wiki
The Python server for PlottyBot is configured to start automatically at boot. This is achieved by modifying the /etc/rc.local
file.
- pigpiod: The Raspberry Pi GPIO daemon starts at boot to manage GPIO operations.
-
Logging: Standard error output from
plottybot.py
is redirected to/var/log/plottybot.stderr.log
for easier debugging. - Screen Session: The Python server runs in a detached screen session named "plottybot."
/usr/bin/pigpiod
rm /var/log/plottybot.stderr.log || true
/usr/bin/screen -S plottybot -dm sh -c "/usr/local/bin/plottybot.py 2>/var/log/plottybot.stderr.log"
- The log file is located at
/var/log/plottybot.stderr.log
.
- Use the command
sudo screen -r plottybot
to re-attach to the screen session.
- To detach from a
screen
session without terminating it, press the following key combination:Ctrl + A
followed byD
- To stop the Python server, find the PID with:
ps aux | grep plottybot.py
- Then use:
kill <PID>
or:
sudo kill <PID>
- To restart the Python server, you can reboot the system or run the screen command manually.