I have a python application that logs data from connected sensors. Most of the time it just sits there logging data. If power is lost and regained, I want it to start this application automatically so I don't have to worry about restarting it if something happens. I don't really want to boot to desktop first, because most of the time, I don't care what the data looks like, I'm just logging it. But, I may want to connect a display to it and see what the data looks like every now and again.
If my raspberry pi boots to cmd line and begins this python script automatically, is there a way I can start the desktop without closing the python script? The python script also contains code that shows a User Interface on command but naturally needs the X display to show anything. I don't want to have to stop the logging behavior while I wait for the desktop to boot up. Is this even a possibility?
My ideal usage:
- Start logging data on boot
- Start GUI on keyboard command without closing logging script
- Exit GUI on command (keyboard or GUI controls) without closing logging script so that I'm not wasting resources if no display is required
I appreciate any and all input. Like I said, I don't even know if it's possible to do this.