Tuesday, November 7, 2017

Using RPi3 running raspbian-stretch as a KIOSK browser

Initial setup:

  1. Use Win32DiskImager to burn the 2017-09-07-raspbian-stretch.img file to a micro SD card (it will restart itself after the initial boot and partition resizing)
  2. Open the terminal window and type: sudo raspi-config
  3. Use the configuration tool to
    1. Assign a new password for the user "pi" (default originally set to "raspberry")
    2. Set Localisation Options (set all three to your area)
    3. Enable SSH using Interfacing Options
    4. Enable VNC using Interfacing Options
  4. Restart the Pi

Connect Remotely

Determine the ip address to us with VNC Viewer and PuTTY in a terminal window on the RPi type:ifconfig
Now use the reported IP Address in either PuTTY or VNC Viewer to ensure you have a remote connection. VNC will require the username "pi" along with the password you set during Initial Setup

Set Chromium to auto launch in kiosk mode and disable the screen saver / screen blanking

  1. Launch a terminal window (on the RPi, or using PuTTY).
  2. Edit the startup file to auto launch on boot by typing
    sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
    to launch the nano text editor against the auto start file.
  3. Add the following lines to the file:
    @xset s off
    @xset -dpms
    @xset noblank
    @chromium-browser --disable-infobars --kiosk http://www.PageToDisplay.com
  4. To disable the crash buble when you power cycle the RPi without closing the chromium session correctly, edit the file etc/rc.local
    sudo nano /etc/rc.local
    Add the following line above "exit 0" [This is one line of code with a single space before the file path]
    sed -i 's/"exit_type":"Crashed"/"exit_type":"none"/' /home/pi/.config/chromium/Default/Preferences

Hide Cursor Visibility

  1. Install unclutter in a terminal window type:
    sudo apt install unclutter

Disable touch capability for the RPi official 7-inch screen

  1. Edit the /boot/config.txt file
    sudo nano /boot/config.txt
    Add the following two lines to the bottom of the file
    # Disable the touch screen
    disable_touchscreen=1
 

Wednesday, September 21, 2016

Updated switch used for launching KIOSK mode in Chromium

I had trouble today with the setup described in my post from 8/27/2016.

My Raspberry Pi was unable to access localStorage since I had used the "--incognito" switch to disable popups...

To set up Chromium to auto start you have to modify the appropriate LXDE-pi/autostart file (see my 8/27 post).

In that post I noted you should add the following lines to the file (again thanks to Dan Purdy)...

@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
@chromium-browser --noerrdialogs --kiosk  http://www.SiteToDisplay.com" --incognito

Using these two lines did prevent any popups, but also prevented access to localStorage.


The solution I discovered was to use this line in place of those two above:

@chromium-browser --disable-session-crashed-bubble --disable-infobars  --kiosk http://www.SiteToDisplay.com

After rebooting my RPi it auto launched chromium in kiosk mode, did not display any error messages (about not shutting down correctly) and yes, did successfully access localStorage - problem solved.

Saturday, August 27, 2016

Raspberry Pi 2 or 3 Setup Chromium as Kiosk

These instructions are for setup of the image to be used in a Raspberry Pi 3 attached to the official 7 inch touch screen monitor.
It is possible that not all instructions are applicable, but are noted here in case they are needed.

Burn Image to SD Card

Use Win32DiskImager to load the image 2016-05-27-raspbian-jessie.img onto an 8GB or larger SD Card.
Insert the card into the Pi, connect a network cable and power up the device.

Connect to the Pi using PuTTY

Download PuTTY. It can be found here at the time of this writing
PuTTY is used to connect remotely (my preference) to the Raspberry Pi terminal window. PuTTY is enabled by default in the loaded image from above.
You will need to know the IP address of the device in order in initiate the connection.
To get the IP address hover over (touch the screen - causing a dropdown to display - remove finger) the network icon in the upper corner. A gray popup will display the connection address.

Launch PuTTY and initiate a session on the default port with directed to the ip address of the device.
The default username is "pi"
and the default password is "raspberry"

Install Chromium Browser

Connect using PuTTY (or use a terminal session) and complete the following steps:
  1. Edit the application source list
    1. type: "sudo nano /etc/apt/sources.list" - NOTE: sudo is needed to run with elevated priveleges
    2. Add the following to to bottom of the file and save:
      deb http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main
      #deb-src http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main
    3. Add public key for repository by typing:
      sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB69B232436DAC4B50BDC59E4E1B983C5B393194
  2. Update the packages so the installation will work:
    1. type: "sudo apt update"
    2. type: "sudo apt install chromium-browser"
  3. Launch Chromium from the start menu -- Internet -- Chromium Web Browser to verify it is working

