July 2, 2020

Raspberry Pi and Retro Arcade Adventures – Part 3 – Enter my son’s build of the console version …

In parts 1 and 2 of this series I have had a trip down memory lane in terms of the games of yesteryear that still mean something to me today and covered off a rather natty product from Pimoroni called the piCADE which is an arcade kit with the Raspberry Pi at it’s computing heart.

Like father, like son

In part 1 – I put together the Arcade version of the piCADE kit as familiarisation with both the Raspberry Pi and the piCADE kit for a project between me and my son that catered for both our interests and meant that I could help him when he got the chance to build his own console. So in this instalment I will go through how well my lad did and cover off the installation and configuration of RetroPie.

At this point I would like to apologise for the quality of some of the later screenshots in this part – I had to take them on my phone as the build progressed but I think that they get the point across to help you with yours!

Build of the console

As mentioned in my previous – the build of the console is slightly easier than the arcade – but there is still one thing that I wasn’t happy about and therefore will mention it again.

“The power button is absolutely shit”

It broke on both products – and, as an update in this part – it seems that the LED light was never destined to work due to a resistor being missing between the power from the HAT to regulate the current – as the LED on the replacement buttons that I ordered has burned out on both! I could be wrong – but it just seems the light won’t work on the supplied buttons or purchased replacements!

Anyhow, aside from the button issue and a few other minor problems that I detailed in the review – both versions of the console offer a lot of fun for the money that you pay – so with out further ado, how did my son’s build go?

