en:python_gpio_polling_howto  

FIXME This page is not fully translated, yet. Please help completing the translation.
(remove this paragraph once the translation is finished)

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 status 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'
en/python_gpio_polling_howto.txt · Last modified: 2022/01/22 12:13 by Dmitriy