Install "unclutter" - hides the cursor when not active

Connect using PuTTY (or use a terminal session) to support command prompt actions.

  1. type: "sudo apt install unclutter"

Rotate Screen (if needed)

You can do this by booting up your Pi, going into the Raspberry menu, picking "Accessories" and then "Terminal" (or use PuTTY).
  1. In Terminal, type "sudo nano /boot/config.txt" - NOTE: sudo is needed to run with elevated priveleges
  2. Add the line "lcd_rotate=2" to the top of the file. - NOTE: THERE ARE NO SPACES ON EITHER SIDE OF THE "=".
  3. Press CTRL+X.
  4. Then Y.
  5. Then Enter.
  6. And reboot! (type in terminal "sudo  reboot")

Update / Upgrade the image to the latest release

Connect using PuTTY (or use a terminal session) and type: sudo raspi-config.
  1. In Terminal, type "sudo apt update" (only needed if you did not already do this) - NOTE: sudo is needed to run with elevated priveleges
  2. In Terminal, type "sudo apt upgrade"
  3. hit 'y' when upgrade process asks if you want to continue. - this process will take a while
  4. Once done type "sudo reboot" to reboot the device

Initial Setup/Localization

Connect using PuTTY (or use a terminal session) and type: sudo raspi-config.
There are several configuration options available. - NOTE: With the May, 2016 Jessie image it is not necessary to "expand the file system"
  1. In Terminal, type "sudo raspi-config" - NOTE: sudo is needed to run with elevated priveleges
  2. Change User Password to "dothedew" - NOTE you will need to use this password for future PuTTY connections
  3. Enter Internationalisation Options
    1. Change Locale: use down arrow and spacebar to change the selection - remove the en_GB.... and add en_US.UTF-8 UTF-8
      use tab to highlight "OK" and press "Enter"
    2. Set the defaults local for hte system environment to en_US.UTF-8 (arrow key / tab / enter)
  4. Go back into the Internationalisation Options
    1. Select "Change Timezone
    2. Select "US"
    3. Select the correct timezone
  5. Go back into the Internationalisation Options
    1. NOTE: I did not need to do this step on my initial setup
    2. If pressing shift-3 in the PuTTY window does not type "#" then Select "Change Keyboard Layout".
    3. Go through the menus setting it to the defaults for a US keyboard.
  6. Go back into the Internationalisation Options
    1. Select Change Wi-fi County
    2. Set to "US"
  7. Reboot when it requests

Disable Screen Blanking / Screen Saver

Chromium to start in Kiosk Mode - Define start page

Connect using PuTTY (or use a terminal session) and type:
"sudo nano home/pi/.config/lxsession/LXDE-pi/autostart"
 - NOTE: sudo is needed to run under elevated priveleges

The autostart file for X moved with the release of Jessie.
Wheezy was located at /etc/xdg/lxsession/LXDE-pi/autostart If using Wheezy, you will want to modify the file location
  1. Modify this file by commenting out "@xscreensaver -no-splash"
    Add the following 5 lines to the end:
    1. @xset s off
    2. @xset -dpms
    3. @xset noblank
    4. @chromium-browser --disable-session-crashed-bubble --disable-infobars --kiosk http://www.PageToDisplay.com
      NOTE THIS IS THE LINE THAT HOLDS THE WEB ADDRESSS YOU WANT IT TO DISPLAY - See my post from 9/21/2016
  2. Save changes to this file and reboot ("sudo reboot") to test that it is working

Install Real VNC for remote access

These instructions can be found here: https://www.realvnc.com/docs/raspberry-pi.html#vnc-and-raspberry-pi
Connect using PuTTY (or use a terminal session) and type the following lines.
  1. curl -L -o VNC.tar.gz https://www.realvnc.com/download/binary/latest/debian/arm/
  2. tar xvf VNC.tar.gz
  3. sudo dpkg -i VNC-Server-5.3.2-Linux-ARM.deb (modify version if needed)
    NOTE: make sure to copy the name with the correct CaSe
  4. sudo vnclicense -add XXXXX-XXXXX-XXXXX-XXXXX 
    • if you do not have a key you may need to buy or register a new (free for home use) one
    • replace above with your license key
  5. sudo vncpasswd -service
    enter the password "dothedew"
  6. Set for auto startup:
    1. Debian 8 Jessie: sudo systemctl enable vncserver-x11-serviced.service
    2. Debian 7 Wheezy sudo update-rc.d vncserver-x11-serviced defaults
  7. sudo reboot - NOTE VNC will not be available until after the reboot (it will start as a service from step 6)

