Skip to content

Control WS2811 indexable led strip over WiFi using a self hosted web page

Notifications You must be signed in to change notification settings

AguilarLagunasArturo/xmas-pi-led-strip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PI Led Strip

Use a Raspberry PI Zero to control WS2811 indexable led strip over WiFi using a self hosted web page.

Demo

Controlling 100 leds through a local hosted webpage.

WebTree

Materials

  • Raspberry PI Zero W
  • 5V 6A Power Supply
  • LED Pixel Module WS281
  • Breadboard
  • Wrires

Setup

Wriring

Wiring

Raspberry PI Configuration

Enable SPI through the GUI or directly set in the rpi configuration file.

Dependencies

Install dependencies to control WS2811 led strip.

pip install Flask
pip install rpi-ws281x
pip install adafruit-circuitpython-neopixel

Service

The following block is a service configuration file (service_name.service) example. ExecStart must be an executable program, you can set it up like this: sudo chmod +x program.py.

[Unit]
Description=Service description

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/Github/repo/main
ExecStart=/home/pi/Github/repo/main/./program.py
TimeoutSec=45s
Restart=always
RestartSec=20s

[Install]
WantedBy=multi-user.target

Here are some useful commads to set up the service vonfigured below.

# Symlink the service configuration to the default service location.
sudo ln -s /home/pi/Github/repo/services/service_name.service /etc/systemd/system

# Enable service (starts service automatically)
sudo systemctl enable service_name

# Disable service
sudo systemctl disable service_name

# Start service
sudo systemctl start service_name
sudo systemctl status service_name

# Stop service
sudo systemctl stop service_name
sudo systemctl status service_name

# Show services journal
sudo journalctl -f

References