How to setup Kiosk using Raspberry Pi 4

There are many open-source and paid versions out there to set up kiosks.  I have set this up on Raspberry Pi version 1, 2, 3, and now 4.  It’s a very simple setup, I am going to set the website URL default to loading when Raspberry Pi 4 boots up, but you can change it to whatever you like, it could be a slide show, video, etc.….  You can even use it as Signage, there are some others out there that are better for Signage so it gives you preconfigured.

What you will need:

  • Raspberry Pi 4 (you can use an older version too, your settings may be different)
  • SD memory card 8GB or larger
  • Network connection LAN or WiFi
  • Terminal to SSH to Raspberry or run the command on the Raspberry
  • Unzip program and image burner software

Sections:

Update Raspberry Pi 4

Create a script file

Adding script file to auto-start when Raspberry Pi boots up

Enable SSH

common issues and solutions:

Download the “Raspbian Buster with desktop” or if you want the one with an application you can do so as well it’s Raspbian Buster with desktop and recommended software image, then you will need to unzip the download file.  If your computer doesn’t have the unzip program you can download the 7zip from https://www.7-zip.org/download.html

Next, you will need the image burner software, if you have one use it or download this one https://www.balena.io/etcher/, it supports many operating systems including Windows, Linux, macOS, and Portable.  Or https://sourceforge.net/projects/win32diskimager/ it’s a little outdated, but still works.

Download Raspbian Buster with desktop: https://www.raspberrypi.org/downloads/raspbian/

Once you have downloaded and used one of the image burner software to burn into SD card, then put in the Raspberry Pi 4 and start it up and if everything goes well you should see, click Next to go through basic settings

Welcome to Raspberry Pi

Set your local Country, Language and Timezone, then click Next

Set Country, Language and Timezone

Change Default Password, enter new password and click Next

Change Default password

Setup up screen settings, You may need this to enable or disabled, click Next

Set Up Screen

Select WiFi Network or click skip

Select WiFi Network

Update Software, you can skip or let it search and install

Update Software

Running very good even while searching for updates, see Task Manger

Task Manager

Once it’s finished searching, installing new updates or if you skipped you will see option to restart, click restart so all settings takes effects

Setup Complete

Once the Raspberry Pi 4 restarts, open the Chromium once so it creates the Default/Preferences automatic, then just close it

Update the Raspberry Pi 4:

sudo apt update && sudo apt upgrade

Create a script file:

Now setting up the script file, you can name it whatever you like: example StartApp.sh, inside copy and paste this code and change the URL to whatever you like

!/bin/bash
# If Chromium crashes (usually due to rebooting), clear the crash flag so we don't have the annoying warning bar
# waits for 10 seconds before opening URL
# To disable screen saver timeout
xset s 0
# To disabled Monitor going to sleep
xset -dpms
# clean up if the power or ssh in and poweroff or if hostname changes
rm -rf ~/.config/chromium/Singleton*
# Waits for 10 seconds before starting up
sleep 10
# Make sure to change the user name if it's not default pi
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/'  /home/pi/ .config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/'  /home/pi/.config/chromium/Default/Preferences
chromium-browser --kiosk --disable-restore-session-state --disable-session-crashed-bubble --noerrordialogs --disable-infobars http://YourURL.com

You can add other options –no-default-browser-check –no-first-run that you like to prevent from pop up

Now make the .sh file executable:

chmod +x name_of_file.sh

Adding script file to auto-start when Raspberry Pi boots up

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

@lxpanel –profile LXDE-pi
@pcmanfm –desktop –profile LXDE-pi
@xscreensaver -no-splash
# add the following, if your script file located other location then the root of the user, then you will need to put the path

sh StartAuto.sh

autostart

Other setting you may need to change so it runs smooth, without any issue:

If you want to enable SSH, so you can make changes via Remote:

sudo systemctl enable ssh
sudo systemctl start ssh

That’s it

common issues and solutions:

To remove the Mouse pointer:
sudo apt-get install unclutter

Preventing Sleep of Monitor:
it’s already included in the script file, but just in case you need to change it
sudo nano /etc/lightdm/lightdm.conf
In that file, look for:
[SeatDefault] or [Seat:*]
#uncomment and insert -s 0 dpms:
xserver-command=X -s 0 dpms

