-
Notifications
You must be signed in to change notification settings - Fork 1
Python Server
Code Club Luxembourg edited this page Nov 2, 2024
·
2 revisions
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.
Based on original work by Ben Servoz. Created and maintained by Code Club Luxembourg. Contributions are welcome!
Last updated: November 2, 2024 | Version 1.0
Documentation licensed under MIT License.