Log In  
Follow
gfd

Welp

[ :: Read More :: ]

Read all steps before proceeding with the installation. Feedback is appreciated!

  • If you want to avoid the headache of Step 4, I recommend using a Pi or other Linux computer to write the installation image to the SD card! It can be the same Pi you use for the Lite installation, you just need to switch SD cards to change OSs.

Hello everyone,

I haven't seen any tutorials for doing exactly this so I thought it would be helpful if there was a guide for anyone who specifically just wants a little portable machine that launches PICO-8 after booting, and without using Retropie or a desktop environment. This installation won't have a super fast boot like PICOPi (https://github.com/keints/picopi) but it will have online functionality and will be a great starting point for a physical fantasy console project.

The whole process takes about 45 minutes to complete

Things you will need:

  • The latest PICO-8 for Raspberry Pi zip: https://www.lexaloffle.com/games.php?page=updates
  • Raspberry Pi (any model) setup with a display and keyboard
  • SD card or microSD card (depending on the model of Pi) at least 16GB
  • SD card reader
  • Windows/macOS/Linux computer with internet access (this can also be a Pi, in fact it can even be the same Pi if you have two SD cards!)

    • Optional: USB thumb drive to transfer files from your PC to the Pi
    • Optional: Second SD card to install a desktop version of Raspberry Pi OS to transfer files to your "Lite" installation

Step 1: Download & install the latest Raspberry Pi OS Lite image


You can get the latest Raspberry Pi OS installation images here: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-32-bit

  • We'll use the "Lite" image, but this tutorial also works with the desktop versions if you change the boot option to the command line

Follow these instructions to write the "Lite" image to your SD card: https://www.raspberrypi.com/documentation/computers/getting-started.html#installing-the-operating-system

  • If you flashed the image with a Linux PC or a Raspberry Pi, the SD card should be automatically mounted. You can copy your PICO-8 zip to the rootfs partition's /home/pi/ directory now and skip Step 4 later!

Step 2: Setup Raspberry Pi OS


If you are using HDMI for your display, make sure your Pi is connected to your monitor before powering the Pi on!

When your new Raspberry Pi OS installation boots for the first time, it will generate SSH keys and then reboot shortly after. You will then be asked to select your keyboard layout. If you don't see yours, use the up and down arrow keys to select Other and press Enter. A complete list will be displayed. Select an option and press Enter.

  • If your keyboard has an English (US) layout, be sure NOT to pick the default English (UK) option or your keys will not be mapped correctly! This can be changed again later with the raspi-config tool.

Next you will be asked to create a username and password. After creating these credentials, the system will prompt you to log in. Once you've logged in, you should see the command prompt below

[username]@raspberrypi:~$

Type sudo raspi-config and press Enter. The screen will turn blue and a menu will be displayed.

(If you are using a wired internet connection, you can skip the following paragraph)

  • The option 1 System Options should be selected. Press Enter to confirm the selection. Now the option S1 Wireless LAN should be selected. Press Enter and use the up and down arrow keys to select your country. A dialog box will confirm your selection, and you will next need to enter your Wi-Fi SSID and password.

Once you are connected to your network, select 8 Update on the menu and press Enter.

After the raspi-config tool has been updated, you should be automatically returned to the first menu. Select 1 System Options again and then S5 Boot / Auto Login. Select B2 Console Autologin and press Enter.

  • This is also a good time to setup your locale and timezone should you choose to, but it isn't necessary for the purpose of this tutorial.

Press the right arrow key two times and Finish should now be highlighted orange at the bottom of the menu. Press Enter. If you are asked if you want to reboot the Pi, select No.

Step 3: Update Raspberry Pi OS and install PICO-8 dependencies


You should be back at a command prompt again that says

[username]@raspberrypi:~$

Type sudo apt update and press Enter. This command checks if there are any newer versions of your installed software packages. If any packages can be upgraded, you can use the command sudo apt upgrade to download and install them. Upgrading packages may take several minutes.

Once you've done that, type sudo apt install libsdl2-dev pulseaudio and press Enter. A big list of additional packages that must also be installed will be displayed. Press Enter again. This process will take several more minutes to complete.

When the command finishes, the prompt will return. Type reboot and press Enter.

  • If you are taking your SD card out of your Pi to transfer your zip to it in the next step, type shutdown now instead of reboot and wait for the flashing green light on your Pi to shut off completely before removing the card

Step 4: Copy and extract your PICO-8 zip to your Pi user's home directory


The zip goes in the directory /home/[username]/ on the rootfs partition of your SD card.

There are several ways you can go about completing this step. Here are three:

  • 1) SSH This is probably the most optimal way to copy your zip over if you don’t have a Linux computer or an additional Raspberry Pi OS Desktop installation, though it is a little more involved. You can find instructions for copying files to the Pi via SSH here: https://www.raspberrypi.com/documentation/computers/remote-access.html#ssh

    • The Pi is internet-connected at this point so ensure that your password can't be easily brute-forced! I recommend disabling SSH again after copying over the zip
  • 2) USB drive You can learn how to access a USB thumb drive via the command line here: https://www.raspberrypi-spy.co.uk/2014/05/how-to-mount-a-usb-flash-disk-on-the-raspberry-pi/

  • 3) Another Linux installation If you have a Linux OS with a desktop (or a second SD card for your Pi with Raspberry Pi OS Desktop), you can just insert your Raspberry Pi OS Lite SD card into a card reader and just click and drag the zip onto it using a file explorer.