If you need to fill your screen, you will need to disable the Overscan:
raspi-config
once it loads, choose Advanced Options> Next, choose Overscan:

To Disable chromium update message:
sudo touch /etc/chromium-browser/customizations/01-disable-update-check;echo CHROMIUM_FLAGS=\”\${CHROMIUM_FLAGS} –check-for-update-interval=31536000\” | sudo tee /etc/chromium-browser/customizations/01-disable-update-check

To check the monitor resolution settings currently set to:

/opt/vc/bin/tvservice -s
Should display something like this:
state 0xa [HDMI CUSTOM RGB lim 16:9], 1920×1080 @ 60.00Hz, progressive

To check what’s available settings for your monitor:

/opt/vc/bin/tvservice -m DMT
You should see something like this:
Group DMT has 12 modes:
mode 4: 640×480 @ 60Hz 4:3, clock:25MHz progressive
mode 5: 640×480 @ 72Hz 4:3, clock:31MHz progressive
mode 6: 640×480 @ 75Hz 4:3, clock:31MHz progressive
mode 8: 800×600 @ 56Hz 4:3, clock:36MHz progressive
mode 9: 800×600 @ 60Hz 4:3, clock:40MHz progressive
mode 10: 800×600 @ 72Hz 4:3, clock:50MHz progressive
mode 11: 800×600 @ 75Hz 4:3, clock:49MHz progressive
mode 16: 1024×768 @ 60Hz 4:3, clock:65MHz progressive
mode 17: 1024×768 @ 70Hz 4:3, clock:75MHz progressive
mode 18: 1024×768 @ 75Hz 4:3, clock:78MHz progressive
mode 35: 1280×1024 @ 60Hz 5:4, clock:108MHz progressive
mode 39: 1360×768 @ 60Hz 16:9, clock:85MHz progressive

Or
/opt/vc/bin/tvservice -m CEA
You should see something like this:
Group CEA has 10 modes:
mode 1: 640×480 @ 60Hz 4:3, clock:25MHz progressive
mode 2: 720×480 @ 60Hz 4:3, clock:27MHz progressive
mode 3: 720×480 @ 60Hz 16:9, clock:27MHz progressive
mode 4: 1280×720 @ 60Hz 16:9, clock:74MHz progressive
mode 5: 1920×1080 @ 60Hz 16:9, clock:74MHz interlaced
mode 6: 720×480 @ 60Hz 4:3, clock:27MHz x2 interlaced
mode 7: 720×480 @ 60Hz 16:9, clock:27MHz x2 interlaced
(prefer) mode 16: 1920×1080 @ 60Hz 16:9, clock:148MHz progressive
mode 32: 1920×1080 @ 24Hz 16:9, clock:74MHz progressive
mode 34: 1920×1080 @ 30Hz 16:9, clock:74MHz progressive



How to install Ubuntu 18.04 Desktop

How to install Ubuntu 18.04 Desktop fresh using Hyper-V manager on Windows 10 Pro to Quick Create. There are many ways to install it, this process is very simple, you could do manual, which requires you to download the Ubuntu 18.04 image, then go through the process of installation. This will give you options to use your Ubuntu virtual desktop and get a feel of Linux system, when not in use, turn it off, so it goes not take resources of your system.

Open your Hyper-V Manger

Right click on Hyper-V host and choose Quick Create …

Then you will get option to select the Operating system, choose Ubuntu 18.04 LTS, and click Craete Virtual Machine. If you want to rename your VM, you could click on More options or you can rename later.

Then it will go through downloading the Ubuntu 18.04 LTS image, depending on your internet speed it may take awhile.

Then it will go through the automatic process of creating VM:

  • Verifying image
  • Extracting disk from an image archive
  • Creating a Hard drive
  • Virtual machine create successfully

Then you should see option to connect to your new Ubuntu 18.04 Desktop, click Connect

Click on Power button or Start to turn on your Ubuntu 18.04 server

You should see starting and then Welcome screen. Select your Language then click Continue

Select Keyboard layout, then click Continue

