A Raspberry Pi should be shut down cleanly before removing power to prevent corruption to your SD card..
With TS Dash, this can be done by any of the following:
- Use the Shutdown Manager
- Create an action that is triggered by an expression.
- Sending a key ALT+F5 several seconds before removing power. Alt+5 will immediately cleanly exit TS Dash and shutdown the OS.
The TS Dash Shutdown Manager has the capability of managing a power supply. For example Mausberry circuits offers a power supply for use in cars.
This power supply has 2 pins that connect to the Raspberry Pi. One pin that is held high when the key is on, low if the key is off.
The other Pin must be held high by the Raspberry Pi to keep the power on. The power will remain on only for several 2nds when the pin goes low.
They supply a script to manage these pins, but with TS Dash it is recommended you do not install the script and let TS Dash manage the Pins. This allows TS Dash to perform a clean shutdown of itself and the OS before then letting the pin go low to effectively cut its own throat.
This also allows you to set a period of time before it will shutdown after the key is turned off. I generally have the LCD panel turn off with the key, but set TS Dash to not power down for 30 minutes or so. Sitting idle, the Pi will use very little of your cars battery in 30 minutes, but you will have an instant on dash when you turn your car off, then back on again within that 30 minutes. You may want more or less time, that is configurable in the TS Dash Setup site.
Configuring TS Dash Shutdown Manager
With your TS Dash on the same network as your Laptop, Open TunerStudio. If TunerStudio detects a TS Dash on the same network, it will list it under the Tools menu:
By clicking this menu, the TS Dash setup site will open in your web browser. From there, select the "Pin Management Menu"
At the bottom of the page will be the Shutdown Manager Configuration.
Use an Action to Shutdown cleanly.
An alternate way to shutdown cleanly is to set up an Action in the TS Dash setup site. The shutdown can be triggered by any expression, but the most common would be by a pin state change on the Pi. If you set up an Input Pin to detect a key on condition, and using a delay circuit on the power supply, but at that point you might as well use the Shutdown Manager.
However, this is an option if you come up with some scenario that needs it.