Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: audiophilelistener on January 21, 2021, 12:39:02 PM

Title: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 21, 2021, 12:39:02 PM
I'm a beginner with piCore, but it looks great and fast.
I'm trying to make a piCoreplayer with a kiosk-mode browser
The latest piCoreplayer (7.0.0) is based on piCore-12 64-bit
It is a very dismantled version of piCore to keep it fast

As far as I tried, I can get Firefox working in full GUI-mode, by installing xorg, xprogs, flwm, war and firefox
But I don't want the full GUI.
I just want Firefox to start a specific webpage on a touchscreen
I think I don't need xprogs, flwm and war. Am I right?
I only cannot get firefox to start this way.
Can onyone help me out, please?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 21, 2021, 03:16:14 PM
Hi audiophilelistener
Welcome to the forum.

... I think I don't need xprogs, flwm and war. Am I right? ...
I don't think you need them either.

Try this. Create a file (pick any name you like) containing the following:
Code: [Select]
DISPLAY=:0 firefox &Place that file in  ~/.X.d
When you start X, the  ~/.xsession  file should execute that command after Xorg starts.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 21, 2021, 03:52:07 PM
Hi Rich,

Thx for your kind reply.
I’m going to try that.

How can I start that automatically?
And how can I prevent the screen-sleep?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 21, 2021, 04:06:48 PM
Hi audiophilelistener
If you create the file I described above and install Xorg, It should all start automatically every time you boot. Make sure
you run a backup after creating the file.

There are some things in Firefox that won't work without a window manager. The drop downs from the
menu (File Edit View History .... ) will flash and disappear. The same holds true for the address bar.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 21, 2021, 04:19:33 PM
That should no be a problem. Even in fact, just what I want.
I only need to put the desired webpage somewhere.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 21, 2021, 10:57:56 PM
Hi audiophilelistener
... There are some things in Firefox that won't work without a window manager. The drop downs from the
menu (File Edit View History .... ) will flash and disappear. The same holds true for the address bar.
I take that back. They do work. I left out the trailing ampersand when I first tried it. Once I included it all of
the drop downs worked.

If you start it like this:
Code: [Select]
DISPLAY=:0 firefox --kiosk &then Firefox will start with no menus. I don't think it will support multiple tabs in this mode either.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 22, 2021, 03:46:47 AM
Ah, that's nice.
Thx for trying.

Where should I place the webpage to visit?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: patrikg on January 22, 2021, 04:16:57 AM
Just add the url to your command.


Code: (bash) [Select]
firefox --kiosk https://www.google.com &

Look at the help for more command line args.

Code: (bash) [Select]
firefox --help
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 22, 2021, 05:21:26 AM
Working great so far.

Couple of things left:
- disable screen-sleep
- remove mouse pointer (while keeping touch-input, which is still a kind of mouse I think)
- how to start firefox full-screen
- can I skip the tinycore screen just before starting firefox

You're a great help
Thx
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 22, 2021, 09:34:19 AM
Hi audiophilelistener
... - remove mouse pointer (while keeping touch-input, which is still a kind of mouse I think) ...
So you don't want that little arrow obstructing your view when using the touch screen? I may have what you are looking for.
A while back I wrote a little program called HideMouse that will do that for you:
http://forum.tinycorelinux.net/index.php/topic,23615.0.html

The second post in that thread has instructions on building it in 4 easy steps. A script does all of the work for you.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 22, 2021, 11:17:25 AM
Hi Rich,

The HideMouse is not working yet.
I downloaded everyting from 11.x/X86_64/
But I don't think it works under piCore-12 (64)
Otherwise I'm doing something wrong
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 22, 2021, 02:31:49 PM
Hi audiophilelistener
... The HideMouse is not working yet.
I downloaded everyting from 11.x/X86_64/ ...
What do you mean by everything? The only thing you needed to download was  HideMouse-source-v0.1.tar.gz. That's
what that  wget  command does. Did you read the instructions in reply #1 in that thread?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 08:06:14 AM
Hi Rich,

At first I downloaded the files HideMouse.tcz, HideMouse.tcz.dep, and HideMouse.tcz.md5.txt from the v11.x repo, to see if they worked out of the box.
But they didn't.
Now I have compiled it like you described.

Tar didn't make a HideMouse directory. But I could work around that, by making it myself and copying everything in there.

Upon loading "HideMouse &", I got an error (see below)
After executing "startx" I still have a mousepointer visible.

Am I doing something wrong, or what?
Hope you can help.

