content
Overview
Why Rpisquare?
Prerequisites
What's in (RPi)² for you?
How to get started?
Support
Acknowledgements
About
resources
rpi-io module
rpisquare-agent module
rpisquare-sdk module
app.rpisquare.com
(RPi)²

Raspberry Pi Remote Programming Interface

The complete solution to control peripherals of remote Raspberry Pi devices.

Overview

Why Rpisquare?

Controlling I/O peripherals with Raspberry Pi devices is a very convenient way to design and to prototype advanced automation systems, robots or drones.

The possibilities are even greater if these robots can be controlled remotely in real-time conditions.

That's exactly the goal of Rpisquare i.e. to provide a cloud infrastructure and a set of modules to control Raspberry Pi peripherals amongst Internet.

Thanks to Rpisquare a.k.a. (RPi)², it is now easy to control I/O peripherals connected to any Raspberry Pi from your remote projects.

Prerequisites

(RPi)² is aimed at people already familiar with basic electronics and JavaScript that is the main programming language used in Rpisquare.

For those discovering Raspberry Pi and their GPIO bus-based peripherals, here are some tutorials:

What's in (RPi)² for you?

Rpisquare is composed of:

  • JavaScript modules to install on your RPis and to integrate in your projects,
  • a Web App to configure what devices and GPIOs can be controlled remotely,
  • an API server for HTTP and socket communication between these components.

JavaScript modules

rpi-io is a lite ESM module to control Raspberry Pi GPIO in Node.js>. It can be used independently of any other (RPi)² module to control the GPIO peripherals of an RPi. Further details on GITHUB and NPM.

rpisquare-agent is a module to install on RPi devices for remote control of GPIO from both (RPi)² configuration Web App or any project that integrate the rpisquare-sdk.

rpisquare-sdk is a module to integrate in either a Node.js project or in a browser JavaScript app to control remote RPi peripherals.

Web App

app.rpisquare.com is the place to configure what RPis and peripheral can be controlled remotely. Users can manage as many Raspberry Pi devices and peripherals as they wish and monitor their operations thanks to an embedded console.

API Server

Users have no direct access to the (RPi)² API server. It is the under the hood real-time communication service that makes the links between the modules and apps. It is based on standard HTTP communication and socket.io WebSocket.

Please note: API server is hosted in France.

How to get started?

rpisquare-process
Recommended (RPi)² design process

① Design your electronic project

If it is your very first project, I recommend starting with a Starter Kit such as those from Freenove to familiarize yourself with electronic circuits and components.

starter kit
Example of electronic kit

List the input/output types you will need to control and verify that they are well-supported by (RPi)². To do this, refer to the rpi-io documentation. If you don't find that the type of input/output you need, please let me know in the discussion section.

Also select the Raspberry Pi model that best suits your goals and constraints. A Raspberry Pi 4B can be reasonable trade-off between cost and performance.

② Test your project locally on the RPi device with rpi-io

Before considering remote uses, be sure that your electronic circuit works locally. For this, please use the rpi-io module which defines the technical scope of the inputs and outputs supported by (RPi)².

At this stage, I encourage you to perform exhaustive tests of your circuits in order to minimize issues in remote use. rpi-io version includes the following functions:

  • Write to output lines
  • Read and monitor input lines
  • Control PWM-based peripherals
  • Misc utilities

③ Deploy rpisquare-agent on your RPis

rpisquare-agent is a module to install on each Raspberry Pi where you want to control devices remotely. It is composed of the rpi-io and socket.io modules, as well as glue software, to perform the following functions:.

  • Device identification.
  • Secure communication with the API server
  • Online presence
  • I/O config sync
  • Remote command Exec
  • Remote console notification

See GitHub repo for detailed documentation.

④ Register your remote devices and test your peripherals on (RPi)² app

When your RPis are set up with rpisquare-agent, you have then to declare them in app.rpisquare.com to be able to control them remotely. The process is straightforward:

  1. Check that your Raspberry Pi devices configured with rpisquare-agent are up and running and connected to Internet.
  2. Signup/Signin to app.rpisquare.com with a valid email address.
  3. Register each device thanks to its Serial Number.
  4. Define your GPIOs for each device
  5. Test yours GPIOs directly from the app and read results from the embedded console.
rpisquare app
rpisquare app overview

⑤ Control peripherals from your project using rpisquare-sdk

You can now control your peripherals from any remote project using the rpisquare-sdk and execute commands as easily as a local device. See GitHub repo for detailed documentation.

Support

For any type of support, please use the various communications means in GitHub repositories.

Acknowledgments and call for contributions

Specials thanks to all contributors of Open Source technologies integrated in (RPi)².

I look for users who have requirements about RPi peripherals not yet managed by (RPi)² in order to extend the scope of the solution.

Also, any developer interested in porting rpisquare-sdk to languages other than JavaScript would be welcome 😀

About

My name is Guillaume DORBES. After a career in IT, telecommunications and security I am now retired but still passionate about technology, particularly robotics, for which I have a project requiring real-time remote control.

Rather than developing a custom solution, I preferred to create an open infrastructure and share it with as many people as possible.

That's how (RPi)² was born. Over time, it will be enhanced with support of new peripherals based on my requirements and those expressed in the GitHub repositories that comprise it.