From d846d5b2bdcae2ed4986ef3638331c79e82172ae Mon Sep 17 00:00:00 2001 From: Ben Nuttall Date: Fri, 10 Mar 2017 15:05:33 +0000 Subject: [PATCH] Fix broken internal links and use apt over apt-get --- docs/index.rst | 3 ++- docs/installing.rst | 28 ++++++++++++++-------------- docs/notes.rst | 8 ++++---- docs/recipes_advanced.rst | 6 +++--- docs/remote_gpio.rst | 31 +++++++++++++++++++------------ 5 files changed, 42 insertions(+), 34 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 262eac0..5ff29db 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,7 +8,7 @@ Table of Contents recipes notes - contributing + installing api_input api_output api_spi @@ -22,5 +22,6 @@ Table of Contents remote_gpio recipes_advanced recipes_remote_gpio + contributing changelog license diff --git a/docs/installing.rst b/docs/installing.rst index 2777540..30c80a5 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -2,39 +2,39 @@ Installing GPIO Zero ==================== -GPIO Zero is installed by default in `Raspbian Jessie`_ and `PIXEL x86`_, available -from `raspberrypi.org`_. Follow these guides to installing on other operating -systems, including for PCs using the :doc:`remote_gpio` feature. +GPIO Zero is installed by default in `Raspbian Jessie`_ and `PIXEL x86`_, +available from `raspberrypi.org`_. Follow these guides to installing on other +operating systems, including for PCs using the :doc:`remote_gpio` feature. Raspberry Pi ============ First, update your repositories list:: - sudo apt-get update + sudo apt update Then install the package for Python 3:: - sudo apt-get install python3-gpiozero + sudo apt install python3-gpiozero or Python 2:: - sudo apt-get install python-gpiozero + sudo apt install python-gpiozero Linux ===== First, update your distribution's repositories list. For example:: - sudo apt-get update + sudo apt update Then install pip for Python 3:: - sudo apt-get install python3-pip + sudo apt install python3-pip or Python 3:: - sudo apt-get install python-pip + sudo apt install python-pip (Alternatively, install pip with `get-pip`_.) @@ -75,8 +75,8 @@ Next, install gpiozero with pip:: pip install gpiozero -.. Raspbian Jessie_: https://www.raspberrypi.org/downloads/raspbian/ -.. PIXEL x86_: https://www.raspberrypi.org/blog/pixel-pc-mac/ -.. raspberrypi.org_: https://www.raspberrypi.org/downloads/ -.. get-pip_: https://pip.pypa.io/en/stable/installing/ -.. GitHub: https://github.com/RPi-Distro/python-gpiozero/issues +.. _Raspbian Jessie: https://www.raspberrypi.org/downloads/raspbian/ +.. _PIXEL x86: https://www.raspberrypi.org/blog/pixel-pc-mac/ +.. _raspberrypi.org: https://www.raspberrypi.org/downloads/ +.. _get-pip: https://pip.pypa.io/en/stable/installing/ +.. _GitHub: https://github.com/RPi-Distro/python-gpiozero/issues diff --git a/docs/notes.rst b/docs/notes.rst index d207ae6..97a650f 100644 --- a/docs/notes.rst +++ b/docs/notes.rst @@ -82,15 +82,15 @@ version of gpiozero is available in your Python environment like so:: >>> require('gpiozero')[0].version '1.2.0' -If you have multiple versions installed (e.g. from ``pip`` and ``apt-get``) -they will not show up in the list returned by the ``require`` method. However, -the first entry in the list will be the version that ``import gpiozero`` will +If you have multiple versions installed (e.g. from ``pip`` and ``apt``) they +will not show up in the list returned by the ``require`` method. However, the +first entry in the list will be the version that ``import gpiozero`` will import. If you receive the error "No module named pkg_resources", you need to install the ``pip`` utility. This can be done with the following command in Raspbian:: - $ sudo apt-get install python-pip + $ sudo apt install python-pip Alternatively, install pip with `get-pip`_. diff --git a/docs/recipes_advanced.rst b/docs/recipes_advanced.rst index 6f9996c..bb99583 100644 --- a/docs/recipes_advanced.rst +++ b/docs/recipes_advanced.rst @@ -1,6 +1,6 @@ -================ -Recipes (Simple) -================ +================== +Recipes (Advanced) +================== .. currentmodule:: gpiozero diff --git a/docs/remote_gpio.rst b/docs/remote_gpio.rst index f8c35a2..d74408f 100644 --- a/docs/remote_gpio.rst +++ b/docs/remote_gpio.rst @@ -25,7 +25,7 @@ If you're using Raspbian Jessie (desktop - not Jessie Lite) then you have everything you need to use the remote GPIO feature. If you're using Jessie Lite, or another distribution, you'll need to install pigpio:: - sudo apt-get install pigpio + sudo apt install pigpio Then you just need to enable **Remote GPIO** in the Raspberry Pi configuration tool: @@ -38,6 +38,13 @@ Then launch the pigpio daemon:: sudo pigpiod +To only allow connections from a specific IP address, use the ``-n`` flag. For +example: + + 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 + You will need to launch the pigpio daemon every time you wish to use this feature. To automate running the daemon at boot time: @@ -48,23 +55,23 @@ Preparing the host computer If the host computer is a Raspberry Pi running Raspbian Jessie (or a PC running x86 PIXEL), then you have everything you need. If you're using another Linux -distribution, Mac OS or Windows then you'll need to install the pigpio Python -library on the PC. +distribution, Mac OS or Windows then you'll need to install the ``pigpio`` +Python library on the PC. Raspberry Pi ------------ First, update your repositories list:: - sudo apt-get update + sudo apt update Then install the pigpio library for Python 3:: - sudo apt-get install python3-pigpio + sudo apt install python3-pigpio or Python 2:: - sudo apt-get install python-pigpio + sudo apt install python-pigpio Alternatively, install with pip:: @@ -79,15 +86,15 @@ Linux First, update your distribution's repositories list. For example:: - sudo apt-get update + sudo apt update Then install pip for Python 3:: - sudo apt-get install python3-pip + sudo apt install python3-pip or Python 2:: - sudo apt-get install python-pip + sudo apt install python-pip (Alternatively, install pip with `get-pip`_.) @@ -224,6 +231,6 @@ Pi Zero ??? -.. RPi.GPIO_: https://pypi.python.org/pypi/RPi.GPIO -.. pigpio_: http://abyz.co.uk/rpi/pigpio/python.html -.. get-pip_: https://pip.pypa.io/en/stable/installing/ +.. _RPi.GPIO: https://pypi.python.org/pypi/RPi.GPIO +.. _pigpio: http://abyz.co.uk/rpi/pigpio/python.html +.. _get-pip: https://pip.pypa.io/en/stable/installing/