Code: [Select]
tc@pCP:/mnt/mmcblk0p2/tce/HideMouse$ ls -al
total 116
drwxr-xr-x    3 tc       staff         4096 Jan 23 13:41 ./
drwxrwxr-x    6 tc       staff         4096 Jan 23 13:36 ../
-rwxr-xr-x    1 tc       staff         5163 Jan 22 09:36 CompileHideMouse
-rwxr-xr-x    1 tc       staff         8360 Jan 23 13:41 HideMouse
-rw-r--r--    1 tc       staff         1821 Mar 12  2020 HideMouse-License.txt
-rw-r--r--    1 tc       staff         9222 Jan 23 13:41 HideMouse-aarch64.tar.gz.bfe
-rw-r--r--    1 tc       staff         4295 Jan 23 13:41 HideMouse-source-v0.1.tar.gz
-rw-r--r--    1 tc       staff         6329 Mar  6  2020 HideMouse.c
-rw-r--r--    1 tc       staff        20152 Jan 23 13:41 HideMouse.o
-rw-r--r--    1 tc       staff         4624 Jan 23 13:41 HideMouse.tar.gz
-rw-r--r--    1 tc       staff         4096 Jan 23 13:41 HideMouse.tcz
-rw-r--r--    1 tc       staff           14 Jan 23 13:41 HideMouse.tcz.dep
-rw-r--r--    1 tc       staff         1106 Jan 23 13:41 HideMouse.tcz.info
-rw-r--r--    1 tc       staff           78 Jan 23 13:41 HideMouse.tcz.list
-rw-r--r--    1 tc       staff           48 Jan 23 13:41 HideMouse.tcz.md5.txt
drwxr-xr-x    3 tc       staff         4096 Jan 23 13:41 pkg/
-rw-r--r--    1 tc       staff           59 Jan 23 13:41 submitqc.txt
tc@pCP:/mnt/mmcblk0p2/tce/HideMouse$ cp HideMouse.tcz /mnt/mmcblk0p2/tce/optional/
tc@pCP:/mnt/mmcblk0p2/tce/HideMouse$ cp HideMouse.tcz.dep /mnt/mmcblk0p2/tce/optional/
tc@pCP:/mnt/mmcblk0p2/tce/HideMouse$ cp HideMouse.tcz.md5.txt /mnt/mmcblk0p2/tce/optional/
tc@pCP:/mnt/mmcblk0p2/tce/HideMouse$ tce-load -i HideMouse
HideMouse.tcz: OK
tc@pCP:/mnt/mmcblk0p2/tce/HideMouse$ HideMouse &
tc@pCP:/mnt/mmcblk0p2/tce/HideMouse$ Error line: 88
Success

[1]+  Done(1)                    HideMouse

    [EDIT]: Replaced  tt  tags with  code  tags.  Rich
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 23, 2021, 09:37:12 AM
Hi audiophilelistener
Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly. Code tags also automatically add horizontal and or vertical scrollbars
to accommodate long lines and listings.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 23, 2021, 09:51:07 AM
Hi audiophilelistener
... Upon loading "HideMouse &", I got an error (see below)
After executing "startx" I still have a mousepointer visible.

Am I doing something wrong, or what? ...
Yes. You can't hide the cursor because it doesn't exist. You need to run  startx  first.

Create a file in ~/.X.d called  Hide  with the following contents:
Code: [Select]
HideMouse &
sleep 1
echo h > /tmp/HideMouse
Then run  startx  and see if the cursor is still visible.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 23, 2021, 10:33:50 AM
Hi audiophilelistener
... At first I downloaded the files HideMouse.tcz, HideMouse.tcz.dep, and HideMouse.tcz.md5.txt from the v11.x repo, to see if they worked out of the box.
But they didn't. ...
Just like a program compiled for a 64 bit processor will not run on a 32 bit processor, a program compiled to run on an
X86 architecture will not run on an ARM architecture. :o

Quote
... Tar didn't make a HideMouse directory. But I could work around that, by making it myself and copying everything in there. ...
Thank you for reporting that. :) That wasn't an issue with tar. I forgot to include the path when I repacked the file. The
server has been updated with a corrected copy.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 11:46:20 AM
Hi Rich,
I'm learning.....  😎

Hi audiophilelistener
... Upon loading "HideMouse &", I got an error (see below)
After executing "startx" I still have a mousepointer visible.

Am I doing something wrong, or what? ...
Yes. You can't hide the cursor because it doesn't exist. You need to run  startx  first.

Create a file in ~/.X.d called  Hide  with the following contents:
Code: [Select]
HideMouse &
sleep 1
echo h > /tmp/HideMouse
Then run  startx  and see if the cursor is still visible.

YESSSS it works 😍

I've also come across this:
Code: (html5) [Select]
http://www.noah.org/wiki/cursor_disable_in_X11Have not tried it though

