tgillett
We have a number of T95 Max devices that run the Quadra firmware. They are used in remote school locations as Digital Libraries and they are doing a great job. They are normally run "headless" without monitor and keyboard, with students connected by wifi and accessing content via web browser. The lighttpd web server package is installed.

When we "Shutdown" the device from the GUI, the device stops running after a few seconds (the spinning logo stops).
The blue light stays on and the power draw drops to about half the normal running power.
It will continue to draw this power indefinitely, and requires a power cycle to restart the Quadra operating system.

We ask users to do this shutdown process if possible, then switch off the power.
The alternative is just a hard power down, which I fear will end up corrupting the system.

This safe shutdown process requires monitor and keyboard, and users have to be patient and wait for the spinning logo to stop before switching off the power to be sure of safe shutdown.

With the original Android TV box firmware running on the device, you can switch the power off from the remote control, and the device stops running and the power draw drops to essentially zero.  It can be restarted be either pushing the power button on the remote or power cycling.

I would like to improve two things about the Quadra shutdown operation if possible:

1. Is it possible to use the shutdown mechanism from the TV Box firmware to make the device go into the very low power mode?
This would mean there is no need for users to wait and switch off the power, just cycle the power later to restart.

2. Is there a (clever) way to trigger a safe shutdown process on a headless device (in the absence of any buttons to push)?
  (Perhaps using a 'shutdown' web page...)

Thanks in advance for any ideas.
Michael Burmeister-Brown inovato
The Armbian site might be a good place to search for this.  I don’t know if anything at this point.  Having said that, I usually just do a ‘sync’ command before pulling power.  
Reply 0 0
tgillett
Thanks Michael.

I have a simple web page working to do the sync and shutdown, so that addresses the main 'headless' device issue.

It would be a 'nice to have' to be able to use the low power down mode used by the Android software. I don't suppose there any information available around this feature, or circuit schematic that might give a hint?
Reply 0 0
Michael Burmeister-Brown inovato
Nothing I know of.  The TV Box we use doesn't have a lot of info.  You could check on Armbian for T95 mini low power shutdown to see if anyone has found anything.
Reply 0 0
tgillett
For anyone interested in the details of implementing a web page for remote safe shutdown of a headless Quadra, the following is what we have set up for our systems.


1. Install lighttpd:
$ sudo apt install lighttpd


2. Check the installation to see the default lighttpd installation page at: http://localhost

3. Enable CGI in the lighttpd web server
$ sudo lighty-enable-mod cgi
$ service lighttpd force-reload


4. Edit the sudoers file to allow the lighttpd 'www-data' user to execute some privileged commands without password:
$ sudo visudo


Add the following lines after the existing line for the "quadra" user:

www-data ALL=(ALL) NOPASSWD: /usr/bin/redon
www-data ALL=(ALL) NOPASSWD: /usr/bin/blueon
www-data ALL=(ALL) NOPASSWD: /usr/sbin/shutdown


5. Create the CGI script for the "shutdown" web page:
$ sudo nano /usr/lib/cgi-bin/shutdown 


Add these lines to the new file:

#!/bin/bash

echo "Content-type: text/html"
echo ""

echo '<html>'
echo '<head>'
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">'
echo '<title>Quadra Shutdown</title>'
echo '</head>'
echo '<body>'

echo '<h1> Quadra Shutdown </h1>'
date

echo '<p>Starting sync.'
sudo /usr/bin/redon
sync
sleep 1
echo '<p>Finished sync.'

sudo /usr/bin/blueon
sleep 1
echo 'Starting shutdown.'
echo '<p>Safe to power off in 10 seconds'
sudo /usr/bin/redon
(sleep 1; sudo /usr/sbin/shutdown 0) &

echo '</body>'
echo '</html>'

exit 0



6. Set execute permission on the CGI script:
$ sudo chmod +x /usr/lib/cgi-bin/shutdown


7. Shutdown Operation
To shudown the system, point the local web browser to:
http://localhost/cgi-bin/shutdown 


Or a remote browser to:
http://<IP_Address>/cgi-bin/shutdown


The LED will change from blue to red while the sync operation is done,
then back to blue, then to red as the shutdown operation is done.
The browser will then display the details of the shutdown.
It is safe to power down the system after 10 seconds.
Reply 1 0
Reply