Categories
Interior

How to use a raspberry pi as a networked time machine drive for your mac

Using a Raspberry Pi as a NAS macOS Time Machine (2020 edition)

01.05.2020 — macOS, linux, pi — 2 min read

Update December 2020: This appears to work on macOS Big Sur, using the latest Raspbian. Config also now uses HFS+ as the drive filesystem and AFP as the network protocol. SMB as the networking protocol I have not been able to get working reliably.

I’ve now had a few months of reliable, consistent automated Time Machine backups accomplished via my Mac and Rapberry Pi 4B now, attached to a spare 1TB 2.5″ USB 3.0 drive. Using the Pi 4B alongside some spare drives can give you a very versatile, cost-effective NAS and server.

Steps to set up

  • Ensure your Pi is fully up to date sudo apt-get update && sudo apt-get upgrade -y
  • Make sure the Pi uses a static IP on your local network (there are good guides on this, it is out of scope for this post)
  • Install dependencies: sudo apt install samba avahi-daemon hfsutils hfsprogs

Connecting and mounting the drive on the Pi

  • Plug in your drive into a USB port on the Pi and get the drive UUID with ls -lha /dev/disk/by-uuid . Make note of the drive reference and UUID
      • For the purposes of this guide, my drive reference will be /dev/sda1 and UUID is 8c9d728a-54f3-4948-81ea-f0482c89fc73
  • Format our drive to HFS+ format: sudo mkfs.hfs /dev/sda1 -v TimeMachine or use Gparted to repartition the drive and label it TimeMachine
  • Next, we want to auto-mount it to a designated folder, so run sudo nano /etc/fstab
    • Add this line to the bottom of the file: UUID=8c9d728a-54f3-4948-81ea-f0482c89fc73 /media/pi/TimeMachine hfsplus force,nofail,rw,noauto 0 0 (if your username is not pi , edit this path to use your nane instead and do the same in subsequent areas)
  • Reboot, and now run df -h and make sure your drive is present. sudo fdisk -l also for a little more verbosity. Make sure everything looks good based on the specs of the drive.

Networking from Pi

  • Install netatalk: sudo apt-get install netatalk -y
  • edit nsswitch.conf sudo nano /etc/nsswitch.conf
    • Line hosts: files mdns4_minimal [NOTFOUND=return] dns becomes hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
  • edit smb config: sudo nano etc/samba/smb.conf and append
  • edit file: sudo nano /etc/netatalk/afp.conf
  • Launch services sudo service avahi-daemon start and sudo service netatalk start

Find the Time Machine server on your mac

  • Let’s verify the drive is being properly shared. Go to Finder > Connect to server
    • Enter afp://192.168.1.50/ (use the local static IP for your pi instead though)
    • You should be prompted for your pi login info

How to use a raspberry pi as a networked time machine drive for your mac

  • Go to System Preferences > Time Machine
    • Select Disk > find your Disk
    • You’ll be prompted to log in again with your pi user
    • It would be wise to encrypt your backup when macOS asks you here, since it will be plainly readable on the external drive otherwise

And that should do it!

How to use a raspberry pi as a networked time machine drive for your mac

Troubleshooting

Drive appears read-only

How to use a raspberry pi as a networked time machine drive for your mac

  • Set drive permissions (such as sudo chmod -R 777 /media/pi/TimeMachine )
  • Alternatively, delete the above mount-point directory ( sudo rmdir /media/pi/TimeMachine ) and reboot (this fixed an issue for me that chmod did not)
General drive unreliability
  • Ensure above permissions are set, and also verify disk integrity — sudo fsck.hfsplus -f /dev/sda1 (or simply re-format)
Similar guides to try if this fails (this guide is a mashup of these two, with some sprinking of edited commands)

Gregology’s Raspberry Pi Time Machine — this guide is most similar to this one, but uses ext4 instead of hfsplus

Mudge’s Using a Raspberry Pi for Time Machine — uses ext4 and smb as a protocol, and other steps look good but I couldn’t get the macOS Time Machine service to find it

How to use a raspberry pi as a networked time machine drive for your mac

Nov 22, 2020 · 5 min read

Time Machine is built into the system of macOS and I’m using it since the early days of Mac OS X Leopard. If you have a Raspberry Pi (or two) lying around at your place like me, this tutorial comes in handy to create a cheap and speedy backup solution.

How to use a raspberry pi as a networked time machine drive for your mac

Update system software

Make sure your Raspberry Pi is running on the latest software.

Install Samba

We’re going to first install Samba (for SMB) which is a very popular Open Source file sharing protocol which is officially supported by Time Machine for backing up data over a network. The Avahi daemon is used for Apples “Bonjour” mDNS protocol that our Raspberry Pi server is automatically discoverable within the network.