Select your Timezone, then click Continue

Fill in the login info, this would be admin account to login to your server, then click Continue

Then it will go through the System configuration automatically

Then you should see login screen enter your user/password created earlier

You should see your New Ubuntu 18.04 Desktop, it gives you few tips on What’s new in Ubuntu, go though and start using your Ubuntu Virtual desktop.

You can start using your Ubuntu 18.04 virtual desktop, see tips and tricks of common things you may find helpful, if this is your first time use of Ubuntu system.

Tips and Tricks:

Remove icon from favorites

Just right click icon you want to remove and choose Remove from Favorites

Opened applications

You will see little dot next to the application, you tell you that application is open.

More than one Application open

You will see more than one little dots, if you click on it, it will give you thumb nail view of and you will be able to switch it or close the application.

To see all opened Applications

Click on the Activities and it will give you thumbnail view of all opened applications, you can switch to it, or close it by click on X.

To see Applications

You can click on 9 dotted icon bottom left hand side, you will see all application or Frequent used

  • Software – where you can install new applications
  • Software & Updates – Where you can install updates and third-part software options
  • Startup Application – gives you list of application at start of your Ubuntu system
  • Settings – list of all settings like control panel
  • Files – your documents or personal files
  • Rhythmbox – is default music player

Shutdown Ubuntu Virtual Machine

Click on the Arrow on top left, you will see Power icon, if you want to just lock it, click on Lock icon.

When you click on Power icon it will give you option to Restart/Power off or cancel

Change User info

If you need to change user name or any setting, click on the Arrow next to your user name it will give you option to make changes

Change default applications

Click on Settings>Default Applications>Then change it to what you like



How to setup OpenSupports Ticket System

OpenSupports is an open source ticket system, very simple to setup and use. Here I will go through setting up step by step. I am assuming you have your server is set up with correct permission. You will need to able to create database and upload installation files to your server. The installation has 7 steps it will go through and check requirements, and settings as it goes to the next step. This one is a very very simple Ticket system.

Server Requirements

PHP 5.6+
MySQL 4.1+
PDO Extension
Apache 2.4+

Installation of OpenSupports

You can start by downloading the OpenSupports ticket system from https://www.opensupports.com/download/

Once you have download the OpenSupports ticket system, then upload to your server and go to URL of your OpenSupports, you should see Step 1 of 7 Select the language and click Next

Then it will check for the Server requirements, if you see any error or missing requirement, install it then click Refresh, once all good, then click Next

