How To Build Raspberry Pi Slot Machine

2019-01-02 Updated after comments from Guy
2019-07-21 Updated after comments from Bastiaan
2019-12-14 Updated after comments from AlexWiseman & Nick
2020-01-03 Updated after email from Ron
2020-02-11 Updated after comment from Stefan

Prerequisites

  • Raspberry Pi (tested with a Raspberry Pi 2 Model B)
  • Micro SD card (2GB+)
  • USB Hard Drive

Connect the Raspberry Pi 5V(Pin2) to Relay VCC Port (This is +5V) Connect the Raspberry Pi GPIO3(Pin5) to Relay IN port (Signal Out) Connect the Raspberry Pi only 1 ground pin (Pin6, Pin9, Pin14, Pin20, Pin25, Pin30, Pin34, Pin 39) to Relay GND port (Ground) Set the coin slot switches. The real money online casino world depends on bonuses to attract and retain players. With no physical location and no Raspberry Pi 2 Model B Sd Slot way to see the player face to face, a casino must find a compelling reason for you to make a deposit Raspberry Pi 2 Model B Sd Slot to try out their games, and the most Raspberry Pi 2 Model B Sd Slot common way to do so is to give you a.

Setup Pi with Raspbian

Install Raspbian Buster Lite on the SD card. Follow the instructions on the Installing images tutorial on the Raspberry Pi site. Then enable SSH. Insert the SD card into the Pi, plug in the USB hard drive, plug in a network cable, and power on the Pi.

Next set a static IP address for your Raspberry Pi. Depending on your setup, you can either set the Pi to have a manual ip address or have your router assign a static IP address.

Login to your Pi via SSH or old school with a keyboard & monitor. Run raspi-config to make any changes you want like changing hostname etc.

pi@timemachine:~ $ sudo raspi-config

And update your Pi

pi@timemachine:~ $ sudo apt-get update && sudo apt-get upgrade -y

Setup USB Hard drive

Install hfsutils & hfsprogs

pi@timemachine:~ $ sudo apt-get install hfsutils hfsprogs

Format USB hard drive to hfsplus. This will erase all data on the USB hard drive.

Note: this assumes your USB hard drive is sda2

pi@timemachine:~ $ sudo mkfs.hfsplus /dev/sda2 -v TimeMachine

Raspberry Pi How To Start

Create mount point

pi@timemachine:~ $ sudo mkdir /media/tm && sudo chmod -R 777 /media/tm && sudo chown pi:pi /media/tm

Determine the UUID of your USB hard drive (sda2)

Slot Machine Emulator Raspberry Pi

pi@timemachine:~ $ ls -lha /dev/disk/by-uuid

In my case the UUID is 6525d832-1a97-35a5-92a4-345253fcfd001.

Edit fstab to mount the USB hard drive

pi@timemachine:~ $ sudo nano /etc/fstab

and append this line (replacing 6525d832-1a97-35a5-92a4-345253fcfd00 with your specific UUID determined above).

UUID=6525d832-1a97-35a5-92a4-345253fcfd00 /media/tm hfsplus force,rw,user,noauto 0 0

It should end up looking something like this

Test that mounting works as expected

pi@timemachine:~ $ sudo mount /media/tm

should show a line like /dev/sda2 699G 300M 668G 0% /media/tm

Note: we are not automatically mounting this USB hard drive as mounting USB on startup can be flakey

Install Netatalk

Install prerequisites

What Is Raspberry Pi

pi@timemachine:~ $ sudo apt-get install netatalk -y

and ensure everything worked

Configure Netatalk

How To Build Raspberry Pi Slot Machine Software

Edit nsswitch.conf

pi@timemachine:~ $ sudo nano /etc/nsswitch.conf

append mdns4 and mdns to the line that starts with hosts. It should end up looking something like this.

Finally edit afp.conf

pi@timemachine:~ $ sudo nano /etc/netatalk/afp.conf

and append

Launch the two services

pi@timemachine:~ $ sudo service avahi-daemon start

pi@timemachine:~ $ sudo service netatalk start

Mount and start services on boot

Edit crontab

pi@timemachine:~ $ sudo crontab -e

and append

@reboot sleep 30 && mount /media/tm && sleep 30 && umount /media/tm && sleep 30 && mount /media/tm && sleep 30 && service avahi-daemon start && service netatalk start

Note: this mount / unmount / mount flow is required as HFS+ partitions may become read only if unmounted incorrectly. The 30 second sleeps give the USB hard drive time to spin up and become mounted before the avahi-daemon & netatalk services start

Connect to Time Machine

Connect to server

Login creds will be the same as your ssh creds on the pi

Note: default creds username: pi & password: raspberry

Open the Time Machine settings and you should see your new network time machine server

References: this is an updated version of a How to Geek article with some tweaks for flaky USB hard drives and updates for the latest packages.

Troubleshooting

Read only drive

If your drive becomes read only you can try either changing the permissions of the directory

How To Build Raspberry Pi Slot Machine

sudo chown pi:pi /media/tm

or forcing fsck.hfsplus to check and repair journaled HFS+ file systems

sudo fsck.hfsplus -f /dev/sda1