Connect Hard drive to USB 3.0 port

As the Raspberry Pi 4 ships with 2x USB 3.0 ports we can connect an external hard drive as our disk space for backing up data. Also we should get decent speeds as we also get a 1GBit/s wired connection with the Pi 4.

Determine the device ID (UUID) of your USB drive

How to use a raspberry pi as a networked time machine drive for your mac

In my case the device was /dev/sdb1 and the UUID we’re looking for was the one below:

Note: exchange this UUID with yours

It will ask to set a password for your newly created user.

Set a password

In order to mount the USB hard drive we need to create a folder where Linux can mount our device to.

Mount device

We’ll now mount the USB drive to the previously created mount point.

Note that you’ll need to exchange /dev/sdb1 with your device (see the Step with the the UUID above which letter your device uses)

Take ownership

To allow our backup user to write on the device we’ll need to take over the ownership of the mount point:

Edit the Samba configuration file:

add the following to the end:

This will create a network drive called “ backups” which we’ll use for Time Machine.

Test Samba configuration

How to use a raspberry pi as a networked time machine drive for your mac

Restart service

Not let’s restart the service to make sure our changes are active.

Test connection to your Time Machine

On your Mac press “Command + K” on your desktop which will open the “Connect to Server” prompt. Type in the IP Address of your Pi followed by the /backups to connect to our Time Machine volume.

How to use a raspberry pi as a networked time machine drive for your mac

Now you should be connected to your Time Machine volume.

In order to let MacOS automatically detect our new Time Machine we’ll need to configure Avahi. For that edit the following file:

And paste this configuration in:

With this we tell MacOS that in fact our Raspberry Pi is a 8th Gen Time Capsule and it will appear like one in the sidebar in Finder.

A NAS solution can cost several hundred dollars. If you have an unused Raspberry Pi and a few hard drives lying around, you can make one yourself without spending a dime.

Networked hard drives are super convenient. You can access files no matter what computer you’re on — and even remotely.

But they’re expensive. Unless you use the Raspberry Pi.

If you happen to have a few of hard drives laying around you can put them to good use with a Raspberry Pi by creating your own, very cheap NAS setup. My current setup is two 4TB hard drives and one 128GB hard drive, connected to my network and accessible from anywhere using the Raspberry Pi.

What you will need

For starters, you need an external storage drive, such as an HDD, SSD or a flash drive.

You also need a Raspberry Pi. Models 1 and 2 work just fine for this application but you will get a little better support from the Raspberry Pi 3. With the Pi 3, you’re still limited to USB 2.0 and 100Mbps via Ethernet. However, I was able to power one external HDD with a Pi 3, while the Pi 2 Model B could not supply enough power to the same HDD.

In my Raspberry Pi NAS, I currently have one powered 4TB HDD, one non-powered 4TB HDD and a 128GB flash drive mounted without issue. To use a Pi 1 or 2 with this, you may want to consider using a powered USB hub for your external drives or using a HDD that requires external power.

Additionally, you need a microSD card — 8GB is recommended — and the OpenMediaVault OS image, which you can download here.

Installing the OS

To install the operating system, we will use the same method used for installing any OS without NOOBS. In short:

  • Format the SD card to FAT32 using SD Formatter.
  • Download the image file from Sourceforge.
  • Extract it using 7zip on Windows or The Unarchiver on Mac.
  • Write the extracted image to the SD card using Win32 Disk Imager on Windows or ApplePi-Baker on Mac.

More detailed installation instructions can be found here for both Windows and Mac. Just substitute the Raspbian image with OpenMediaVault.

Setup

After the image has been written to the SD card, connect peripherals to the Raspberry Pi. For the first boot, you need a keyboard, monitor and a local network connection via Ethernet. Next, connect power to the Raspberry Pi and let it complete the initial boot process.

Once that is finished, use the default web interface credentials to sign in. (By default, the username is admin and the password is openmediavault.) This will provide you with the IP address of the Raspberry Pi. After you have that, you will no longer need a keyboard and monitor connected to the Pi.

Connect your storage drives to the Raspberry Pi and open a web browser on a computer on the same network. Enter the IP address into the address bar of the browser and press return. Enter the same login credentials again ( admin for the username and openmediavault for the password) and you will be taken to the web interface for your installation of OpenMediaVault.

Mounting the disks

The first thing you will want to do to get your NAS online is to mount your external drives. Click File Systems in the navigation menu to the left under Storage.

