I'm tring to build Home automation app, and I try to find ( unsuccessfully ) any code/ documentation for controling GPIO's of other RPI's, using Python.
Any leads ?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.
Sign up to join this communityI'm tring to build Home automation app, and I try to find ( unsuccessfully ) any code/ documentation for controling GPIO's of other RPI's, using Python.
Any leads ?
pigpio allows for the control of multiple Pi's GPIO from one or more Pis.
Your Python program must import pigpio and create one or more instances of the pigpio.pi class. This class gives access to a specified Pi's GPIO.
Example
pi1 = pigpio.pi() # pi1 accesses the local Pi's GPIO
pi2 = pigpio.pi('tom') # pi2 accesses tom's GPIO
pi3 = pigpio.pi('dick') # pi3 accesses dick's GPIO
pi1.write(4, 0) # set local Pi's GPIO 4 low
pi2.write(4, 1) # set tom's GPIO 4 to high
pi3.read(4) # get level of dick's GPIO 4
man pigpio
. If that works it means pigpio is installed. If not, for Raspbian, use sudo apt-get install pigpio python-pigpio python3-pigpio
. For other distributions use the instructions at abyz.co.uk/rpi/pigpio/download.html.
from gpiozero.pins.pigpiod import PiGPIOPin
and need to run a daemon pigpiod
. if so - what is the difference ?
As @Steve Robillard commented- the answer is found in: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=160310
or more specific answer( from his link ) http://bennuttall.com/whats-new-gpio-zero-v1-3/