You can use the unzip command on the Pi to extract the zip once you've transferred it.

Step 5: Create a startup script


Now that we have our PICO-8 zip extracted to our home directory, we can create a script that executes the appropriate binary after logging in, which should happen automatically after boot

At the familiar command prompt, type nano startpico8.sh and press Enter. This will launch a text editor called nano with a new file open called startpico8.sh. Add the following two lines:

echo "Starting PICO-8..."

./pico-8/pico8_dyn

  • Optionally, you can boot straight to SPLORE with this line instead:
    ./pico-8/pico8_dyn -splore

NOTE: On older Pi models, you may need to add a line that just says sleep 15 above the echo "Starting PICO-8..." line to allot time for startup processes to finish. This unfortunately adds 15 extra seconds to the startup, so only add the line if you can't get PICO-8 to launch correctly after login!

Press Ctrl+S and then Ctrl+X. You should be back at the command prompt.

Next type chmod +x startpico8.sh and press Enter. Then type ./startpico8.sh and press Enter again. If everything worked up to this point, PICO-8 should startup!

Press Ctrl+Q to shutdown PICO-8, then type nano .bashrc and press Enter. Press and hold the down arrow key until the cursor reaches the last line of the file. Press Enter to create a new line, then type ./startpico8.sh and press Enter. Now press Ctrl+S and then Ctrl+X.

Back at the command prompt, type reboot and press Enter. After the Pi boots, it should immediately login and launch PICO-8! :D

Troubleshooting

  • No sound
    If there is no sound, go back to the raspi-config tool and select System Options and then Audio and make sure audio is being routed to the correct output device.

  • The command line doesn't show the usual prompt or display PICO-8 after logging in
    Usually this is because PICO-8 starts and bash runs in the foreground. Try pressing Ctrl+C and wait to see if the command prompt appears after a few moments. I've found that adding the sleep 15 command to the first line of the startup script avoids this issue. If anyone knows what causes it any info would be appreciated!

  • A number of SDL-related errors are displayed, but no PICO-8
    Happens because PICO-8 starts too early after login. Press Ctrl+C to terminate the process and try adding the sleep 15 command before your echo "Starting PICO-8..." command in the startup script.

A few notes

  • While the goal is to effectively create a physical fantasy console, remember that the Raspberry Pi is still a real computer with an OS that is connected to the internet. It's good to upgrade packages every so often to fix issues and keep your system secure. If you've completed this tutorial, you should now know how to check for updated software packages and how to install them. If this sounds like a hassle, I would recommend considering keeping your installation offline. Or you can learn how to automate the process of keeping your system up to date. The world is your oyster!

Hope this was helpful! If this is your first experience with a Pi or Linux, I can promise you it isn't normally this much work to get an OS setup. You can always install the desktop version of Raspberry Pi OS (or any other OS) and use it just like you would use a Windows or macOS computer. I hope you'll continue to explore and learn how Linux works, maybe you can write a better guide than this one! See if you can figure out how to get the Pi to shutdown by itself after shutting down PICO-8 ;)

P#141946 2024-02-25 19:21 ( Edited 2024-02-28 14:29)

[ :: Read More :: ]

EDIT: I made a text guide! You can read it here: https://www.lexaloffle.com/bbs/?tid=140366

I learned how to make a minimal Raspberry Pi OS image for the Pi Zero W that boots up and goes straight into PICO-8, no desktop or anything. I could maybe upload a .img of it or just make a video tutorial. I can't find any current distro that does just this, only PicoPi, which isn't officially supported anymore. I don't make content or have an online presence or anything, I just thought maybe someone should do it. What do you all think?

EDIT: Feel like I should clarify that one would have to provide their own PICO-8 but once it's in the right place it runs it after booting. I wouldn't include it in my .img file

P#141706 2024-02-20 22:31 ( Edited 2024-02-26 21:38)