Locate your storage drives, which will be listed under the Device column as something like /dev/sda1 or /dev/sdc2. Click one drive to select it and click Mount. After a few seconds have passed, click Apply in the upper right corner to confirm the action.

Repeat this step to mount any additional drives.

Creating a shared folder

Next, you will need to create a shared folder so that the drives can be accessed by other devices on the network. To do this:

  • Click Shared Folders in the navigation pane under Access Rights Management.
  • Click Add and give the folder a name.
  • Select one of the storage drives in the dropdown menu to the right of Volume.
  • Specify a path (if you want it to be different from the name).
  • Click save.

Enabling SMB/CFIS

Finally, to access these folders and drives from an external computer on the network, you need to enable SMB/CFIS.

Click SMB/CFIS under Services in the left navigation pane and click the toggle button beside Enable. Click Save and Apply to confirm the changes.

Next, click on the Shares tab near the top of the window. Click Add, select one of the folders you created in the dropdown menu beside Shared folder and click Save. Repeat this step for shared folders you created.

Accessing the drives over your network

Now that your NAS is up and running, you need to map those drives from another computer to see them. This process is different for Windows and Mac, but should only take a few seconds.

Windows

To access a networked drive on Windows, open File Explorer and click This PC. Select the Computer tab and click Map network drive.

In the dropdown menu beside Drive choose an unused drive letter. In the Folder field, input the path to the network drive. By default, it should look something like \\RASPBERRYPI\[folder name]. (For instance, one of my folders is HDD, so the folder path is \\RASPBERRYPI\HDD). Click Finish and enter the login credentials. By default, the username is pi and the password is raspberry. If you change or forgot the login for the user, you can reset it or create a new user and password in the web interface under User in Access Rights Management.

To open a networked folder in OS X, open Finder and press Command + K. In the window that appears, type smb://raspberrypi or smb://[IP address] and click Connect. In the next window, highlight the volumes you want to mount and click OK.

You should now be able to see and access those drives within Finder or File Explorer and move files on or off the networked drives.

There are tons of settings to tweak inside OpenMediaVault, including the ability to reboot the NAS remotely, setting the date and time, power management, a plugin manager and much, much more. But if all you need is a network storage solution, you’ll never need to dig any deeper.

This week I received a new MacBook Pro 2017 to use as my development machine when ‘on the go’ (or on the couch, to be more accurate). I also received a larger SSD to replace the boot drive on Desktop PC, and suddenly had a 120GB SSD with no job. I decided to put it to work to hold backups of my new mobile dev machine in the event of the worst case scenario. Now, I could have just tossed it in my external enclosure and plugged it in every once in a while for backups, but I know I’m too lazy to remember to do that often enough, and backing up wirelessly over the network is just so much more convenient and sounded like the kind of project I’d have a little fun with. Below is how the process went. If you stumbled upon this, you should be able to follow along with a few possible differences depending on the model of Pi you have. Make sure to read the following before moving to the instructions, as you’ll appreciate avoiding all the issues I ran into figuring this out. Thanks to HTG for getting me most of the way there.

Requirements

Raspberry Pi with Raspbian Jessie;

** You may be able to get this to work with stretch with some modifications, but some of the commands in my instructions WILL NOT work in Raspbian stretch when installing Netatalk.

SD/Micro SD Card and reader

Instructions

Install Raspbian Jessie Lite onto your PI. I recommend Win32 Disk Imager to write your image to your SD card if you have access to a Windows PC. Otherwise, google around for an equivalent for macOS.

! WAIT !

Before you go tuck your little headless computer away make sure to enable the SSH server. The SSH server is no longer enabled by default.

Format your external drive on your macOS machine to work with time machine.

Launch disk utility. Select your drive. Give it a name and set the format to ‘Mac OS Extended’, and scheme to GUID Partition Map. Click Erase.

How to use a raspberry pi as a networked time machine drive for your mac

Open finder and right click your drive. Select Get Info’.

How to use a raspberry pi as a networked time machine drive for your mac

Set ‘everyone’ to ‘Read & Write’, and check ‘Ignore ownership on this volume’

How to use a raspberry pi as a networked time machine drive for your mac

Now unmount the drive and go plug it into your Raspberry Pi.

Update your repositories and update your packages.

Install packages hfsprogs and hfsplus:

Create the following directory:

Modify the permissions of the directory with this command:

Configure Pi to mount drive on start up.

Find your drives UUID (Universally Unique Identifier) with this command:

How to use a raspberry pi as a networked time machine drive for your mac

Modify your fstab file to automatically mount your external drive on boot-up:

How to use a raspberry pi as a networked time machine drive for your mac

The line you want to add will look like this. Feel free to copy, paste, and modify with your UUID.

