Posts

Showing posts from June, 2019

Button press daemon

As you've seen from my other posts, I have a couple of lamps at home, controlled by homekit. I also have a daemon on the pi that does (slightly inaccurate) PWM to control LEDs for showing the current weather forecast (look around my various blogs or ask here for links if you want to see how each of these works). I've added a couple of useful functions to the daemon and recently upgraded it to be a bit more of a packaged service (see the github page). It's also in it's own repo now. The last feature I added was I wanted some way to capture inputs  not just output voltages. There are already good solutions on the pi, many of them written in python, that will read input pin values, and about 7 years ago, someone patched the kernel to allow interrupt drive, an addition to sysfs to indicate you want to write code that blocks on a device with a poll() or select(). Probably the best solution for most people will be to use this mechanism within their own C program or (eve