How to monitor GPIO status using python

You can monitor the GPIO status (buttons, digital inputs) on JetHome controllers using the utility: https://github.com/adeepn/gpio-polling

Installing

  1. Download this utility:

git clone https://github.com/adeepn/gpio-polling.git
  1. Establish Dependencies:

cd gpio-polling
pip3 install -r requirements.txt

Working with the utility

Example of monitoring the status of a user button on a JetHome D1 controller and turning on a green LED when the button is pressed:

python3 main.py 0 10 'echo 1>/sys/class/gpio/gpio453/value'

Tip

See https://github.com/adeepn/gpio-polling/blob/master/main.py for an example of working with gpio in python.