Instructions:
Set up your arcade system for net-booting
I followed
twistedsymphony's tutorial, except that I don't have a Zero-key yet. For my NAOMI IP address, I used 192.168.0.2. You can stop when you get to the section "Setting Up The Raspberry-Pi with Pi-Force Tools."
Set up your Raspberry Pi
I'm using the following components:
- Raspberry Pi 2
- 3.5" LCD screen with HDMI input (I bought mine from AliExpress about a year ago, but it looks like these are now on Amazon (sample link). Make sure to buy one that comes with a case, since that makes things easier.)
*Any Linux-based SBC should work as long as it supports whatever screen you decide to use. You may need to modify these steps a bit depending on your Linux distro, though. Any other screen should work fine too, but I prefer HDMI because it drives faster than the usual SPI displays and is simpler to use because there's no driver required.
- Install Linux. In my case I'm using the latest "Raspbian Stretch Lite" image. I extracted the .zip archive and then copied the .img file to my SD card with Etcher.
- Boot the system with a connected keyboard and Ethernet connection to your local network. When it's finished booting, you should see a line in the log that reads "My IP address is:" and its network address (you may need to squint or connect a larger display).
- Now that it's on your network, most of the following steps can be completed from another computer via an SSH connection. I'm on Windows, so I use Bitvise SSH Client.
Install Attract Mode
Attract Mode doesn't provide any pre-compiled binaries for arm platforms, so you'll have to download the source and build it yourself. It's pretty easy though - I just followed
the instructions on their GitHub page. I selected "Method 2" to also build ffmpeg for hardware acceleration, and didn't need any additional parameters beyond that. I have no idea how long this takes - I just let the build run overnight.
From the keyboard that’s attached to the Raspberry Pi, try starting Attract Mode to make sure it works:
$ attract
You can exit Attract Mode by pressing the Escape key and selecting “Yes” to confirm, then switch back to your SSH session on another computer to continue.
Configure Raspbian to Autostart Attract Mode
Set Raspbian to autologin:
$ sudo raspi-config
Select
3 Boot Options
Select
B1 Desktop / CLI
Select
B2 Console Autologin
Select
Finish and
Yes to reboot and verify that the change worked.
Create a one-line shell script that launches Attract Mode:
$ echo attract > /home/pi/attract.sh
Add this shell script to the default login routine:
$ sudo nano /etc/profile
Add a line at the bottom that says:
. /home/pi/attract.sh
Press CTRL-X to exit, press Y to save, and ENTER to confirm.
Note: From now on, Attract Mode will start every time a user logs in, even if it’s through SSH. Remember that you can use CTRL-C to kill the Attract Mode process if you don’t want it running in your SSH session. (Suggestions to make this better are welcome!)
Configure Network Settings
This section basically defines a profile called “static_eth0” and gives it the IP address 192.168.0.1. If DHCP fails, then it’ll fallback to this address instead. With this configuration, I can disconnect the Pi from the NAOMI system and plug it into my normal home network to make changes/updates, then reconnect it when I’m done.
$ sudo nano /etc/dhcpcd.conf
Scroll down towards the bottom and you should find a section to define a static IP if DHCP fails. Mine looks like this:
Code:
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
profile static_eth0
static ip_address=192.168.0.1/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
# fallback to static profile on eth0
interface eth0
fallback static_eth0
Press CTRL-X to exit, press Y to save, and ENTER to confirm.