In order to use pigpio Module in Python (remote GPIO for Raspberry Pi ), pigpiod has to be loaded to memory on each RPi.

  1. what is the right way to to it ? during Ubuntu’s boot or a part of Python’s script ?
  2. since It needs sudo pigpiod- how is it done (both Ubuntu and Python )?

asked Aug 1 ‘17 at 5:44

[

gpio - How to Run pigpiod on boot - Raspberry Pi Stack Exchange - 图1

](https://raspberrypi.stackexchange.com/users/68038/guy-d)

Guy . DGuy . D

41833 gold badges88 silver badges2222 bronze badges

  1. sudo systemctl enable pigpiod

will enable it to auto-start on boot.

  1. sudo systemctl start pigpiod

will start it immediately (just a posh way of doing

  1. sudo pigpiod

:)

If you change your mind,

  1. sudo systemctl disable pigpiod

will undo the start-up behaviour. Similarly,

  1. sudo systemctl stop pigpiod

will have an immediate effect.

answered Mar 23 ‘18 at 16:20

[

gpio - How to Run pigpiod on boot - Raspberry Pi Stack Exchange - 图2

](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:

  1. @export DISPLAY=:0
  2. @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:

  1. from os import system
  2. system("sudo pigpiod")

answered Aug 1 ‘17 at 9:08

[

gpio - How to Run pigpiod on boot - Raspberry Pi Stack Exchange - 图3

](https://raspberrypi.stackexchange.com/users/64246/liam)

LiamLiam

57311 gold badge77 silver badges1919 bronze badges

answered Aug 18 ‘17 at 16:47

[

gpio - How to Run pigpiod on boot - Raspberry Pi Stack Exchange - 图4

](https://raspberrypi.stackexchange.com/users/68038/guy-d)

Guy . DGuy . D

41833 gold badges88 silver badges2222 bronze badges

Not the answer you’re looking for? Browse other questions tagged gpio python boot or ask your own question.