Raspberry Pi Remote Control [[RPRC]]

RPRC Introduction

The Raspberry Pi is a series of small single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and in developing countries.The original model became far more popular than anticipated,[7] selling outside its target market for uses such as robotics. It does not include peripherals (such as keyboards, mice and cases). However, some accessories have been included in several official and unofficial bundles.

Remote Control

Remote control of RPis comes in many different flavors, all with an issue that can be tricky. How do you access it from outside your firewall or home router? There are several options:

  • Dynamic DNS
  • Reverse Proxy
  • VPN

Most of these involve letting traffic from the Internet into your network or require a great deal of complicated setup. RPRC allows you to remotely setup, monitor and control the GPIO pins on your RPi from anywhere, securely, without any traffic coming inside your network. As a matter of fact, you do not even have to know your IP or Dynamic DNS hostname with this tool.

How RPRC Works

Diagram

RPRC requires a component to run on your RPi. When you configure this component, it connects to a real-time comm server. RPRC clients (running on web browsers, phones or tablets) also connect to the comm server and can interact in real-time with the RPi while it is behind your firewall with no incoming connections required. The RPi clients can:

  • Configure GPIO pins on multiple devices
  • Send output commands
  • Receive real-time status updates on inputs
  • View history of input changes, output commands sent, and other information

Getting Started

The setup consists of 3 steps:

  1. Create an account
  2. Setup software on 1 or more RPi devices
  3. Login to your account and/or install the app

RPRC Installation Instructions

Account Registration

First, register a new account at rprc.saisols.com

When entering your email and password, click the Create Account checkbox. This will show a password confirmation input and will create an account. After your account is created you will be logged in. You will get an account confirmation email each time you login until you confirm your email.

Unconfirmed accounts will be deleted after a few days, so confirm your email after you register.

Create Account

Once you are registered, you need to setup the software that runs on your RPi device to connect to the comm server.

Raspberry Pi Prerequisites

Login as root to your RPi device.

You can run this software as a non-root user if you know how to setup GPIO pin access as a non-root user. This is beyond the scope of this guide, so we are assuming you are running as root.

  1. Install Git and Python requirements by running:

apt-get -y install git python3 python3-pip python3-virtualenv

Verify git is installed by running git --version, you should see something like:

git version 2.7.4

  1. Setup virtual Python environment:

virtualenv --python=/usr/bin/python3 ~/virtual-python3

  1. Check out the code and change into the project directory:

git clone https://github.com/mikebski/com.saisols.rprc.git && cd com.saisols.rprc

  1. Edit auth.example.json and put your username and password in for your account

  2. Copy the example file to the correct location:

`mkdir /etc/rprc && cp auth.example.json /etc/rprc/auth.json'

  1. Install the dependencies with PIP:

. ~/virtual-python3/bin/activate && pip install -r requirements.txt

  1. Start the app:

. ~/virtual-python3/bin/activate && python rpi/app.py

This will run the app in the foreground and the app will stop when you logout. There are many ways to run this as a service, but this should get you up and running.

Now, go login to the web based tool at rprc.saisols.com and you sould see your Pi's serial number.

RPRC Setup

Select Pi Device

When you login, will either be redirected to your "Pi Device" page (if you only have 1 Pi running the software) or you will see a list of devices to select from:

Select Pi

Pi Device

Once you have selected a device you will see the "Device" screen that shows the pinouts of your Pi and what each pin is setup for. Use the legend at the bottom of the page to figure out what the colors mean.

Device

Setup

Click Setup to configure pins. You can configure an LED with the following options:

LED Setup

You can configure a "Button" with the following options:

Button Setup

Events

For a list of events click the Events menu item. Event List

Logout

Click Logout to logout.