Snap! Arcade

We are developing a Snap! arcade - a physical enclosure for a project in which students first create the game in Snap! (an educational programming language developed at the University of California, Berkeley that is used by more than a thousand K-12 computer science teachers).

We’re running a local instance of Snap! on a Raspberry Pi 3. This is the first time we have used a Raspberry Pi in a project, but it is working well for this application.

We would like to be able to hide the title bar of the browser to create an “Arcade Mode”. Does anyone on this forum have experience with Raspberry Pi or know how to mask the title bar in the browser on this system? (Thanks)

2 Likes

It’s commonly called “kiosk mode” and it’s made for things like this! :smiling_face:

Firefox

Chrome

I know the title of the question here says “Windows” but this particular answer isn’t specific to Windows:

2 Likes

Those seem tailor-made for what we would like to do. (Thanks!)

2 Likes

We are now running the browser in the Kiosk mode.

Thanks for the assist!

2 Likes

We’re using the following terminal command to launch a local instance of Snap! on the Raspberry Pi,

   "chromium-browser --kiosk snap.html"

Today we tried to also run the local Snap! .xml file using:

   "chromium-browser --kiosk snap.html#run:pacman.xml"

However, we’re getting a “cannot load file” error message. (We also tried using the full path name to the xml file, with the same result.)

So either we have the path wrong, or have a permissions problem, or some other issue. Any suggestions would be welcome. (Thanks!)

Here’s the current prototype for the arcade cabinet. We’re using a Raspberry Pico as a microcontroller to monitor the arcade controls. The Pico is connected to a Raspberry Pi running the Snap! program.

2 Likes

The # character starts a comment in the shell unless you quote it. I would expect you to need to quote it, and I’d use single quotes, like tihs:

chromium-browser --kiosk 'snap.html#run:pacman.xml'

We’ll try this in the morning. Much appreciated!

Nice work! I love Snap! and the Snap4Arduino fork is great for controlling Arduino hardware.

Also, if you really want it to run like a dedicated arcade machine there’s a way to make the web browser the default application on startup. It’s been years since I ran something like this but it’s out in google-land. Ask if you can’t find it.

2 Likes

Make sure your Raspberry Pi is connected to the internet and has the latest updates installed.

Open the Terminal and run the following command to update the package list:

sudo apt-get update

Next, run the following command to install Chromium:

sudo apt-get install chromium-browser

Once the installation is complete, run the following command to launch Chromium:

chromium-browser

Chromium should now launch and you can use it to browse the web. Close Chromium once you’re done.

To make Chromium launch automatically on start-up, run the following command to open the autostart file:

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

Add the following line to the end of the file:

@chromium-browser

This will tell the Raspberry Pi to launch Chromium on start-up.

Save the file by pressing “Ctrl+X”, then “Y”, then “Enter”.

Reboot the Raspberry Pi by running the following command:

sudo reboot

Once the Raspberry Pi has rebooted, Chromium should launch automatically on start-up.

Note: Depending on your Raspberry Pi configuration, the autostart file location may differ. If you’re using a different desktop environment or window manager, you may need to modify the autostart file for that environment.

1 Like

We successfully followed these directions to launch chromium on bootup.

We also have now successfully run the following script in a shell script (“arcade.sh”):

chomium-browser --disable-web-security --allow-file-access-from-files --kiosk ‘file:///home/maketolearn/Snap-8.2.3/snap.html#run:file:///home/maketolearn/Snap-8.2.3/pacman.xml&hideControls’

However, when we attempt to launch chromium on startup and run this specific script, it tries to connect to the internet (unsuccessfully) instead of going to the local file.

What are we overlooking?

If you have added @chromium-browser to autostart, and you are calling you arcade.sh, are you not launching the browser twice?

Ive assumed -

chomium-browser --disable-web-security --allow-file-access-from-files --kiosk ‘file:///home/maketolearn/Snap-8.2.3/snap.html#run:file:///home/maketolearn/Snap-8.2.3/pacman.xml&hideControls

Is the contents of arcade.sh

Can you be more specific? What does it show?

We’ll check on Monday when we’re back in the office and get the specific wording of the error message.

Here’s an initial dry fit of the arcade artwork mounted on the cabinet.

2 Likes