! BE CAREFUL !

Make sure you enter this correctly, as messing up here and not realizing will corrupt your fstab file and if you reboot before correcting it, your pi will not boot correctly. In the event of this, you’ll have to edit your fstab file from another Linux system to fix your mistake.

Test that your drive mounts correctly after this modification:

If you don’t get an error here, then you’re set.

Use the following command to install all the dependencies you need at once

sudo aptitude install build-essential libevent-dev libssl-dev libgcrypt11-dev libkrb5-dev libpam0g-dev libwrap0-dev libdb-dev libtdb-dev default-libmysqlclient-dev avahi-daemon libavahi-client-dev libacl1-dev libldap2-dev libcrack2-dev systemtap-sdt-dev libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libio-socket-inet6-perl tracker libtracker-sparql-1.0-dev libtracker-miner-1.0-dev

Download the latest version of Netatalk by making sure you have the correct version number with the following command

Unpack the file:

Switch to the new folder created, and run this command to configure Netatalk’s settings:

You are now going to build the source in this folder. This takes a little while.

Ensure it’s running with this command:

We’ve now got to configure Netatalk

To get your Time Machine drive to show up in Finder’s sidebar you’ll need to add this to the line that begins with ‘hosts’:

How to use a raspberry pi as a networked time machine drive for your mac

and add this block of text to the file:

Now set up your external drive as a network share.

Change the two sections that start with [Global] and [My Time Machine Volume] to this text:

Now you need to start the network services with these commands:

! IMPORTANT !

Make sure you set your Pi to start these services every time your Pi boots with these commands:

We’re almost done.

Now hop on to your Mac and you should see your Pi under ‘shared’ inside of Finder.

How to use a raspberry pi as a networked time machine drive for your mac

Hit ‘Command + K’ to connect to the server with your Pi’s IP address (which you should have given a static IP from your router)

How to use a raspberry pi as a networked time machine drive for your mac

Now go to System Preferences > Time Machine and select the drive as your Time Machine backup.

How to use a raspberry pi as a networked time machine drive for your mac

How to use a raspberry pi as a networked time machine drive for your mac

Now to get a bigger drive!

You’ve now got a fully functional Raspberry Pi Time Machine

Thanks again to HTG for the initial guide I followed and for not getting upset over me borrowing your macOS screenshots.

By Les Pounder 15 May 2021

Make your own low power Chia Coin farming system.

How to use a raspberry pi as a networked time machine drive for your mac

After you’ve gone through the process of building Chia Coin plots on a PC (see how to farm Chia Coin), there’s no need to waste the electricity and tie up expensive computer hardware keeping those plots connected to the Internet. Instead, it’s best to take an external drive or drive(s) with the plots on them and hook them up to a Raspberry Pi where they can stay online, without gulping down too much juice.

In this tutorial, we will create a custom Raspberry Pi Chia farming device powered by the latest Ubuntu 64-bit release for the Raspberry Pi. The unit is designed to be hidden away, farming Chia Coin silently while we go about our lives. As such we chose to house the Raspberry Pi 4 inside of a passively cooled case. Our choice this time was the Akasa Gem Pro which has great cooling for the SoC, PMIC and PCIe chip and a rather tasteful, if unusual design.

For This Project You Will Need

  • Raspberry Pi 4 4GB
  • Raspberry pi case, perhaps one of the best Raspberry Pi cases, with cooling
  • An external USB storage drive or SSD / HDD with USB 3.0 caddy.
  • 16GB Micro SD card or larger
  • Raspberry Pi Imager tool
  • Accessories to use your Raspberry Pi 4

Installing Chia On Raspberry Pi 4

1. Install Ubuntu 21.04 to a 16GB micro SD card using the official Raspberry Pi Imager tool. You can also try a headless installation.

2. Connect your keyboard, mouse, screen and Ethernet cable. If you did a headless install, you can skip the keyboard / mouse / screen. Boot your Raspberry Pi 4 and complete the Ubuntu 21.04 installation process. Reboot the Raspberry Pi for all the changes to take effect.

3. Open a terminal and update the software repositories, then upgrade the system software.

4. Install the openssh server to enable remote monitoring via an SSH session. After installation this will automatically start the SSH server as a background service.

5. Install and start Byobu, a terminal multiplexer that will enable us to log out of the Pi and leave our Chia farm running.

6. Make a note of your Raspberry Pi’s IP address and hostname.

7. Install the Git version control software and a number of essential dependencies to build the Chia application.

8. Clone the Chia git repository containing the latest version.

9. Change directory to chia-blockchain and run the installer.

10. Activate the Chia virtual environment and create a new Chia config.

