tingbot / tingbot-os

📦 The Tingbot operating system
http://tingbot.com
37 stars 14 forks source link

tbbuttonsd #6

Closed joerick closed 8 years ago

joerick commented 8 years ago

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.

joerick commented 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.

joerick commented 8 years ago

I wonder if RPIO (in the apps) is cleaning up after itself and unregistering the pins as inputs when it quits...

joerick commented 8 years ago

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.

joerick commented 8 years ago

Moved to wiringpi, where cleanup is explicit, which works better for our uses. Implemented in tingbot/tbprocessd@bd27013349bcc41fa149bf4660b936b0d960c8ee, service file and wiringpi dependency added.