Browse Source

PIU startup with message and goes into web gui front end

clementinecomputing 4 years ago
parent
commit
7f2b2a58f7

+ 2 - 1
busunit-PIU/piumsgd/piumsgd.c

@@ -38,7 +38,8 @@
 
 struct mg_mgr g_mgr;
 
-char s_web_directory[] = ".";
+//char s_web_directory[] = ".";
+char s_web_directory[] = "/home/bus/config/html";
 
 /*
 void ws_send(struct mg_mgr *mgr, char *msg) {

+ 9 - 0
busunit-PIU/rootfs/etc/rc.local

@@ -20,6 +20,11 @@
 # along with PopuFare.  If not, see <https://www.gnu.org/licenses/>.
 #
 
+# permissions should be 755:
+#
+#   chmod 755 /etc/rc.local
+#
+
 /home/bus/bin/ipc_server > /tmp/ipc_server.log &
 
 /home/bus/bin/rfid_manager > /tmp/rfid.log &
@@ -30,4 +35,8 @@
 
 motion -b -c /home/bus/.motion/motion.conf -p /tmp/motion.pid -l /tmp/motion.log 2>> /tmp/init.log
 
+/home/bus/bin/piumsgd > /tmp/piumsgd.log &
+
+( sleep 5 && su -c "/usr/bin/startx /home/bus/popufare/busunit-PIU/scripts/piu_kiosk 2>&1 /tmp/kiosk.log" )  &
+
 exit 0

+ 50 - 0
busunit-PIU/rootfs/usr/share/plymouth/themes/pix/pix.script

@@ -0,0 +1,50 @@
+screen_width = Window.GetWidth();
+screen_height = Window.GetHeight();
+
+theme_image = Image("splash.png");
+image_width = theme_image.GetWidth();
+image_height = theme_image.GetHeight();
+
+scale_x = image_width / screen_width;
+scale_y = image_height / screen_height;
+
+flag = 1;
+
+if (scale_x > 1 || scale_y > 1)
+{
+	if (scale_x > scale_y)
+	{
+		resized_image = theme_image.Scale (screen_width, image_height / scale_x);
+		image_x = 0;
+		image_y = (screen_height - ((image_height  * screen_width) / image_width)) / 2;
+	}
+	else
+	{
+		resized_image = theme_image.Scale (image_width / scale_y, screen_height);
+		image_x = (screen_width - ((image_width  * screen_height) / image_height)) / 2;
+		image_y = 0;
+	}
+}
+else
+{
+	resized_image = theme_image.Scale (image_width, image_height);
+	image_x = (screen_width - image_width) / 2;
+	image_y = (screen_height - image_height) / 2;
+}
+
+if (Plymouth.GetMode() != "shutdown")
+{
+	sprite = Sprite (resized_image);
+	sprite.SetPosition (image_x, image_y, -100);
+}
+
+message_sprite = Sprite();
+message_sprite.SetPosition(screen_width * 0.1, screen_height * 0.9, 10000);
+
+fun message_callback (text) {
+	my_image = Image.Text(text, 1, 1, 1);
+	message_sprite.SetImage(my_image);
+	sprite.SetImage (resized_image);
+}
+
+Plymouth.SetUpdateStatusFunction(message_callback);

BIN
busunit-PIU/rootfs/usr/share/plymouth/themes/pix/splash.png


+ 24 - 6
busunit-PIU/scripts/piu_kiosk

@@ -22,6 +22,11 @@
 # browser (on startup) and ultimately connect to a local web
 # server serving up the passenger facing interface
 #
+# This assumes it will be run by xinit without another window manager running. For example:
+#
+#  xinit ./start-kiosk.sh
+#
+
 
 export BASEDIR=/home/pi
 
@@ -29,6 +34,16 @@ export DISPLAY=:0
 
 export fqADDRESS="http://127.0.0.1:8001"
 
+/usr/bin/matchbox-window-manager \
+  -use_cursor no \
+  -use_titlebar no &
+
+# clear out warning bar on chromium
+#
+tmpfn=`mktemp`
+jq '.profile.exited_cleanly = true' $BASEDIR/.config/chromium/Preferences | jq '.profile.exit_type = "Normal"' > $tmpfn
+mv $tmpfn $BASEDIR/.config/chromium/Preferences
+
 # turn off screensave/screen blanking
 #
 xset s noblank
@@ -43,12 +58,10 @@ unclutter -idle 0.05 -root &
 #
 #unclutter -root &
 
-
-# clear out warning bar on chromium
-#
-tmpfn=`mktemp`
-jq '.profile.exited_cleanly = true' $BASEDIR/.config/chromium/Preferences | jq '.profile.exit_type = "Normal"' > $tmpfn
-mv $tmpfn $BASEDIR/.config/chromium/Preferences
+rm -f /tmp/kiosk.info
+touch /tmp/kiosk.info
+echo "DISPLAY=$DISPLAY" >> /tmp/kiosk.info
+echo "XAUTHORITY=$XAUTHORITY" >> /tmp/kiosk.info
 
 # start chromium in kiosk mode
 #
@@ -57,12 +70,17 @@ mv $tmpfn $BASEDIR/.config/chromium/Preferences
 #
 #  --disable-application-cache \
 /usr/bin/chromium-browser \
+    --simulate-outdated-no-au='Tue, 31 Dec 2999 23:59:59 GMT' \
+  --no-sandbox \
+  --test-type \
   --noerrdialogs \
   --disable-infobars \
   --aggressive-cache-discard \
   --incognito \
   --disable-pinch \
   --overscroll-history-navigation=0 \
+  --disable-component-update \
+  --disable-gpu \
   --kiosk \
   $fqADDRESS