Add headless mode
20 Feb 2021
01 - Critical
See RM #743
- Add cli option for headless mode (-H)
- Don't use GUI - switch to glib main loop
- Exit on signals only: SIGQUIT, SIGTERM, SIGHUP and SIGINT.
- Add gpio monitor thread using libgpiod (API docs).
- Momentary button causes SIGUSR1 or SIGUSR2 depending on toggle state
- Requires debounce handling (don't allow toggling to fast).
- Probably requires synchronization with network startup in debounce handling.
- Signal handler
- SIGUSR1 starts imwww for network config
- SIGUSR2 stops imwww and restarts network
- LEDs are flashed depending on state
- 1 second (500ms on/500ms off) blink: imwww is active.
- 2 200ms flashes/second: network is restarting.
- 2s solid followed by 10 200ms flashes followed by no light: normal mode is now active.
- A second LED could be used to show camera active state.