Skip to content

Commit

Permalink
Correct and clarify pigpiod/systemctl usage, close #586
Browse files Browse the repository at this point in the history
  • Loading branch information
bennuttall committed Feb 20, 2018
1 parent 8d93860 commit 67b4c8e
Showing 1 changed file with 37 additions and 21 deletions.
58 changes: 37 additions & 21 deletions docs/remote_gpio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,50 +31,66 @@ another distribution, you'll need to install pigpio:
Alternatively, pigpio is available from `abyz.me.uk`_.

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

Desktop
-------
Enable remote connections
-------------------------

On the Raspbian desktop image, enable **Remote GPIO** in the Raspberry Pi
configuration tool:
On the Raspbian desktop image, you can enable **Remote GPIO** in the Raspberry
Pi configuration tool:

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

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

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

Alternatively, enter ``sudo raspi-config`` on the command line, and enable
Remote GPIO. This will also launch the pigpio daemon automatically.
Command-line: systemctl
-----------------------

To automate running the daemon at boot time, run:

.. code-block:: console
$ sudo systemctl enable pigpiod
Command-line: manual
--------------------
To run the daemon once using ``systemctl``, run:

.. code-block:: console
$ sudo systemctl start pigpiod
Command-line: pigpiod
---------------------

Another option is to launch the pigpio daemon manually:

.. code-block:: console
$ sudo pigpiod
This is for single-use and will not persist after a reboot. However, this method
can be used to allow connections from a specific IP address, using the ``-n``
flag. For example:
This is for single-session-use and will not persist after a reboot. However,
this method can be used to allow connections from a specific IP address, using
the ``-n`` flag. For example:

.. code-block:: console
$ sudo pigpiod -n localhost # allow localhost only
$ sudo pigpiod -n 192.168.1.65 # allow 192.168.1.65 only
$ sudo pigpiod -n localhost -n 192.168.1.65 # allow localhost and 192.168.1.65 only
To automate running the daemon at boot time, run:

.. code-block:: console
.. note::

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

Preparing the control computer
==============================
Expand Down

0 comments on commit 67b4c8e

Please sign in to comment.