11. Connect your USB 3.0 hard drive containing your Chia plot to the blue USB 3.0 ports on the Raspberry Pi 4. The drive will mount to a directory inside of /media/.

12. In the terminal change directory to your USB drive. Our test drive is at /media/les/Chia/

13. Add the plot from your USB drive to the Chia config using the 24 word key, created when the plot was created. Enter the command and then type the 24 words with a space between each word.

14. Start farming the plot; this will also start services for your wallet. This command will only show that the process has started.

15. Use this command to see the process of syncing our machine to the network and to confirm that farming has begun. The command will update every two seconds. This command can be stopped by pressing CTRL + C.

16. Press F6 to detach from the current Byobu session. This releases us from the running session but it keeps the previous command to view our farming progress running in the background. Should you wish to go back to that Byobu session type this command.

It will take some time for the Pi to sync with the Chia network but it will still continue to farm as it syncs. Right now if you wish, you can unplug the monitor, keyboard, mouse. Leaving just the power, network and USB 3.0 drive connected. Your Pi will happily farm Chia quietly in the corner of the room. But to access the Pi we now need to use SSH, a secure shell terminal and for that we need to instal a client on our computer.

Should you ever need to manually start the Chia farmer, for example after a reboot, start byobu and repeat steps 14 to 16.

How To Remotely Access Your Raspberry Pi Chia Coin Farm

1. Install PuTTY on your PC. PuTTY is used to make remote serial connections, SSH, with our Raspberry Pi 4.

2. Open PuTTY and in the Host Name or IP Address field enter the hostname or IP address of your Raspberry Pi 4. Click Open.

3. Enter your username and password to remotely login to the Raspberry Pi 4.

4. Open the Byobu session to see the current progress.

Auto Mount USB Drive on Boot

Should we need to power off our P, or there is power loss, we need the drive to automatically be ready to farm Chia with little interaction. It is best to connect your keyboard, mouse and screen for this part of the project but it can also be done remotely using an SSH connection.

1. With the USB drive connected, open a terminal and list all the attached devices. Our device is sda1 which is connected to the mountpoint /media/les/Chia. Make a note of your mountpoint, we will need this later.

2. Run this command to identify the UUID of your drive. Copy the text which starts UUID=. For example our UUID was UUID=”b0984018-3d5e-4e53-89d9-6c1f371dbdee

3. Open the filesystem configuration file, fstab with sudo.

4. Add this line to the end of the file. Add your UUID after the =, and leave a space before entering the mountpoint. Here is how our drive is configured.

5. Press CTRL+ X then Y and Enter to save.

6. Reboot the Raspberry Pi.

How to use a raspberry pi as a networked time machine drive for your mac

It is highly likely that you are using an 8GB SD or Micro SD card with your Raspberry Pi. This is adequate for many purposes, but if you fully load your Raspberry Pi with additional applications (see my tutorial on installing more applications on your Raspberry Pi), you may find yourself running short on space. Of course, you can use a larger SD card, but if you have a Network Attached Storage (NAS) at home, you can access and store files on the NAS.

In this tutorial you will learn how to access that external device. Note, however, that there may be differences depending on what device you are using.

Types of Network Drive

There are three main ‘formats’ that network drives use to allow access to their files; Samba, NFS and AFP. Each was originally designed for sharing files over Windows, Unix/Linux and Apple networks. However, most computers can share files between these three types. The main differences between them are the way that they transfer files and the way that file permissions are stored. Fortunately, your Raspberry Pi can access files on them all.

Accessing Files from the Desktop

The easiest way to see what files and folders are being shared on your network is to use the File Manager. Boot your Raspberry Pi into Desktop mode and open the File Manager from the Menu, under Accessories:

How to use a raspberry pi as a networked time machine drive for your mac

This will open the File Manager:

How to use a raspberry pi as a networked time machine drive for your mac

To find out whether there are any servers sharing folders over your network, use the Go -> Network menu option:

How to use a raspberry pi as a networked time machine drive for your mac

This will show you what is being shared:

How to use a raspberry pi as a networked time machine drive for your mac

I have a few NAS drives as well as PCs and Macs sharing over my network, as you can see above. (If you can guess the naming convention I use for my home servers, why not tweet me at @Geeky_Tim?).

Open any of the server shares you see on the list to see whether they are sharing anything. Unless you have allowed ‘guest’ access on any of your shared folders, you are likely to be asked for a username and password:

How to use a raspberry pi as a networked time machine drive for your mac