I saw something during installation of firefox....
It installed also one or more "wayland" things, which I found out, could be an alternative for Xorg
There are also wayland packages in the repo

According to this post
Code: (html5) [Select]
https://bugzilla.mozilla.org/show_bug.cgi?id=1507832 I started firefox this way:

Code: [Select]
GDK_BACKEND=wayland firefox
It tries to start but comes with a Gtk-WARNING: "cannot open display"

Does it ring a bell?

I see this conversation:

Code: (html5) [Select]
http://forum.tinycorelinux.net/index.php?topic=24429.0
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 11:50:34 AM
Using Xorg, is there a way to change the X-screen with the Tiny-Core logo?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 23, 2021, 12:16:06 PM
Hi audiophilelistener
... YESSSS it works ...
Good. Now you can submit it to the repository. One of the files created by the script should be  HideMouse-aarch64.tar.gz.bfe.
Attach it to a brief email that says:
Quote
Attached is the aarch64 version of HideMouse for TC12.
HideMouse-aarch64.tar.gz.bfe contains the extension and the source tarball.

The instructions for emailing the extension are here:
http://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#submitting
Use the  tcesubmit  email address, not the  picoresubmit  address.

Quote
It tries to start but comes with a Gtk-WARNING: "cannot open display"

Does it ring a bell?
I'm afraid I know nothing about wayland. Sorry.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 12:24:33 PM
Hi audiophilelistener
... YESSSS it works ...
Good. Now you can submit it to the repository. One of the files created by the script should be  HideMouse-aarch64.tar.gz.bfe.
Attach it to a brief email that says:
Quote
Attached is the aarch64 version of HideMouse for TC12.
HideMouse-aarch64.tar.gz.bfe contains the extension and the source tarball.

The instructions for emailing the extension are here:
http://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#submitting
Use the  tcesubmit  email address, not the  picoresubmit  address.

Quote
It tries to start but comes with a Gtk-WARNING: "cannot open display"

Does it ring a bell?
I'm afraid I know nothing about wayland. Sorry.

I will do that.
Is the hide-cursor-option a way to go?
And can I change the blue X desktop screen?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 23, 2021, 12:31:17 PM
Hi audiophilelistener
Using Xorg, is there a way to change the X-screen with the Tiny-Core logo?

... And can I change the blue X desktop screen?

Are you talking about replacing the black background or making it black?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 12:46:48 PM
Hi audiophilelistener
Using Xorg, is there a way to change the X-screen with the Tiny-Core logo?

... And can I change the blue X desktop screen?

Are you talking about replacing the black background or making it black?
the starting-screen is blue with a TC-logo. Making it black could be nice.

I also noticed the screen going to sleep after a while.
Can I prevent that?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Juanito on January 23, 2021, 12:49:34 PM
I saw something during installation of firefox....
It installed also one or more "wayland" things, which I found out, could be an alternative for Xorg
There are also wayland packages in the repo

According to this post
Code: (html5) [Select]
https://bugzilla.mozilla.org/show_bug.cgi?id=1507832 I started firefox this way:

Code: [Select]
GDK_BACKEND=wayland firefox
It tries to start but comes with a Gtk-WARNING: "cannot open display"

If you use firefox with x there is no need to set $GDK_BACKEND

If you use firefox with a wayland compositor (for example weston) then you need to set $GDK_BACKEND - basically it is passing instructions to gtk3 as to what kind of display to use - most other gtk3 apps are smart enough to figure this out for themselves..
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 12:56:10 PM
Hi Juanito,

I saw something during installation of firefox....
It installed also one or more "wayland" things, which I found out, could be an alternative for Xorg
There are also wayland packages in the repo

According to this post
Code: (html5) [Select]
https://bugzilla.mozilla.org/show_bug.cgi?id=1507832 I started firefox this way:

Code: [Select]
GDK_BACKEND=wayland firefox
It tries to start but comes with a Gtk-WARNING: "cannot open display"

If you use firefox with x there is no need to set $GDK_BACKEND

If you use firefox with a wayland compositor (for example weston) then you need to set $GDK_BACKEND - basically it is passing instructions to gtk3 as to what kind of display to use - most other gtk3 apps are smart enough to figure this out for themselves..

Thx for your reply
Should I load weston.tcz? Would that be all?
Is that a better option (quicker) than Xorg?

Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 23, 2021, 01:07:50 PM
Hi audiophilelistener
The logo is provided by  Xprogs.tcz  which you can't remove because  Xorg.tcz  depends on it.

