Skip to content

Commit 67b4c8e

Browse files
committed
Correct and clarify pigpiod/systemctl usage, close gpiozero#586
1 parent 8d93860 commit 67b4c8e

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

docs/remote_gpio.rst

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,50 +31,66 @@ another distribution, you'll need to install pigpio:
3131
3232
Alternatively, pigpio is available from `abyz.me.uk`_.
3333

34-
You'll need to launch the pigpio daemon on the Raspberry Pi to allow remote
35-
connections. You can do this in three different ways. Most users will find the
36-
desktop method the easiest (and can skip to the next section).
34+
You'll need to enable remote connections, and launch the pigpio daemon on the
35+
Raspberry Pi.
3736

38-
Desktop
39-
-------
37+
Enable remote connections
38+
-------------------------
4039

41-
On the Raspbian desktop image, enable **Remote GPIO** in the Raspberry Pi
42-
configuration tool:
40+
On the Raspbian desktop image, you can enable **Remote GPIO** in the Raspberry
41+
Pi configuration tool:
4342

4443
.. image:: images/raspi-config.png
4544

46-
This will launch the pigpio daemon automatically.
45+
Alternatively, enter ``sudo raspi-config`` on the command line, and enable
46+
Remote GPIO. This is functionally equivalent to the desktop method.
4747

48-
Command-line: raspi-config
49-
--------------------------
48+
This will allow remote connections (until disabled) when the pigpio daemon is
49+
launched using `systemctl` (see below). It will also launch the pigpio daemon
50+
for the current session. Therefore, nothing further is required for the current
51+
session, but after a reboot, a `systemctl` command will be required.
5052

51-
Alternatively, enter ``sudo raspi-config`` on the command line, and enable
52-
Remote GPIO. This will also launch the pigpio daemon automatically.
53+
Command-line: systemctl
54+
-----------------------
55+
56+
To automate running the daemon at boot time, run:
57+
58+
.. code-block:: console
59+
60+
$ sudo systemctl enable pigpiod
5361
54-
Command-line: manual
55-
--------------------
62+
To run the daemon once using ``systemctl``, run:
63+
64+
.. code-block:: console
65+
66+
$ sudo systemctl start pigpiod
67+
68+
Command-line: pigpiod
69+
---------------------
5670

5771
Another option is to launch the pigpio daemon manually:
5872

5973
.. code-block:: console
6074
6175
$ sudo pigpiod
6276
63-
This is for single-use and will not persist after a reboot. However, this method
64-
can be used to allow connections from a specific IP address, using the ``-n``
65-
flag. For example:
77+
This is for single-session-use and will not persist after a reboot. However,
78+
this method can be used to allow connections from a specific IP address, using
79+
the ``-n`` flag. For example:
6680

6781
.. code-block:: console
6882
6983
$ sudo pigpiod -n localhost # allow localhost only
7084
$ sudo pigpiod -n 192.168.1.65 # allow 192.168.1.65 only
7185
$ sudo pigpiod -n localhost -n 192.168.1.65 # allow localhost and 192.168.1.65 only
7286
73-
To automate running the daemon at boot time, run:
74-
75-
.. code-block:: console
87+
.. note::
7688

77-
$ sudo systemctl enable pigpiod
89+
Note that running ``sudo pigpiod`` will not honour the Remote GPIO
90+
configuration setting (i.e. without the ``-n`` flag it will allow remote
91+
connections even if the remote setting is disabled), but ``sudo systemctl
92+
enable pigpiod`` or ``sudo systemctl start pigpiod`` will not allow remote
93+
connections unless configured accordingly.
7894

7995
Preparing the control computer
8096
==============================

0 commit comments

Comments
 (0)