You can fill in MySQL server info, at this point create a database if you have not yet, then fill in info below and click Next

  • MySQL database name: this can be left blank and it will generate automatic
  • MySQL server port (this can be left blank (default port is 3306)
  • MySQL user:
  • MySQL password:

Then select the option if you want your user to access and be able to register it, it’s toggle on/off, make selection, then click Next

Fill in the name of your ticket system, Check box if you want your user to attach a file to ticket and email server info (option to confirm SMTP connection test, to make sure your email server can communicate), then click Next

Admin account name, email and password, fill in info, make sure it’s strong and keep it safe, you will use this account to make changes to your system. Once you have filled in info, click Next
Then it will go through installation and redirect to login page

This is login page where you will enter your admin login info you choose in your last step.
User URL will be yourdomain
Admin URL will be yourdomain/admin

Once you are logged in you will see Dashboard of your new Ticket System, where you can make changes, add user/agents, etc…

That’s it, very simple ready to use your OpenSupports open source ticket system. If you are looking for more feature you can use another open source ticket system called osTickets, I have written a post on how to install osTicket on Ubuntu, enjoy it



Install open source flat-file CMS Grav on Ubuntu

Grav is open source flat-file CMS which means without any needs of the database.  It only has two requirements web server like Apache, Nginx, IIS, etc … and PHP 5.6.3 or higher.  It uses Markdown for formatting syntax and it automatically converts to HTML.  It also has a Normal or Expert mode for editing content.  I am installing this on Ubuntu 16.04, but it should work just fine with other versions of Ubuntu as long as you meet the server/PHP requirement.  Also, Grav have two options when you download Grav core or Grav Core + admin plugin, I am using installing with Admin plugin to get more options.

Installation is very easy, once you have the web server of your choice and PHP version meets the requirement.

Download the Grav from https://getgrav.org/downloads and extract it then upload it to your web server

Then just go to your Domain URL and you should see the following screen, where you fill in your admin information and click Create User

If everything goes well it should bring you to Dashboard screen, this is your admin screen, where you will be able to add, delete, and make changes to your Grav CMS.  Also before you do anything click Backup and it will automatically back up for you.

This is default home page of Grav after fresh installation

If you want to edit your page to your Grav CMS login to admin (YourDomain/admin)
To edit Home Page, click on Pages>click Home

Now you should be to edit Content and click on the other tabs to see more options, Advance and Mode type Normal/Expert.

After the installing you may need to upgrade, just click on the Update on your dashboard and click continue

Back to your dashboard you should see fully updated, otherwise click check for updates

That’s it, enjoy it



osTicket installation on Ubuntu 16.04

osTicket is one of the great open source support system, very easy to install and use.  I have noted the whole process, short version, and detailed version.  What you will need from start to finish.  This installation is fresh, without any add-ons or any customization osTicket version 1.10.1.  I have written this installation based on Ubuntu 16.04 with Apache as a web server, it may work just fine with other versions of Ubuntu servers or similar to other flavors of Linux systems.  Assuming you have your web server and domain up and running without any issues.  So, let’s get started

What you will need

  • Server requirements:  You can get up to date from official docs from osTicket very well documented
    • PHP 5.6 (or better I am going to be using PHP7.0)
    • MySQL 5.0 (or better)
    • 2GB memory recommended 4GB or more
  • Access to web/database server via SSH
  • Access to site file via (FTP, SFT, GUI, SSH, etc. …)

Getting server ready to install osTicket:

Installing requirements, you may need to run add this to repository void error, log in to your web server via SSH

Commands:
sudo apt-add-repository ppa:ondrej/php
sudo apt-get install php7.0-gd php7.0-imap php7.0-xml php7.0-mbstring php7.0-intl phpapcu

Downloading osTicket:

https://osticket.com/download/
Once you have downloaded then extract it or upload it to your web server common location: /var/www/

Then set the permission:

commands: make sure to change /var/www/ to your path
sudo chown -R www-data:www-data /var/www/

Click Continue once you have fixed any issues, please correct it before going forward

Setup osTicket Database and give full permission using whichever tool you are comfortable with it, then fill in details and click Install now

if everything went well you should see Congratulation, then just change the permission of your config file

You should be able to login to your osTicket support system with the information you used earlier, see my notes, where I have put in some common issues you may encounter when installing.

Notes and common errors/solution: 

You may need to do these if you get errors or other settings changes


If you have not copied the ost-sampleconfig.php to include/ost-config.php
then you will get the following message


You will also need to make sure that ost-config.php has correct permission, otherwise, you will get this message:


if you have already installed the PHP IMAP extension and still gives you an error, take a look at your php.ini file and enable it by uncommenting /etc/php/php.ini:
;extension=imap.so
to
extension=imap.so


You may need to restart the web service after making changes to take effect:
sudo systemctl restart apache2


error: Valid CSRF Token Required OsTicket:
then need to edit file class.ostsession.php round line 191
catch (DoesNotExist $e) {
$this->data = new SessionData([‘session_id’ => $id]);
$this->data->session_data = “”;


error: Php 7.2 compatibility issue (not recommended to use this version of PHP on osTicket 1.10.1 or 1.10.4, it should support on new version 1.11)
then need to edit file class.ostsession.php round line 197

if(!is_string($this->data->session_data)) { $this->data->session_data = strval($this->data->session_data);

}


These commands to install PHP version 7.0 extensions manually one at a time:
Sudo apt-get install php7.0-gd
Sudo apt-get install php7.0-imap
Sudo apt-get install php7.0-xml
Sudo apt-get install php7.0-mbstring
Sudo apt-get install php7.0-intl
Sudo apt-get install php-apcu


Make sure to protect your ost-config after the installation by changing the permission:
sudo chmod 0644 /var/www/include/ost-config.php