systemctcl start pigpiod # start it now
systemctl enable pigpiod # start it each boot
systemctl status pigpiod # make sure it started
# https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logs
journalctl -u pigpiod # Use this to see logs.
我没有使用
pigpiod
,但我假设它是一个守护进程(一个长时间运行的Linux进程),您希望在启动时启动它。在大多数现代Linux系统(包括Raspberri-Pi)中,标准的方法是使用systemd
。请尝试以下命令:如果
systemctl
抱怨找不到服务,则必须为其创建服务文件。这是一个放置在目录中的文本文件,它告诉systemd如何取消进程的监控。Here是一篇有人这样做的博客文章,如果没有帮助的话,Google应该会找到其他人。在然后您应该能够与Python连接。在
另一种方法是在cron中使用重新启动选项
运行:
然后添加条目:
^{pr2}$这将在系统每次引导时运行该进程。在
在gpiozero documentation 中回答
相关问题 更多 >
编程相关推荐