{"guid":"72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","title":"Python, asyncio, libgpiod, and Pointless Blinking","subtitle":null,"slug":"glt24-435-python-asyncio-libgpiod-and-pointless-blinking","link":"https://pretalx.linuxtage.at/glt24/talk/7XWWLC/","description":"Python's lovely [asyncio](https://docs.python.org/3/library/asyncio.html) library allows me to write event-driven programs in a style that looks much like multithreaded code but isn't. Combining [asyncio](https://docs.python.org/3/library/asyncio.html) with the equally lovely [Linux GPIO subsystem](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git) is just another logical step. In this talk I show what [asyncio](https://docs.python.org/3/library/asyncio.html) is, how [libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git) works, and how both are used to do pointless projects.\n\nContinuing the [story of pointlessly blinking lights](https://www.faschingbauer.me/about/site/work-in-progress/blink/glt2023/index.html) from my last year's talk, I show\n\n* How GPIO interrupts are configured to get notified of hardware button presses, and how this can look like in Python (hint: *generators*, and *iteration*).\n* How button-events can be used in an ``async`` programming style   (hint: *asyncronous generators*, and ``async for``).\n* How this fits into the pointless project of blinking lights.\n\nAdditionally, I give an overview of async libraries that are more to the point, like\n\n* [Textual](https://textual.textualize.io), a terminal UI framework\n* [python-sdbus](https://github.com/python-sdbus/python-sdbus), the Python binding for the systemd D-Bus client implementation\n\n\"Slide\" material available on [my homepage](https://www.faschingbauer.me/about/site/work-in-progress/blink/glt2024/index.html)","original_language":"eng","persons":["Jörg Faschingbauer"],"tags":["glt24","435","2024","Hardware"],"view_count":145,"promoted":false,"date":"2024-04-06T14:00:00.000+02:00","release_date":"2024-04-06T00:00:00.000+02:00","updated_at":"2026-04-08T00:30:05.313+02:00","length":2704,"duration":2704,"thumb_url":"https://static.media.ccc.de/media/events/glt/2024/435-72bfe961-27ec-5d1d-bd20-0eb3c159b2dd.jpg","poster_url":"https://static.media.ccc.de/media/events/glt/2024/435-72bfe961-27ec-5d1d-bd20-0eb3c159b2dd_preview.jpg","timeline_url":"https://static.media.ccc.de/media/events/glt/2024/435-72bfe961-27ec-5d1d-bd20-0eb3c159b2dd.timeline.jpg","thumbnails_url":"https://static.media.ccc.de/media/events/glt/2024/435-72bfe961-27ec-5d1d-bd20-0eb3c159b2dd.thumbnails.vtt","frontend_link":"https://media.ccc.de/v/glt24-435-python-asyncio-libgpiod-and-pointless-blinking","url":"https://api.media.ccc.de/public/events/72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","conference_title":"Grazer Linuxtage 2024","conference_url":"https://api.media.ccc.de/public/conferences/glt24","related":[],"recordings":[{"size":348,"length":2704,"mime_type":"video/webm","language":"eng","filename":"glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_webm-hd.webm","state":"new","folder":"webm-hd","high_quality":true,"width":1920,"height":1080,"updated_at":"2024-04-07T10:23:08.952+02:00","recording_url":"https://cdn.media.ccc.de/events/glt24/webm-hd/glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_webm-hd.webm","url":"https://api.media.ccc.de/public/recordings/77047","event_url":"https://api.media.ccc.de/public/events/72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","conference_url":"https://api.media.ccc.de/public/conferences/glt24"},{"size":128,"length":2704,"mime_type":"video/webm","language":"eng","filename":"glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_webm-sd.webm","state":"new","folder":"webm-sd","high_quality":false,"width":720,"height":576,"updated_at":"2024-04-06T21:41:00.746+02:00","recording_url":"https://cdn.media.ccc.de/events/glt24/webm-sd/glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_webm-sd.webm","url":"https://api.media.ccc.de/public/recordings/77018","event_url":"https://api.media.ccc.de/public/events/72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","conference_url":"https://api.media.ccc.de/public/conferences/glt24"},{"size":87,"length":2704,"mime_type":"video/mp4","language":"eng","filename":"glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_sd.mp4","state":"new","folder":"h264-sd","high_quality":false,"width":720,"height":576,"updated_at":"2024-04-06T16:45:07.388+02:00","recording_url":"https://cdn.media.ccc.de/events/glt24/h264-sd/glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_sd.mp4","url":"https://api.media.ccc.de/public/recordings/76949","event_url":"https://api.media.ccc.de/public/events/72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","conference_url":"https://api.media.ccc.de/public/conferences/glt24"},{"size":25,"length":2704,"mime_type":"audio/opus","language":"eng","filename":"glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_opus.opus","state":"new","folder":"opus","high_quality":false,"width":0,"height":0,"updated_at":"2024-04-06T16:37:55.347+02:00","recording_url":"https://cdn.media.ccc.de/events/glt24/opus/glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_opus.opus","url":"https://api.media.ccc.de/public/recordings/76947","event_url":"https://api.media.ccc.de/public/events/72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","conference_url":"https://api.media.ccc.de/public/conferences/glt24"},{"size":41,"length":2704,"mime_type":"audio/mpeg","language":"eng","filename":"glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_mp3.mp3","state":"new","folder":"mp3","high_quality":false,"width":0,"height":0,"updated_at":"2024-04-06T16:37:36.675+02:00","recording_url":"https://cdn.media.ccc.de/events/glt24/mp3/glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_mp3.mp3","url":"https://api.media.ccc.de/public/recordings/76946","event_url":"https://api.media.ccc.de/public/events/72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","conference_url":"https://api.media.ccc.de/public/conferences/glt24"},{"size":265,"length":2704,"mime_type":"video/mp4","language":"eng","filename":"glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_hd.mp4","state":"new","folder":"h264-hd","high_quality":true,"width":1920,"height":1080,"updated_at":"2024-04-06T16:37:33.436+02:00","recording_url":"https://cdn.media.ccc.de/events/glt24/h264-hd/glt24-435-eng-Python_asyncio_libgpiod_and_Pointless_Blinking_hd.mp4","url":"https://api.media.ccc.de/public/recordings/76945","event_url":"https://api.media.ccc.de/public/events/72bfe961-27ec-5d1d-bd20-0eb3c159b2dd","conference_url":"https://api.media.ccc.de/public/conferences/glt24"}]}