Changes

Jump to: navigation, search

XELK-TN-001: Using Chromium browser as an Embedded GUI

1,230 bytes added, 12:55, 3 October 2019
How to configure
== How to configure ==
 
=== Web server ===
Apache2 is used as a web server let the embedded system to provide the HTML pages used for creating the GUI. Once installed into the rfs, <code>apache2</code> will be automatically started using the following configuration file:
 
/etc/apache2/httpd.conf
 
It is possible to see that apache2 uses the web page present into the ''/usr/share/apache2/htdocs'' directory:
 
root@imx6qxelk:~# cat /etc/apache2/httpd.conf | grep htdocs
DocumentRoot "/usr/share/apache2/htdocs"
<Directory "/usr/share/apache2/htdocs">
root@imx6qxelk:~#
 
=== PHP ===
For demonstration purposes the PHP info page is loaded as the home page for our web server running on the system:
 
<pre>
root@imx6qxelk:~# cat /usr/share/apache2/htdocs/.htaccess
DirectoryIndex phpinfo.php
root@imx6qxelk:~# cat /usr/share/apache2/htdocs/phpinfo.php
<?php
 
phpinfo();
 
?>
root@imx6qxelk:~#
</pre>
 
In this way, the PHP info page is shown when the web browser is started on localhost.
=== Graphical backend ===
root@imx6qxelk:~#
=== Web server Chromium ===Apache2 is used as a In the same way of the web server let the embedded system to provide the HTML pages used for creating the GUI. Once installed into the rfs, <code>apache2</code> will chormiumcam be automatically started using the following configuration filea proper service:
<pre>root@imx6qxelk:~# cat /etc/apache2systemd/httpdsystem/browser.service[Unit]Description=ChromiumBrowserAfter=network.conftargetStartLimitIntervalSec=0
It is possible to see that apache2 uses the web page present into the ''[Service]Type=simpleRestart=alwaysRestartSec=1User=rootExecStart=/usrhome/shareroot/apache2/htdocs'' directory:browser.sh
root@imx6qxelk:~# cat /etc/apache2/httpd[Install]WantedBy=multi-user.conf | grep htdocstarget DocumentRoot "/usr/share/apache2/htdocs" <Directory "/usr/share/apache2/htdocs"pre> root@imx6qxelk:~#
=== PHP ===For demonstration purposes the PHP info page is loaded as the home page for our web server running on the systemand a script which will be started at boot time:
<pre>
root@imx6qxelk:~# cat /usr/share/apache2/htdocs/.htaccessDirectoryIndex phpinfobrowser.phpshroot@imx6qxelk:~# cat /usr/share/apache2!/htdocsbin/phpinfo.php<?phpbash
phpinfo();export DISPLAY=:0
?>google-chrome --test-type --kiosk -disable-gpu --start-maximized http://localhost:80/phpinfo.php
root@imx6qxelk:~#
</pre>
In this wayAs per the command line parameters, chromium is started with the following properties: * '''Full screen''' mode: <code>--start-maximized</code>* '''Kiosk''' mode: <code>--kiosk</code>* removing warning '''popus''': <code>--test-type</code> For a touch screen interaction, it is possible to install a Virtual Keyboard available on the PHP info page ''chrome Google store. This is shonw as very easy starting chrome on theproper URL and then installing it:  root@imx6qxelk:~# google-chrome https://chrome.google.com/webstore/detail/virtual-keyboard/pflmllfnnabikmfkkaddkoolinlfninn
8,154
edits

Navigation menu