Customize the Look and Feel

Insert a USB storage device containing the image you want to use on the Desktop background (if you want to use something other than the RPi default images.
Connect using PuTTY (or use a terminal session with attached keyboard and mouse) to support command prompt actions

NOTE to find the ip address, touch the network icon and release. After the menu disappears a gray popup will display with the connected address (or you can type "ifconfig" in the terminal window).

Connect to device with Real VNC Viewer if you do not have a keyboard and mouse attached.
  1. Copy the image file from USB attched storage to the device
    1. Use PuTTY or terminal window and type:
      1. On Jessie: type ls /media/pi to discover the USB DEVICE NAME (On Wheezy use: ls /media)
      2. On Jessie: sudo cp /media/pi/<UNIQUE USB DEVICE NAME>/<IMAGE NAME.png(.jpg,etc...)> /usr/share/raspberrypi-artwork (On Wheezy use /media not /media/pi)
Initiate VNC Connection or use a mouse and keyboard the the next steps
  1. Set the background image
    1. right click in the desktop
    2. Select "Desktop Properties"
    3. Click the browse button to pick a different image. It will open to the location we copied it to. (pick the file that looks right on the display you are using)
  2. Hide the Trash from the desktop
    1. right click on the desktop
    2. Select "Desktop Preferences"
    3. Select the Desktop Icons Tab and deselect Show "Trash Can" folder on the desktop
  3. Auto hide menu at the top
    1. right click on the task bar and select panel settings form the context menu
    2. Click the Advanced tab
    3. check "Minimize panel when not in use" (leave setting as 2 pixels)

ALL DONE !

Connect using PuTTY (or use a terminal session) to support command prompt actions.
  1. type: "sudo reboot" verify it is working correctly.

Raspberry Pi 2 or 3 Setup Chromium as Kiosk

These instructions are for setup of the image to be used in a Raspberry Pi 3 attached to the official 7 inch touch screen monitor.
It is possible that not all instructions are applicable, but are noted here in case they are needed.

Burn Image to SD Card

Use Win32DiskImager to load the image 2016-05-27-raspbian-jessie.img onto an 8GB or larger SD Card.
Insert the card into the Pi, connect a network cable and power up the device.

Connect to the Pi using PuTTY

Download PuTTY. It can be found here at the time of this writing
PuTTY is used to connect remotely (my preference) to the Raspberry Pi terminal window. PuTTY is enabled by default in the loaded image from above.
You will need to know the IP address of the device in order in initiate the connection.
To get the IP address hover over (touch the screen - causing a dropdown to display - remove finger) the network icon in the upper corner. A gray popup will display the connection address.

Launch PuTTY and initiate a session on the default port with directed to the ip address of the device.
The default username is "pi"
and the default password is "raspberry"

Install Chromium Browser

Connect using PuTTY (or use a terminal session) and complete the following steps:
  1. Edit the application source list
    1. type: "sudo nano /etc/apt/sources.list" - NOTE: sudo is needed to run with elevated priveleges
    2. Add the following to to bottom of the file and save:
      deb http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main
      #deb-src http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main
    3. Add public key for repository by typing:
      sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB69B232436DAC4B50BDC59E4E1B983C5B393194
  2. Update the packages so the installation will work:
    1. type: "sudo apt update"
    2. type: "sudo apt install chromium-browser"
  3. Launch Chromium from the start menu -- Internet -- Chromium Web Browser to verify it is working

Install "unclutter" - hides the cursor when not active

Connect using PuTTY (or use a terminal session) to support command prompt actions.

  1. type: "sudo apt install unclutter"

Rotate Screen (if needed)

You can do this by booting up your Pi, going into the Raspberry menu, picking "Accessories" and then "Terminal" (or use PuTTY).
  1. In Terminal, type "sudo nano /boot/config.txt" - NOTE: sudo is needed to run with elevated priveleges
  2. Add the line "lcd_rotate=2" to the top of the file. - NOTE: THERE ARE NO SPACES ON EITHER SIDE OF THE "=".
  3. Press CTRL+X.
  4. Then Y.
  5. Then Enter.
  6. And reboot! (type in terminal "sudo  reboot")

Update / Upgrade the image to the latest release

Connect using PuTTY (or use a terminal session) and type: sudo raspi-config.
  1. In Terminal, type "sudo apt update" (only needed if you did not already do this) - NOTE: sudo is needed to run with elevated priveleges
  2. In Terminal, type "sudo apt upgrade"
  3. hit 'y' when upgrade process asks if you want to continue. - this process will take a while
  4. Once done type "sudo reboot" to reboot the device

Initial Setup/Localization

Connect using PuTTY (or use a terminal session) and type: sudo raspi-config.
There are several configuration options available. - NOTE: With the May, 2016 Jessie image it is not necessary to "expand the file system"
  1. In Terminal, type "sudo raspi-config" - NOTE: sudo is needed to run with elevated priveleges
  2. Change User Password to "dothedew" - NOTE you will need to use this password for future PuTTY connections
  3. Enter Internationalisation Options
    1. Change Locale: use down arrow and spacebar to change the selection - remove the en_GB.... and add en_US.UTF-8 UTF-8
      use tab to highlight "OK" and press "Enter"
    2. Set the defaults local for hte system environment to en_US.UTF-8 (arrow key / tab / enter)
  4. Go back into the Internationalisation Options
    1. Select "Change Timezone
    2. Select "US"
    3. Select the correct timezone
  5. Go back into the Internationalisation Options
    1. NOTE: I did not need to do this step on my initial setup
    2. If pressing shift-3 in the PuTTY window does not type "#" then Select "Change Keyboard Layout".
    3. Go through the menus setting it to the defaults for a US keyboard.
  6. Go back into the Internationalisation Options
    1. Select Change Wi-fi County
    2. Set to "US"
  7. Reboot when it requests

Disable Screen Blanking / Screen Saver and set Chromium to start in Kiosk Mode

Connect using PuTTY (or use a terminal session) and type:
The autostart file for X moved with the release of Jessie.
Wheezy was located at /etc/xdg/lxsession/LXDE-pi/autostart If using Wheezy, you will want to modify the file location
  1. In Terminal, type "sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart" - NOTE: sudo is needed to run under elevated priveleges
  2. Modify this file by commenting out "@xscreensaver -no-splash"
    Add the following 5 lines to the end:
    1. @xset s off
    2. @xset -dpms
    3. @xset noblank
    4. @chromium-browser --disable-session-crashed-bubble --disable-infobars --kiosk http://www.PageToDisplay.com
      NOTE THIS IS THE LINE THAT HOLDS THE WEB ADDRESSS YOU WANT IT TO DISPLAY - See my new post from 9/21/2016
  3. Save changes to this file and reboot ("sudo reboot") to test that it is working

Install Real VNC for remote access

These instructions can be found here: https://www.realvnc.com/docs/raspberry-pi.html#vnc-and-raspberry-pi
Connect using PuTTY (or use a terminal session) and type the following lines.
  1. curl -L -o VNC.tar.gz https://www.realvnc.com/download/binary/latest/debian/arm/
  2. tar xvf VNC.tar.gz
  3. sudo dpkg -i VNC-Server-5.3.2-Linux-ARM.deb (modify version if needed)
    NOTE: make sure to copy the name with the correct CaSe
  4. sudo vnclicense -add XXXXX-XXXXX-XXXXX-XXXXX 
    • if you do not have a key you may need to buy or register a new (free for home use) one
    • replace above with your license key
  5. sudo vncpasswd -service
    enter the password "dothedew"
  6. Set for auto startup:
    1. Debian 8 Jessie: sudo systemctl enable vncserver-x11-serviced.service
    2. Debian 7 Wheezy sudo update-rc.d vncserver-x11-serviced defaults
  7. sudo reboot - NOTE VNC will not be available until after the reboot (it will start as a service from step 6)

Customize the Look and Feel

Insert a USB storage device containing the image you want to use on the Desktop background (if you want to use something other than the RPi default images.
Connect using PuTTY (or use a terminal session with attached keyboard and mouse) to support command prompt actions

NOTE to find the ip address, touch the network icon and release. After the menu disappears a gray popup will display with the connected address (or you can type "ifconfig" in the terminal window).

Connect to device with Real VNC Viewer if you do not have a keyboard and mouse attached.
  1. Copy the image file from USB attched storage to the device
    1. Use PuTTY or terminal window and type:
      1. On Jessie: type ls /media/pi to discover the USB DEVICE NAME (On Wheezy use: ls /media)
      2. On Jessie: sudo cp /media/pi/<UNIQUE USB DEVICE NAME>/<IMAGE NAME.png(.jpg,etc...)> /usr/share/raspberrypi-artwork (On Wheezy use /media not /media/pi)
Initiate VNC Connection or use a mouse and keyboard the the next steps
  1. Set the background image
    1. right click in the desktop
    2. Select "Desktop Properties"
    3. Click the browse button to pick a different image. It will open to the location we copied it to. (pick the file that looks right on the display you are using)
  2. Hide the Trash from the desktop
    1. right click on the desktop
    2. Select "Desktop Preferences"
    3. Select the Desktop Icons Tab and deselect Show "Trash Can" folder on the desktop
  3. Auto hide menu at the top
    1. right click on the task bar and select panel settings form the context menu
    2. Click the Advanced tab
    3. check "Minimize panel when not in use" (leave setting as 2 pixels)

ALL DONE !

Connect using PuTTY (or use a terminal session) to support command prompt actions.
  1. type: "sudo reboot" verify it is working correctly.

Wednesday, August 24, 2016

Raspberry Pi 3 Jessie auto start Chromium

The autostart file for X moved with the release of Jessie.
Wheezy was located at /etc/xdg/lxsession/LXDE-pi/autostart
If using Wheezy, you will want to modify the next line for the correct file location

The file below is the one needing edited in Jessie.

To auto launch Chromium and disable screen blanking, modify the autostart file:
sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
Comment out:
#@xscreensaver -no-splash
Insert the following three lines to disable screen blanking & screen savers:
@xset s off
@xset -dpms
@xset noblank
Insert the following two lines to disable error messages and launch Chromium in kiosk mode:
@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
@chromium-browser --noerrdialogs --kiosk http://www.PageTo.Display --incognito
Reboot to test operation:
sudo reboot

Tuesday, August 23, 2016

Install Chromium on Raspberry Pi 3 - Jessie

I started with a clean image of Jessie (May 2016) on my Raspberry Pi 3. I used these steps to get Chromium browser installed and I end by upgrading my image. The source for the below information originally comes from:

http://raspberrypi.stackexchange.com/questions/44384/how-to-get-chromium-on-raspberry-3/44690

sudo nano /etc/apt/sources.list
Add the following lines to the file and save:
deb http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main 
#deb-src http://ppa.launchpad.net/canonical-chromium-builds/stage/ubuntu vivid main
Ubuntu 15.10 Vivid is the Ubuntu release which is closest to Debian/Raspbian 8 Jessie and hence doesn't need any additional non-Raspbian/-Debian packages to be installed to fulfill dependencies. (Ubuntu 15.04 Vivid itself is no more supported, but Chromium builds are still generated for it for some reason unknown to me. If that stops, you might want to switch to either Ubuntu 14.04 LTS Trusty or Ubuntu 15.10 Wily and install the few additional dependencies from normal Ubuntu repositories.)

By using the full fingerprint as key-id when downloading and importing the key you can be as sure to have the right key as with comparing the fingerprint after downloading:

To be able to verify the downloaded packages, you need to import the GnuPG key into APT.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB69B232436DAC4B50BDC59E4E1B983C5B393194
Please verify the above fingerprint against the one published on https://launchpad.net/~canonical-chromium-builds/+archive/ubuntu/stage to be sure to allow the right key to install packages on your system.

Now, update the package list, install the chromium-browser package & run an upgrade:
sudo apt update
sudo apt install chromium-browser
sudo apt upgrade

Finally, just to be certain all is working correctly, reboot the device:
sudo reboot

Tuesday, January 12, 2016

Set up kiosk mode on Osoyoo 3.5 inch LCD

After installing Chromium (from earlier post in this blog) enter:
sudo apt-get install unclutter
This will hide the mouse after a second when it does not get used.

edit autostart using:

 sudo nano ~/.config/lxsession/LXDE-pi/autostart

add the following to the bottom of the file:
@chromium-browser --kiosk http://URLgoesHere.com --incognito

also in other reading I have been advised to comment out the line "@xscreensaver -no-splash"