Closed joerick closed 8 years ago
I'm seeing some strange behaviour when running a daemon that's looking at the buttons as well as apps. When launched, the daemon app see buttons events fine. But if you kill the app and relaunch it, the daemon doesn't see the events anymore.
I wonder if RPIO (in the apps) is cleaning up after itself and unregistering the pins as inputs when it quits...
Looks likely. https://github.com/tingbot/RPIO/blob/master/source/RPIO/_RPIO.py#L331 Also, apps that don't use the buttons can relaunch and the daemon stays responsive.
Moved to wiringpi, where cleanup is explicit, which works better for our uses. Implemented in tingbot/tbprocessd@bd27013349bcc41fa149bf4660b936b0d960c8ee, service file and wiringpi dependency added.
Make a daemon that observes the current state of the buttons - if the combo for 'home' is pressed (think it'll be both middle buttons together), send the appropriate message to tbprocessd:
tbopen /apps/home
. Auto start using a systemd conf.