Edit the  ~/.setbackground  file and change this:
Code: [Select]
hsetroot  -add "#0E5CA8" -add "#87C6C9" -gradient 0 -center /usr/local/share/pixmaps/logo.png
to this:
Code: [Select]
hsetroot  -solid "#000000"
Then run a backup and startx.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Juanito on January 23, 2021, 01:14:00 PM
It would probably be easier to use x, but you could try weston - be sure to read the info file.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 01:19:23 PM
Hi Rich,

Hi audiophilelistener
The logo is provided by  Xprogs.tcz  which you can't remove because  Xorg.tcz  depends on it.

Edit the  ~/.setbackground  file and change this:
Code: [Select]
hsetroot  -add "#0E5CA8" -add "#87C6C9" -gradient 0 -center /usr/local/share/pixmaps/logo.png
to this:
Code: [Select]
hsetroot  -solid "#000000"
Then run a backup and startx.

I’ll try that tomorrow.
Thx, you’re a great help 🙏
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 23, 2021, 01:22:02 PM
It would probably be easier to use x, but you could try weston - be sure to read the info file.

Ok, thx 🙏
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 24, 2021, 09:24:47 AM
Hi Rich,

Hi Rich,

Hi audiophilelistener
The logo is provided by  Xprogs.tcz  which you can't remove because  Xorg.tcz  depends on it.

Edit the  ~/.setbackground  file and change this:
Code: [Select]
hsetroot  -add "#0E5CA8" -add "#87C6C9" -gradient 0 -center /usr/local/share/pixmaps/logo.png
to this:
Code: [Select]
hsetroot  -solid "#000000"
Then run a backup and startx.

I’ll try that tomorrow.
Thx, you’re a great help 🙏

Quote
Now you can submit it to the repository. One of the files created by the script should be  HideMouse-aarch64.tar.gz.bfe.
Done that.

It worked!
I also found the command to keep the console screen on:
Code: [Select]
echo -e '\033[9;0]'Now I should put it in a script.
Can I add it in the HideMouse script?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 24, 2021, 10:12:15 AM
Hi audiophilelistener
... Can I add it in the HideMouse script?
Yes.

I just want to clarify something. The files in  ~/.X.d  are not scripts. They contain commands that get executed line by
line by  ~/.xsession.  A command can not be executed until the previous command returns control to  ~/.xsession.

Commands like  HideMouse  and  firefox  block and will not return control to  ~/.xsession  until they exit.
That is why you append an  &  to the end of the line. This starts the command and immediately returns control to  ~/.xsession.
Commands like  echo -e '\033[9;0]'  do not block and do not get an  &  appended to them.
Commands like  sleep 1  do block  because they are supposed to, and do not get an  &  appended to them.

So you could place all of your commands in one file something like this:
Code: [Select]
HideMouse &
sleep 1
echo h > /tmp/HideMouse
echo -e '\033[9;0]'
firefox --kiosk https://www.google.com &
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: audiophilelistener on January 24, 2021, 10:46:00 AM
Hi Rich,

Learning more and more 😀
Thx.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Rich on January 24, 2021, 11:05:26 AM
Hi audiophilelistener
You are welcome.

By the way, there's no need to quote entire posts in replies. If there's something you wish to address from a previous
post, remove the irrelevant parts of the quote.
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: markiii on February 05, 2021, 12:56:48 PM
Hi Chaps

Found this forum and post as I was googling how to do exactly the same thing as the OP.

I have xorg installed
I have firefox installed

If I manually ssh to the box and run

DISPLAY=:0 firefox -kiosk "URL Here...." &

Then firefox loads in kiosk mode with the webpage as expected.

However trying to get it to work automatically at boot fails every time. I followed the instructions below


Try this. Create a file (pick any name you like) containing the following:
Code: [Select]
DISPLAY=:0 firefox &Place that file in  ~/.X.d
When you start X, the  ~/.xsession  file should execute that command after Xorg starts.

however when i reboot the file has disappeared from the X.d directory

I know a lot of Tinycore stuff doesn't survive a reboot, but I'd expected this too as thats the whole point.

Any suggestions as to how to fix this?

thanks in advance
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: Juanito on February 05, 2021, 01:43:57 PM
Did you make a backup to save the file in ~/.X.d?
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: markiii on February 05, 2021, 01:48:46 PM
of course it would help if i actually did a backup wouldn't it......

fixed  :)
Title: Re: PiCore-12 64-bit kiosk mode Firefox
Post by: markiii on February 07, 2021, 01:56:28 PM
So the basics,  open a kiosk mode firefox with a specific url is working

I'm having very little joy with any of the other parts i need to accomplish so lets start one item at a time

the kiosk browser opens and its not full screen

I'm using a 16:9 screen that support 1920x1080

and i get a circa 0.5" black screen to left and to the top
at the bottom I have a 2" black bar and to the right circa 6"

any suggestions appreciated, I've exhausted my google fu skills