Code Monkey home page Code Monkey logo

tinypilot's Introduction

TinyPilot

CircleCI License

Overview

Turn your Raspberry Pi into a browser-based KVM.

TinyPilot demo

Pre-requisites

  • Raspberry Pi OS Stretch or later
  • python3-venv

Hardware requirements

See "TinyPilot: Build a KVM Over IP for Under $100" for a more detailed tutorial on how to assemble these parts to create a TinyPilot.

Simple installation

The following installation steps:

  • Create a service account for TinyPilot with limited priviliges.
  • Install TinyPilot as a systemd service so it runs automatically on every boot.
  • Install TinyPilot's dependencies.

From your Raspberry Pi device, run the following commands:

curl -sSL https://raw.githubusercontent.com/mtlynch/tinypilot/master/quick-install | bash -
sudo reboot

When your Pi reboots, you should be able to access TinyPilot by visiting your Pi hostname in the browser. For example, if your device is named raspberrypi:

Remote installation

If you have Ansible installed on your local machine, you can configure TinyPilot on a Raspberry Pi device using the TinyPilot Ansible role. To configure TinyPilot remotely, run the following commands from your Ansible control node:

PI_HOSTNAME="raspberrypi" # Change to your pi's hostname
PI_SSH_USERNAME="pi"      # Change to your Pi username

# Install the TinyPilot Ansible role
ansible-galaxy install mtlynch.tinypilot

# Create a minimal Ansible playbook to configure your Pi
echo "- hosts: $PI_HOSTNAME
  roles:
    - role: mtlynch.tinypilot" > install.yml

ansible-playbook \
  --inventory "$PI_HOSTNAME", \
  --user "$PI_SSH_USERNAME" \
  --ask-pass \
  --become \
  --become-method sudo \
  install.yml

ansible \
  "$PI_HOSTNAME" \
  -m reboot \
  --inventory "$PI_HOSTNAME", \
  --user "$PI_SSH_USERNAME" \
  --ask-pass \
  --become \
  --become-method sudo

After running these commands, you should be able to access TinyPilot through a web browser at:

Developer installation

If you're interesting in contributing to TinyPilot, follow these instructions to install the required developer packages in your development environment:

python3.7 -m venv venv
. venv/bin/activate
pip install --requirement requirements.txt
pip install --requirement dev_requirements.txt
hooks/enable_hooks

To run TinyPilot's build scripts, run:

./build

To enable TinyPilot's Git hooks, run:

./hooks/enable_hooks

To run TinyPilot on a non-Pi machine, run:

PORT=8000 HID_PATH=/dev/null ./app/main.py

Options

TinyPilot accepts various options through environment variables:

Environment Variable Default Description
HOST 0.0.0.0 Network interface to listen for incoming connections.
PORT 8000 HTTP port to listen for incoming connections.
HID_PATH /dev/hidg0 Path to keyboard HID interface.
CORS_ORIGIN http://${HOSTNAME} Origin from which TinyPilot should allow CORS requests.

Upgrades

The installation script is idempotent, so you can upgrade to the latest stable release of TinyPilot and its dependencies by just re-running the quick install script.

Security considerations

TinyPilot does not support authentication. You should only use TinyPilot on networks that you trust. Anyone who accesses the TinyPilot URL can shutdown or restart your Pi and type arbitrary commands into the device to which your Pi is connected.

If you need authentication, the simplest solution would be to adjust your Nginx configuration (included by default with the installation) to require HTTP Basic Authentication.

Support

If this project is useful to you, consider making a financial contribution to support its development:

See also

tinypilot's People

Contributors

mtlynch avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.