Installation

Stable release

To install rpi-ws281x mock, run this command in your terminal:

$ pip install rpi_ws281x_mock

This is the preferred method to install rpi-ws281x mock, as it will always install the most recent stable release.

If you don’t have pip installed, this Python installation guide can guide you through the process.

From sources

The sources for rpi-ws281x mock can be downloaded from the Github repo.

You can either clone the public repository:

$ git clone git://github.com/HarmvZ/rpi_ws281x_mock

Or download the tarball:

$ curl -OJL https://github.com/HarmvZ/rpi_ws281x_mock/tarball/master

Once you have a copy of the source, you can install it with:

$ python setup.py install

In a docker container

You can also install this library into a docker container. This allows you to build a development/testing environment for applications using rpi_ws281x.

Example Dockerfile

# Pull Raspberry Pi 3 image
FROM balenalib/raspberrypi3-debian-python:latest
# Install python and update
RUN apt-get update && apt-get install -y python3 python3-dev python3-pip python3-virtualenv

# Activate virtualenv
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m virtualenv --python=/usr/bin/python3 $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/BIN:$PATH"

# Install rpi_ws281x_mock
RUN python3 -m pip install rpi_ws281x_mock