You may need to access your NAS via its control panel (often a web page) itself and add more accounts so that your Raspberry Pi can access its stored files. I find that for non-sensitive files, like music, videos and photographs, a read-only account can be useful to allow any number of computers on your home network to access those files. Your NAS may allow ‘guest’ accounts, which means that you do not need to specify a username and password to access the files. Of course, for sensitive files you should always password protect folders and files appropriately.

If you have write permissions to network drives, you should now be able to copy and create drives over the network and store them away from your Raspberry Pi. This is an excellent way to backup your project files from your Raspberry Pi.

In a future tutorial, I will show you how to access network drives from the command line, and make those drives reconnect each time you boot your Raspberry Pi.

You’re probably already familiar with some of the many services that block ads on your computer and other devices. But with the Raspberry Pi, you have the ability to do something a little more drastic: block ads at the router level. That means no ads on your computer, of course, but also no ads on your smartphone, tablet, or any other device on your network.

Sounds great, right? Here’s how to do it.

How to use your Raspberry Pi as a network-wide ad blocker

To block ads at the router level, we’ll use Pi-hole, a server program. We’ll install it on Raspbian, so start by installing Rasbian and updating it (sudo apt-get update && sudo apt-get upgrade) if you haven’t yet.

Step 1: Launch the Pi-hole installation wizard

Hop into the Terminal and enter this command:

This will bring up the installation wizard. The installation wizard is going to tell you that since Pi-hole is a server, it needs a static IP address. It will say this in ALL CAPS to EMPHASIZE IT. Okay, okay, we’re listening.

How to use a raspberry pi as a networked time machine drive for your mac

Step 2: Choose an interface and configure your static IP settings

Go ahead and hit okay to get the installation wizard to stop yelling at you, and then choose between Wi-Fi and Ethernet. Either will work.

How to use a raspberry pi as a networked time machine drive for your mac

Once you’ve chosen, the installation wizard will ask you if you want to “use your current network settings as a static IP address.” You can go ahead and do so, okaying the default settings on the next couple of screens, unless you’re moved to do otherwise for some reason.

How to use a raspberry pi as a networked time machine drive for your mac How to use a raspberry pi as a networked time machine drive for your macHow to use a raspberry pi as a networked time machine drive for your mac

Once you’ve ’d the installation wizard into submission, it will dutifully install the packages and let you know when it’s complete.

Step 3: Write down your Raspberry Pi’s IPv4 address

When the installation wizard wraps up, you’ll get a dialogue box titled “Installation Complete!” In that box will be your Pi’s IPv4 address. Write that down along with your password, because you’re gonna need them.

How to use a raspberry pi as a networked time machine drive for your mac

This is also a good time to visit the admin interface and admire your handiwork.

How to use a raspberry pi as a networked time machine drive for your mac

Step 4: Change your server’s DNS settings

Now everything that runs through your Pi-hole server will have ads blocked – hooray! Only, uh, nothing is running through it yet. Let’s change that and force your device traffic through the server.

This part will be different depending on your operating system:

Windows

  1. Right-click the Start button and select Network Connections
  2. Right-click your Ethernet or Wi-Fi network and select Properties
  3. Double-click Internet Protocol Version 4 (TCP/IPv4)
  4. Click Use the following DNS server addresses.
  5. Enter your Raspberry Pi’s IP address as the Preferred DNS server.
  6. Click OK and then, once again, OK
  1. Click the Apple menu and navigate to System Preferences…>Network>[your network]>Advanced…>DNS
  2. Click the plus sign on the left side and enter your Raspberry Pi’s IP address
  3. Click OK and then Apply

Android

  1. Navigate to Settings>Wi-Fi
  2. Press and hold your current network and then navigate to Modify Network>Show Advanced Options
  3. Change the IP Settings to Static
  4. Enter your Raspberry Pi’s IP address under DNS 1
  5. Tap Save
  1. Navigate to Settings>Wi-Fi>[your network]>DNS
  2. Enter your Raspberry Pi’s IP address.

Once you’ve done this, you shouldn’t see ads anymore.

Step 5: Would you like to whitelist some sites? (optional)

Alright, all set! You are now successfully blocking all ads at the router level.

To whitelist sites, head to the Pi-hole interface in your browser as we did back in Step 3 – though this time you will need to log in to the interface using the password that Pi-hole provided.

How to use a raspberry pi as a networked time machine drive for your mac

Click Whitelist and add sites that you want to whitelist.

The mini machine is back.

The Raspberry Pi 4 is here, and in short order, the internet’s most tech-savvy hobbyists immediately got to work.

Ever since the original credit card-sized computer launched in 2012, it inspired a range of DIY designs, ranging from the mundane to the downright bizarre. The $35 piece of kit can be used to power all manner of setups, acting as a home media server or a smart home automator. Its tiny size is perfect for customization, making it possible to put in a tiny computer in a wide array of devices.

