BillyBlaze / OctoPrint-TouchUI

A touch friendly interface for a small TFT module or phone
https://billyblaze.github.io/OctoPrint-TouchUI/
GNU Affero General Public License v3.0
274 stars 92 forks source link

Boot to Browser only loading to Octopi UI #477

Closed kblankenship1989 closed 3 years ago

kblankenship1989 commented 3 years ago

Versions: Octoprint: 1.5.2 TouchUI: 0.3.17

Issue: I had older versions of both TouchUI and Octoprint (don't know the previous ones but both pre-pandemic at least) and my TFT was working fine. After updating both to latest, I get the Octopi UI to pull up on my touchscreen but no way to switch to "TouchUI" (i.e. does not auto detect or have the toggle button to switch ui's like the webpage does)

Solutions attempted: Removed and reinstalled TouchUI plugin and ran "TouchUI-Autostart/helpers/uninstall" then did "install" again. Changed "TOUCHUI_URL" in defaults to "http://localhost:{PORT}/#touch" but did not work Changed "FORCE_TOUCH" to true in defaults but did not work

defaults file:

# Configuration for /etc/init.d/touchui

# The init.d script will only run if this variable non-empty.
TOUCHUI_USER=pi

# Where is the xinit file locatated
TOUCHUI_DIR="TouchUI-autostart"

# And what xinit file are we looking for
TOUCHUI_FILE="chromium.xinit"

# TouchUI server port
TOUCHUI_PORT="8888"

# Touch server host
TOUCHUI_URL="http://localhost:$TOUCHUI_PORT/"

# Command to hide cursor and window-manager before launching chromium
#TOUCHUI_EXECUTE=""

# Change chromium bin location
CHROME_BIN="chromium-browser"

# Path to the xinit executable, use this to override the default setting "/usr/bin/xinit"
#DAEMON=/path/to/xinit/executable

# What arguments to pass to xinit, usually no need to touch this
DAEMON_ARGS=/home/$TOUCHUI_USER/$TOUCHUI_DIR/$TOUCHUI_FILE

# Umask of files touchui generates, Change this to 000 if running touchui as its own, separate user
UMASK=022

# Process priority, 0 here will result in a priority 20 process.
# -2 ensures touchui has a slight priority over user processes.
NICELEVEL=-2

# Should we run at startup?
START=yes

# Should Chromium start with touch events? (false or true)
FORCE_TOUCH=false

# Enable or disable the screensaver
DISABLE_SCREENSAVER=false

# Autodetect OctoPi port number
AUTODETECT_PORT=true

# Path for the profile - defaults to ram disk to reduce writes
#CONFIG_DIR=/run/touchui-chromium/

init.d file:

#!/bin/sh

### BEGIN INIT INFO
# Provides:           touchui
# Required-Start:     $all octoprint
# Required-Stop:
# Should-Start:       haproxy
# Should-Stop:
# Default-Start:      2 3 4 5
# Default-Stop:       0 1 6
# Short-Description:  TouchUI daemon
# Description:        Start TouchUI with xinit.
### END INIT INFO

# Author: Sami Olmari
# Edited for TouchUI: Paul de Vries

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/xinit

DESC="TouchUI Daemon"
NAME="TouchUI"
PIDFILE=/var/run/$NAME.pid
PKGNAME=touchui
SCRIPTNAME=/etc/init.d/$PKGNAME

# XORG needs to run as root to function
# Bugfix #76
ROOT_USER=root

# Read configuration variable file if it is present
[ -r /etc/default/$PKGNAME ] && . /etc/default/$PKGNAME

# Load the VERBOSE setting and other rcS variables
[ -f /etc/default/rcS ] && . /etc/default/rcS

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

# Exit if the DAEMON is not set
if [ -z "$DAEMON" ]
then
    log_warning_msg "Not starting $PKGNAME, DAEMON not set in /etc/default/$PKGNAME."
    exit 0
fi

# Exit if the DAEMON is not installed
[ -x "$DAEMON" ] || exit 0

if [ -z "$START" -o "$START" != "yes" ]
then
   log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it."
   exit 0
fi

if [ -z "$TOUCHUI_USER" ]
then
    log_warning_msg "Not starting $PKGNAME, TOUCHUI_USER not set in /etc/default/$PKGNAME."
    exit 0
fi

if [ -z "$TOUCHUI_DIR" ]
then
    log_warning_msg "Not starting $PKGNAME, TOUCHUI_DIR not set in /etc/default/$PKGNAME."
    exit 0
fi

if [ -z "$TOUCHUI_FILE" ]
then
    log_warning_msg "Not starting $PKGNAME, TOUCHUI_FILE not set in /etc/default/$PKGNAME."
    exit 0
fi

#
# Function to verify if a pid is alive
#
is_alive()
{
   pid=`cat $1` > /dev/null 2>&1
   kill -0 $pid > /dev/null 2>&1
   return $?
}

#
# Function that starts the daemon/service
#
do_start()
{
   # Return
   #   0 if daemon has been started
   #   1 if daemon was already running
   #   2 if daemon could not be started

   is_alive $PIDFILE
   RETVAL="$?"

   if [ $RETVAL != 0 ]; then
       start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile \
       --exec $DAEMON --chuid $ROOT_USER --user $ROOT_USER --umask $UMASK --nicelevel=$NICELEVEL \
       -- $DAEMON_ARGS
       RETVAL="$?"
   fi
}

#
# Function that stops the daemon/service
#
do_stop()
{
   # Return
   #   0 if daemon has been stopped
   #   1 if daemon was already stopped
   #   2 if daemon could not be stopped
   #   other if a failure occurred

   start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user $ROOT_USER --pidfile $PIDFILE
   RETVAL="$?"
   [ "$RETVAL" = "2" ] && return 2

   rm -f $PIDFILE

   [ "$RETVAL" = "0"  ] && return 0 || return 1
}

case "$1" in
  start)
   [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
   do_start
   case "$?" in
      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
   esac
   ;;
  stop)
   [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
   do_stop
   case "$?" in
      0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
      2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
   esac
   ;;
  restart)
   log_daemon_msg "Restarting $DESC" "$NAME"
   do_stop
   case "$?" in
     0|1)
      do_start
      case "$?" in
         0) log_end_msg 0 ;;
         1) log_end_msg 1 ;; # Old process is still running
         *) log_end_msg 1 ;; # Failed to start
      esac
      ;;
     *)
        # Failed to stop
      log_end_msg 1
      ;;
   esac
   ;;
  *)
   echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
   exit 3
   ;;
esac

Please let me know what I am missing / what other information you may need to help with this.

kblankenship1989 commented 3 years ago

Bump still not working

github-actions[bot] commented 3 years ago

This issue has been automatically marked as inactive because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.