Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

FriendlyPi server

Project description


FriendlyPi is a client/server solution that allows users to remote control their Linux box. Specifically, this project’s goal is to allow the control of machine subsystems. For each subsystem, the server publishes the state and the list of actions that the user can undertake to interact with it. The client application can then be used to send the right commands to the server.

The typical use case is unmounting an external hard drive before disconnecting the USB cable on a keyboardless Linux box. In this case, the subsystem is the hard drive, the published state can be either one of “mounted” or “unmounted”, and the possible action can be either one of “Mount” or “Unmount”, depending on the state. The user can use his tablet/phone to umount the drive without the need to remote login via ssh and use the console.

FriendlyPi server is plugin based and each plugin provides the code to handle a different subsystem. Hence, the user can write his own custom modules.

Clients can use the browser to interact with the server, or use the Android app provided (downloadable from here:

Install the server

The server can be installed using easy_install:

easy_install3 FriendlyPi

NOTE: Do NOT use pip to install FriendlyPi, as the installation won’t work properly.

Setting up the server

The server requires a configuration file to start properly. The config file must be named friendlypi.json and must be located in /etc/; it defines the list of modules’ instances (i.e. the subsystems) that the server will handle. The simplest configuration is the following:

"instances": [["test1", "TestMod", {}]]

This will instruct friendlypi to instantiate the testing module on startup. The server runs on port 8080 by default. It’s possible to set a different value (e.g. 80) like this:

{ “port”: 80, “instances”: [[“test1”, “TestMod”, {}]] }

Testing the server

Once the server has been setup, start it manually. Start your preferred browser and point it to (of course replace the loopback address and the port with the real values, if different). If everything has been done properly, the browser should show you an instance of the test module running. An increment button is present and pressing it will increment the “Status” value.

Configure the MediaDevice module

The MediaDevice module allows users to remotely mount/umount mount points. In order for this to work, /etc/fstab must be configured properly and the Unix user that runs the server must have the proper permissions to mount/umount the filesystem, Assuming the mountpoint is “/media/usb”, friendlypi.json must look like this:

"instances": [["media1", "MediaDevice", {"path": "/media/usb"}]]

“media1” is the instance name and it must be unique. “MediaDevice” is the module name and the last parameter is a map containing the configuration. It’s possible to configure multiple mount points, like this:

"instances": [["media1", "MediaDevice", {"path": "/media/usb"}],
              ["media2", "MediaDevice", {"path": "/media/usb2"}]]

Configure the ServiceManager module

The ServiceManager module allows users to remotely start/stop services. In order for this to work the Unix user that runs the server must have the proper permissions to execute the “service” command, like this one:

service samba start

Configuring a service manager, requires two things: the service name (e.g. “samba”) and the pid file (e.g. “/var/run/samba/”). A valid configuration would look like this:

"instances": [["service1", "ServiceManager", {"service": "samba", "pid_file": "/var/run/samba/"}]]

It’s possible to configure multiple service managers, in the very same way described in the MediaDevice case


This software is in early alpha stage and doesn’t implement any authentication mechanism, for now. Do NOT run the server on public networks. Use at your own risk.



  • Server port is now configurable
  • Added ServiceManager module

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for FriendlyPi, version 0.1d1
Filename, size File type Python version Upload date Hashes
Filename, size FriendlyPi-0.1d1.tar.gz (19.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page