The latest Pi 4, launched on Monday, has the following specs:

  • Broadcom BCM2711 quad core Cortex-A72 system-on-a-chip at 1.5GHz.
  • 1GB, 2GB or 4GB of RAM
  • Bluetooth 5.0, 802.11ac Wifi and Gigabit Ethernet
  • Two USB3 ports, Two USB2 ports, and two micro-HDMI ports that support two 4K displays.
  • A USB-C connector for power.

With the launch of the new model, here’s some of the most unique projects that have emerged over the years:

Taking Care of a Plant

The Raspberry Pi can help you crowdsource your chores!

Tyler Jaywood is the creator of TakeCareOfMyPlant, a project that combines a Raspberry Pi with a Homasy submersible water pump. The computer is then hooked up to a subreddit, where users vote on whether to give Freyja the zebra plant some water.

Every morning, at midnight Mountain time, a Reddit bot posts a new thread for the day. Users comment “yes” or “no” to vote whether to add water that day. The votes are counted at 8 p.m. Pacific time and the water is administered depending on the results.

A Nest webcam provides a real-time view of the action, so users can watch the watering take place once voting is completed. The system also indicates moisture, temperature, humidity and sunlight levels to help users make a more informed decision about the zebra plant’s watering needs.

The subreddit has over 10,000 users at the time of writing. Why do household chores when you can delegate to the internet?

Makeshift Bus Timers

No bus timetable? No problem!

This was thanks to a Montreal-based Good Samaritan named Greg Sadetsky, who noticed that people across the street from his co-working space struggling to work out when the next bus would arrive. To solve the problem, he took a 28-inch monitor, linked his Raspberry Pi to the bus company’s website, and used the data to display a giant readout of when the next bus would arrive:

A Tiny Braille Laptop

Ready to slim down your laptop even further? Mario Lang created a whole machine using a braille display and a Raspberry Pi.

Braille displays, historically, are pretty huge. A 40-cell display used to take up the entire underside of a 13-inch laptop. Newer form factors can fit in front of the laptop, but that involves juggling two devices on your lap. To make working on a computer more comfortable for the visually impaired, Lang bought the Handy Tech Active Star 40, which maintains the old form factor but has updated internals.

The newer device had some empty space, not quite large enough for a smartphone, but still with a micro-USB cable to power something. He then used the Raspberry Pi Zero to create an ultra-low-power, super-slim braille laptop. It has Bluetooth connectivity and a 64GB SDHC card. Lang is now considering a kit to help other blind users try it for themselves.

An All-In-One Arcade Game Machine

“RetroPie” uses a variety of open source projects to provide an easy-to-install emulator for a number of classic systems. It uses RetroArch to power the games and an emulation system that supports a variety of old consoles from the Amiga right up to the Nintendo Wii.

Reddit user “Djurkinthebox” used RetroPie to create the ultimate arcade machine:

The project used a Pi 3B+, a Dell P190ST monitor from Goodwill, HAPP buttons and Zippyy flight sticks. They are paired with EasyGet Zero Delays encoders to make the project run. The whole thing is encased with half a sheet of three-quarter inch MDF. The whole project cost just over $130 to make, not counting the joysticks and buttons.

Alternatively, build out an on-the-go arcade machine like Reddit user “stahl80”:

Magic Mirror

Magic Mirror is an open source smart mirror platform that can make you feel like you’re living in the sci-fi future. It can display the weather, date, time and more information as you’re getting ready.

Imgur user “TheREDNAVE” used the project to build his own creation:

The mirror above uses a Raspberry Pi 3, a 40-inch TCL TV and a one-way mirror. The whole thing cost $750 to build, including $280 in labor costs for a carpenter.

A Bartender

Why not get your Raspberry Pi to fix you a drink? Reddit user “bigdogyost” used it to power a robotic bartender, using a Java app that controls eight solenoid valves. The valves dispense drinks depending on the recipe. Its prototype isn’t the prettiest, but it works. The project is open sourced at GitHub.

A Black Box for the Car

RoadApplePi can hook into a car’s OBD2 diagnostic port, giving a real-time readout of the current state of the vehicle. It also uses hardware-accelerated video encoding to provide smoother dashcam footage.

An Automated Cat Flap

HackerNews user “jonaswi” used their device to open the door when the cat is nearby. As they live in an apartment with strict fire safety regulations, a conventional cat flap was out of the question.

I installed a fire-protecion-approved door drive that is hooked to a raspberry pi. Another raspberry pi then analyzes a video stream and detects my cat. If my cat is in the frame for n amount of time, a message is sent to the pi conntected to the door drive and the door opens up slightly for him to get in.

