Skip to content

Add ons

Calin Crisan edited this page Dec 29, 2022 · 5 revisions

About

Add-ons are Python packages that can be installed along with qToggleServer to extend its functionality. Add-ons usually provide drivers for peripherals or bridges between qToggleServer and other services.

Official Add-ons

You can browse the add-ons that are maintained by the qToggle team here.

Installation

Installing add-ons is just like installing any other Python package, using pip.

A few remarks:

  • If you installed qToggleServer system-wide, as root, you'll have to run the following commands using sudo.
  • If you installed qToggleServer in a virtual environment, you'll have to activate it first.
  • The pip command may default to Python 2.x on your system; in that case, you'll need to use pip3.

Each add-on has specific instructions on how to configure and use it. After installation, just follow the add-on instructions and configure it as indicated.

Installing From PyPI

If the add-on package is public, it most likely is present on the PyPI public package index. If that is the case, run:

$ pip install <package>

For example, the following command installs qtoggleserver-rpigpio from PyPI:

$ pip install qtoggleserver-rpigpio

Installing From URL

If the package is located on a remote server, at a certain URL, run:

$ pip install <url>

For example, the following command installs qtoggleserver-rpigpio from a given URL:

$ pip install https://github.com/qtoggle/qtoggleserver-rpigpio/archive/version-1.0.2.tar.gz

Installing From Git

If you want to install a package corresponding to a specific branch or tag in a Git repository, use:

$ pip install git+ssh://git@your-git-server.com/path/to/repo.git@version

Or, if you want to use HTTP instead of SSH, run:

$ pip install git+https://your-git-server.com/path/to/repo.git@version_or_tag

For example, the following command installs qtoggleserver-rpigpio from GitHub, at version 1.0.2:

$ pip install git+https://github.com/qtoggle/qtoggleserver-rpigpio.git@version-1.0.2

Installing From Local Archive

If you have the package archive file locally, on your filesystem, run:

$ pip install /path/to/package.tar.gz

For example, the following command installs qtoggleserver-rpigpio from a local archive:

$ pip install /home/user/Downloads/qtoggleserver-rpigpio-1.0.2.tar.gz

Creating New Add-ons

If you want to create your own add-on, whether you want to publish it or keep it for yourself, you should start by setting up a development environment.

The next step would be writing a port driver or writing a peripheral driver.

When you're done with the local development, you should package your add-on so that you can distribute and install it.