Warning Cookies are used on this site to provide the best user experience. If you continue, we assume that you agree to receive cookies from this site. OK

How to monitor GPIO status with python

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

Download this utility:

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

For the utility to work, you need to install gpiod:

 cd gpio-polling
pip3 install -r requirements.txt

An example of monitoring the state of a custom button on the JetHome D1 controller and turning on the green LED when the button is pressed:

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