A Network-Wide Ad Blocker

If you can’t stand internet ads, the Raspberry Pi could help. Pi-hole is an open source ad blocker that runs on the tiny computer, routing all ad-serving domains to a dead end before they can reach the device. It’s rather more involved than a software-based ad blocker, but it’s perhaps the last such blocker you may ever need.

A Smart Infinity Table

Reddit user “torchic_for_dinner” used the tiny computer to produce a table of the future:

The end result uses 50 RGB LEDs, a Raspberry Pi, and some wiring to create stunning visual effects. Users can even flick through the light settings, or choosing a new color from their smartphone or tablet. The whole construction cost $550, $180 of which was the two-way mirror.

While the Raspberry Pi may not be most powerful computer around, its size and customizability have unleashed incredible creativity. And its proponents are just getting started.

You’re probably already familiar with some of the many services that block ads on your computer and other devices. But with the Raspberry Pi, you have the ability to do something a little more drastic: block ads at the router level. That means no ads on your computer, of course, but also no ads on your smartphone, tablet, or any other device on your network.

Sounds great, right? Here’s how to do it.

How to use your Raspberry Pi as a network-wide ad blocker

To block ads at the router level, we’ll use Pi-hole, a server program. We’ll install it on Raspbian, so start by installing Rasbian and updating it (sudo apt-get update && sudo apt-get upgrade) if you haven’t yet.

Step 1: Launch the Pi-hole installation wizard

Hop into the Terminal and enter this command:

This will bring up the installation wizard. The installation wizard is going to tell you that since Pi-hole is a server, it needs a static IP address. It will say this in ALL CAPS to EMPHASIZE IT. Okay, okay, we’re listening.

How to use a raspberry pi as a networked time machine drive for your mac

Step 2: Choose an interface and configure your static IP settings

Go ahead and hit okay to get the installation wizard to stop yelling at you, and then choose between Wi-Fi and Ethernet. Either will work.

How to use a raspberry pi as a networked time machine drive for your mac

Once you’ve chosen, the installation wizard will ask you if you want to “use your current network settings as a static IP address.” You can go ahead and do so, okaying the default settings on the next couple of screens, unless you’re moved to do otherwise for some reason.

How to use a raspberry pi as a networked time machine drive for your mac How to use a raspberry pi as a networked time machine drive for your macHow to use a raspberry pi as a networked time machine drive for your mac

Once you’ve ’d the installation wizard into submission, it will dutifully install the packages and let you know when it’s complete.

Step 3: Write down your Raspberry Pi’s IPv4 address

When the installation wizard wraps up, you’ll get a dialogue box titled “Installation Complete!” In that box will be your Pi’s IPv4 address. Write that down along with your password, because you’re gonna need them.

How to use a raspberry pi as a networked time machine drive for your mac

This is also a good time to visit the admin interface and admire your handiwork.

How to use a raspberry pi as a networked time machine drive for your mac

Step 4: Change your server’s DNS settings

Now everything that runs through your Pi-hole server will have ads blocked – hooray! Only, uh, nothing is running through it yet. Let’s change that and force your device traffic through the server.

This part will be different depending on your operating system:

Windows

  1. Right-click the Start button and select Network Connections
  2. Right-click your Ethernet or Wi-Fi network and select Properties
  3. Double-click Internet Protocol Version 4 (TCP/IPv4)
  4. Click Use the following DNS server addresses.
  5. Enter your Raspberry Pi’s IP address as the Preferred DNS server.
  6. Click OK and then, once again, OK
  1. Click the Apple menu and navigate to System Preferences…>Network>[your network]>Advanced…>DNS
  2. Click the plus sign on the left side and enter your Raspberry Pi’s IP address
  3. Click OK and then Apply

Android

  1. Navigate to Settings>Wi-Fi
  2. Press and hold your current network and then navigate to Modify Network>Show Advanced Options
  3. Change the IP Settings to Static
  4. Enter your Raspberry Pi’s IP address under DNS 1
  5. Tap Save
  1. Navigate to Settings>Wi-Fi>[your network]>DNS
  2. Enter your Raspberry Pi’s IP address.

Once you’ve done this, you shouldn’t see ads anymore.

Step 5: Would you like to whitelist some sites? (optional)

Alright, all set! You are now successfully blocking all ads at the router level.

To whitelist sites, head to the Pi-hole interface in your browser as we did back in Step 3 – though this time you will need to log in to the interface using the password that Pi-hole provided.

How to use a raspberry pi as a networked time machine drive for your mac

Click Whitelist and add sites that you want to whitelist.