As with the piCADE Arcade kit, we started out by laying the various parts out. I have to admit that I thought that I was anal about preparation but my lad took it to levels that I only ever dreamed of!
So, there are a few steps cut out here – mainly because they are based around the case, which to be fair is just a few brackets, nuts, bolts and MDF panels. However this picture shows the case almost assembled, with the Pi, HAT and speaker mounted. The final backing panel slots in when the joystick console is mounted on top of the case.
After he ate the case for breakfast my lad then started on the controller board. This was the usual sandwich perspex and decorative decal. I was quite impressed that he managed to get the protective covering off the perspex and assembled without any finger prints on the inside! Unlike his father who may as well of licked the inside of his!
So that’s the joystick mounted and orientated the correct way with all of the buttons slotted into place.
I thought that this would be the fiddly part for my lad. But he was really good with the dupont connectors. I suggested separating the wires out in to pairs from the looms as we could cable tie them later (something that I wish that I had thought of for my build.
He did a fab job unguided of wiring up the various terminals and a gorgeous effort with the cable ties.
Now with the Joystick console wired to the piCADE HAT on top of the Raspberry Pi – the dude was not far off having built his own arcade machine from scratch!
Essentially just the infamous power button to wire in and then fit the back panel and we could be away and installing RetroPie!

Installing RetroPie

RetroPie is a version of Raspbian developed specifically to act as an operating system which is purpose built for arcade and console emulation.

The process of installing RetroPie involves downloading Etcher and RetroPie (links below) – and using Etcher to burn a bootable RetroPie image to the MicroSD card that you will then install in the piCADE.

Etcher is available for both MacOs and Windows – the download page will detect your operating system version you need when you hit the page.

Etcher Download

RetroPie Download

I have found that Etcher on MacOS sometimes needs full disk access in order for it to write the image to the MicroSD – therefore I recommend that you grant that in MacOS System Preferences -> Security and Privacy.

You can run Etcher directly from the mounted Disk Image on MacOS – when you fire it up you will be presented with the following screen – double click on the balanaEtcher icon to launch the program.

From the main window – click on the “Flash from File” option (see below in blue).

From the open dialogue that appears, navigate to the RetroPie disk image and then click on the “Open” button.

Ensure that you have selected the MicroSD card that you wish to flash by checking the entry in the middle of the Etcher screen, then when ready click on the “Flash” button (in blue , below).

Etcher will then ask you to enter an administrative password to gain access to the MicroSD disk. Enter it and click on the “OK” button.

Etcher will then begin the process of writing the bootable RetroPie image to the MicroSD, this takes about two to three minutes including the verify process.

When flashing is completed you will see the screen below, the flashed disk will be unmounted so it is ready to place within the memory slot on the Raspberry Pi within the piCADE.

Place the flashed card into the slot as shown below – notice that the labelling on the SD card should be facing towards you.

Configuring RetroPie

In order to configure RetroPie you will need to have a USB keyboard to hand initially connected to the Raspberry Pi mainboard. This is because at this moment in time the drivers for the piCADE HAT (and therefore the Joystick etc.) are not installed. Take the back panel off the piCADE and connect the Keyboard to one of the free USB connectors (highlighted by the red square below) – be careful NOT to displace any of the wires that are inside the unit.

You should have something that looks like below when you are done.

Press the power button on the piCADE case and – with a bit of luck RetroPie will begin to boot.

You know that you are doing OK when you get the rather nice RetroPie splash screen come up (something that you can change if you wish – which I will show you in a later part).

When RetroPie has booted you will be taken into “Emulation Station” – this is a program that automatically starts after boot which serves as a rather lovely interface for all of the emulators that are supplied / installed on the O/S.

When you see it, hit the F4 key on the keyboard that you plugged in.

Enabling Wi-Fi

You will be taken to the shell here type in:

sudo raspi-config

As shown below – when you are done hit the <Enter> key.

From the menu that appears select option 2 and press the <Enter> key.

From the next menu – select option N2 – “Wi-Fi” and press the <Enter> key.

From the “Looooong Ting” list that appears select your country – in my case it’s GB (Britain UK) then press the <Enter> key.

You will be presented with a screen that confirms that the country has been set to the choice that you made on the previous screen – press the <Enter> key.

You will then be asked for the SSID of your Wi-Fi network – provide it and then press the <Enter> key.

Type in the password for your Wi-Fi network and then press the <Enter> key.

You will be returned to the main menu, using the Right hand arrow key on the keyboard select “Finish” and then press the <Enter> key.

You will be returned to the RetroPie shell – to check to see if the Wi-Fi network has been picked up type in:

ifconfig

You may need to do this a few times depending on how quickly the device joins the network – but you are interested in seeing a value for WLAN0 with an IP address (see bottom of the screen shot below).

When you see the IP Address type in the following command and press <Enter>.

curl https://get.pimoroni.com/picadehat | bash

This will connect to the piCADE drivers website, download them and then execute the bash installation script on your device.

You will be asked to confirm the installation – type “y” and then press the <Enter> key.

Various things will then happen such as the latest version of the drivers will be queried via the APT indexes.

The installation will execute and when completed you will be asked to reboot the console to do this type in the following command in the shell and press <Enter>:

sudo shutdown -r now

When the piCADE has rebooted you will be taken back into Emulation station. Here is where you can now configure the Joystick console controls.

Hold down a button on the Joystick console.

You will be presented in order the options for the Joystick.

You will see the first option starts with the directional control on the joystick.

Below I have provided button layout and mapping – when you have allocated all of the buttons on the piCADE you can skip the rest by holding down an allocated button until you reach the end. [ You can click on the image to make it larger ]

You will be prompted at the end in regard to not setting a hotkey button for exiting games. Ensure that “Yes” is selected. This isn’t important in the overall scheme of things as you exit all games by pressing Select and Start at the same time.

You will then be taken back to the main emulation station screen. What we are going to do next is enable SSH access to the console. SSH is useful for two reasons:

  • With SSH you can use Putty (Windows) or Terminal (Mac) to remotely access the bash shell on the piCADE for configuration.
  • Allowing SSH access will also allow for files (more importantly ROMS) to be uploaded to the console via an FTP client such as FileZilla.

Using the Joystick ensure that RetroPie configuration is selected and hit the A button.

From the menu that appears select the RASPI-CONFIG option and press the A button.

You will be taken to the RASPI-CONFIG interface, I recommend that you switch back to the keyboard to navigate around the menus as using the Joystick and buttons can become confusing!

From the options menu select item (5)Interfacing Options and press the <Enter> key.

From the next screen select P2 (SSH) and press the <Enter> key.

You will then be asked if you would like to enable the SSH server – select “Yes” and then press the <Enter> key.

You will then get a message confirming that the SSH server is enabled – press the <Enter> key

Exiting RASPI-CONFIG will take you back the the RetroPie configuration menu. If you already know your units IP address you can skip the next step – but I am including it for completeness. It’s important to know the IP as you will need it to connect to the piCADE via SSH for the completion of the configuration.

From the menu select the “Show IP” option.

You will then be shown the IP address of your piCADE – make a note of it and exit back to Emulation Station.

Finishing the configuration

So we are now on the home straight and the console is almost ready for use – there are just a few things left to do, which are:

  • Configure MacOS Terminal to connect remotely to the piCADE (the steps are not too dissimilar for Putty on Windows).
  • Modify a some values in two configuration files to ensure the device works properly.

Open a Terminal Session on your Mac and type in:

ssh [email protected]<ip address of your piCADE>

You will be asked if you would like to confirm that the host you are connecting to is trusted.

Type “Yes” at the prompt and  hit <Enter>. What you are effectively doing here is adding the Elliptic Curve Digital Signature Algorithm (ECDSA) fingerprint to the list of trust hosts on your Mac so it is recognised and trusted. In a nutshell it’s all to do with the PKI infrastructure of the SSH server on the piCADE – but if you are really interested you can learn more here.

After you have added the fingerprint to trusted hosts you will be prompted for the password for the “pi” account on the piCADE – the default is “raspberry“. Type that in and hit  <Enter>.

You will then be taken to the BASH console of your piCADE.

NOTE: This step is only relevant if you are NOT getting any video output via HDMI from your piCADE.

In this step we are going to check a value in RetroPie’s config.txt file. The value is:

hdmi_force_hotplug =  1

In essence this value forces RetroPi to use HDMI output rather than composite. This should be checked if you are not getting any video output from either the piCADE Arcade unit or the console.

I believe more recent versions of the curl script that we ran to install the piCADE HAT drivers changes this value for you – but it is worth checking just in case.

In order to view the value we are going to use the built in text editor NANO.

From the command line type in the following commands pressing  <ENTER>  after each one.

cd /boot

sudo nano config.txt

Within the file search for the line hdmi_force_hotplug=1 – it may be commented out (e.g. with a # before it) – remove the hash (as per below).

If you should need to edit the file – when you are done press the following keys:

Control + X – you will be asked if you want to save the file.

Press “Y” and <Enter>

You will be asked to confirm the filename – just press <Enter>.

Next we need to change a value in the RetroArch configuration file. RetroArch is an open source interface for a number of emulators. It is to all intents your window into the power of the piCADE.

It manages all kinds of things within the system – one of which is the button configuration.

What my son and I found was a slight configuration conflict between the piCADE’s “Select” button and the screen recording functionality that RetroArch provides for some games. It’s important to resolve this as you will use “Select” quite a bit and you don’t need Retroarch starting a video recording every time it is pressed!

In order to fix this – in the SSH session to the piCADE type in:

sudo nano /opt/retropie/configs/all/retroarch.cfg

Then press the <Enter> key.

The entry that we are looking for within the retroarch.cfg is “input_movie_record_toggle” – it’s buried in there quite deep so it’s a good idea to use the search functionality within nano to find the correct line. In order to do this:

Press Control + W

The will then ask you to enter a search string to find within the file. Type in:

input_movie

Then press <Enter>

Nano will then find the string that needs to be changed. When located you will need to remove the hash from the beginning of the line and then change it to look like the following:

input_movie_record_toggle = "nul"

As with the config.txt file – save it in NANO by pressing the CONTROL + X then when asked to save type in “y” and press <Enter>.

You will be asked to config the path and filename that you wish to save to – just press <Enter>.

You will need to reboot the piCADE and the device will finally be ready to install games. To do this type in:

sudo shutdown -r now

Phew! We got there and my lad did very well, where I was very impressed with how he grasped some fairly complex concepts from an electrical and software point of view.

In the next part I will take you through the concepts of ROMS (the games), how to install them and the legalities of doing so.

SHARE:
Blog, Technical Musings 0 Replies to “Raspberry Pi and Retro Arcade Adventures – Part 3 – Enter my son’s build of the console version …”