Skip to content

brunopk/sc-rpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strip Controller Raspberry

Receives commands from the sc-master using the SCP protocol, process them and convert it to signals for any W2812B LED strip, using the rpi_ws281x library. Runs on the Raspberry Pi 3 with Python 3.7 or 3.8 .

Starting the server

  1. Create a virtual environment (venv) if it's not created yet.
  2. Activate the venv: source <path of the venv>/bin/activate.
  3. Go to src folder: cd src
  4. Give execution permissions to the main script: chmod +x main.py
  5. Start the main script: './main.py'

Creating a virtual environment (venv)

python3 -m venv <path of the venv>

or

virtualenv -m <path to the python interpreter> <path of the venv>

Logging

By default, the server logs on the sc-rpi.log file (on the root folder) and also in console. To disable console logging, remove the console property on the configuration file config.ini.

Running automatic tests

  1. Create a virtual environment (venv) if it's not created yet.
  2. Activate the venv: source <path of the venv>/bin/activate.
  3. Go to src folder: cd src
  4. Invoke unittest: python -m unittest discover

Building the circuit

  1. With level shifter conversor:

GitHub Logo

More information: https://tutorials-raspberrypi.com/connect-control-raspberry-pi-ws2812-rgb-led-strips/

  1. Without level shifter conversor: GitHub Logo More information: https://core-electronics.com.au/tutorials/ws2812-addressable-leds-raspberry-pi-quickstart-guide.html

Future improvements

  • Timout functionality in case of no receiving commands.
  • Automatic stress testing to send multiple commands in a short period of time.
  • Document errors
  • Differentiate errors (return bad request, conflict, etc)

Links

About

Part of the SC project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages