- gpio python boot or ask your own question.">Not the answer you’re looking for? Browse other questions tagged gpio python boot or ask your own question.
In order to use pigpio Module in Python (remote GPIO for Raspberry Pi ), pigpiod
has to be loaded to memory on each RPi.
- what is the right way to to it ? during Ubuntu’s boot or a part of Python’s script ?
- since It needs
sudo pigpiod
- how is it done (both Ubuntu and Python )?
asked Aug 1 ‘17 at 5:44
[
](https://raspberrypi.stackexchange.com/users/68038/guy-d)
Guy . DGuy . D
41833 gold badges88 silver badges2222 bronze badges
sudo systemctl enable pigpiod
will enable it to auto-start on boot.
sudo systemctl start pigpiod
will start it immediately (just a posh way of doing
sudo pigpiod
:)
If you change your mind,
sudo systemctl disable pigpiod
will undo the start-up behaviour. Similarly,
sudo systemctl stop pigpiod
will have an immediate effect.
answered Mar 23 ‘18 at 16:20
[
](https://raspberrypi.stackexchange.com/users/83868/kimsj)
KimSJKimSJ
14611 silver badge22 bronze badges
Ubuntu:
ou can add the command in the /etc/rc.local
script that is executed at the end of startup.
Write the command before exit 0
. Anything written after exit 0
will never be executed.
Raspbian:
to execute commands “at boot”, if autologin is enabled (since what it really does it execute them when the pi user logs in), i’d suggest editing the autostart
file wich is in the ~/.config/lxsession/LXDE-pi/
directory. just add these two lines at the end of the file:
@export DISPLAY=:0
@epiphany /path/to/your/file.png &
P.S. you need to have root permissions to edit autostart
Python:
if you want to execute commands in a python script just do this:
from os import system
system("sudo pigpiod")
answered Aug 1 ‘17 at 9:08
[
](https://raspberrypi.stackexchange.com/users/64246/liam)
LiamLiam
57311 gold badge77 silver badges1919 bronze badges
answered Aug 18 ‘17 at 16:47
[
](https://raspberrypi.stackexchange.com/users/68038/guy-d)
Guy . DGuy . D
41833 gold badges88 silver badges2222 bronze badges