Project Home‎ > ‎Documentation‎ > ‎Interfaces‎ > ‎Raspberry Pi‎ > ‎

RpiGpioRemote

The RpiGpioRemote is configured similar to the RpiGpio interface except it includes a few parameters to start
a server on a specific IP address and IP port.  It also supports ssl encryption and shared secret support.
All configuration options for the GPIO pins is done as per normal, in your Instance file.  The client will run, connect
to Pytomation and get all it's configuration options from the server.


Instance file configuration:

1) Include RpiGpioRemote in your import like so.
from pytomation.interfaces import Serial, InsteonPLM, PhilipsHue, \
                                StateInterface, Command, PytoWebSocketServer, RpiGpioRemote


2) Define an instance of the interface.
rpi = RpiGpioRemote(address='0.0.0.0', port=8088, pin_layout='BCM', secret='my shared secret')

The ip address of 0.0.0.0 should ideally be the address of the interface you are serving from, but 0.0.0.0 will work as well.
You can check the documentation for complete details.

3) Set the direction and options of the GPIO pins
rpi.setPin(17, 'IN', pud='PULL_UP', invert=True)
rpi.setPin(23, 'IN', pud='PULL_DOWN', invert=False)
rpi.setPin(26, 'OUT', init='LOW')

Here is and input and output example:
d_mt = Door(17,rpi,name='testy')

l_mtl = Light(address=26, devices=(rpi,), name='me test')

Subpages (1): Remote client
Comments