Skip to content

WS2811 leds driver with REST API

License

Notifications You must be signed in to change notification settings

ptrre/ws2811-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RPI WS2811 REST API

WS2811 leds driver with REST API based on Flask.

RPi WS281x Python: https://github.com/rpi-ws281x/rpi-ws281x-python

Installation

  1. Install requirement packages

    $ sudo apt update
    $ sudo apt install python3-venv
  2. Clone the repo

    $ git clone https://github.com/ptrre/ws2811-rest
  3. Run setup.sh script

    $ cd ws2811-rest
    $ chmod +x setup.sh
    $ ./setup.sh

API

[IP_ADDRESS]:8080/enable/n

n = 0 -> turn off leds
n = 1 -> turn on leds

[IP_ADDRESS]:8080/scene/id

Activate scene number id.

[IP_ADDRESS]:8080/state/get

Return the active scene and leds state.

[IP_ADDRESS]:8080/scenes/get

Return parameters of all scenes.