Learn how to control your Raspberry Pi from anywhere using a smartphone app and internet access.

In this tutorial, we will guide you through the steps of setting up remote control on your Raspberry Pi using a smartphone app and internet access. You will be able to monitor your Raspberry Pi’s stat …


Updated October 24, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


In this tutorial, we will guide you through the steps of setting up remote control on your Raspberry Pi using a smartphone app and internet access. You will be able to monitor your Raspberry Pi’s status, view live camera feed, and execute commands remotely from anywhere in the world!

Introduction

Controlling your Raspberry Pi remotely has never been easier with smartphones and the internet. In this tutorial, we will walk you through setting up remote control on your Raspberry Pi using a free app called “RemotePi”. With RemotePi, you can monitor your Pi’s status, view live camera feed, and execute commands remotely from anywhere in the world!

Prerequisites

Before we begin, make sure you have the following:

  • Raspberry Pi with internet access (either through WiFi or ethernet)
  • Smartphone with RemotePi app installed (available on both iOS and Android)
  • Raspbian or any other Linux distribution installed on your Pi

Step 1: Install Node.js on the Raspberry Pi

RemotePi requires a web server to run, and we will use Node.js for this. Follow these steps to install it:

sudo apt update
sudo apt upgrade
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt-get install -y nodejs

Step 2: Install RemotePi on the Raspberry Pi

Now, we will download and install RemotePi using npm (Node Package Manager):

sudo npm install -g remotepi

Step 3: Start RemotePi Server

To start the server, run the following command:

remotepi

By default, RemotePi will run on port 8081. You can change this by running remotepi -p <port number> if needed.

Step 4: Set up a static IP address for your Raspberry Pi

To ensure that your Raspberry Pi always has the same IP address, you need to set up a static IP. This is optional but recommended as it makes remote access easier. To do this, follow these steps:

  1. Open /etc/dhcpcd.conf in your favorite text editor: sudo nano /etc/dhcpcd.conf
  2. Add the following lines at the end of the file (replace <ip address>, <subnet mask>, and <router ip> with appropriate values for your network):
interface eth0
static ip_address=<ip address>/<subnet mask>
static routers=<router ip>
static domain_name_servers=8.8.8.8.8 8.8.4.4
  1. Save and exit the file (Ctrl + X, Y, Enter)
  2. Restart the networking service: sudo systemctl restart dhcpcd

Step 5: Configure your Router for Port Forwarding (optional)

If you want to access your Raspberry Pi from outside of your local network, you need to set up port forwarding on your router. This step is optional but necessary if you want to access your Pi from anywhere in the world. To do this:

  1. Log in to your router’s administration page (usually http://192.168.0.1 or http://192.168.1.1)
  2. Look for “Port Forwarding” or “Virtual Server” settings and add a new rule forwarding port 8081 (or the port you set up in Step 3) to your Raspberry Pi’s static IP address.

Step 6: Connect RemotePi App to Your Raspberry Pi

Open the RemotePi app on your smartphone, go to “Settings” and enter your Raspberry Pi’s IP address (either local or public depending on whether you set up port forwarding). You can find your Pi’s IP address by running hostname -I on the command line.

If you set up a static IP address, use that. If not, make sure your Raspberry Pi is connected to the same network as your smartphone and enter the local IP (e.g., 192.168.0.10).

Press “Connect” in the app, and you should be able to see a live camera feed from your Pi’s camera, control its GPIO pins, and execute terminal commands remotely!