Control NeoPixel LEDs over HTTP from a Raspberry Pi.
Follow these steps to set up your Raspberry Pi and control NeoPixel LEDs:
-
Get a Raspberry Pi and install Raspberry Pi OS. For detailed instructions, refer to the Official RPi Instructions.
-
The Raspberry Pi Imager will give you several options for which operating system to install. Choose Raspberry Pi OS 64 bit (which should be the first one)
-
Complete all the setup/installation steps and reboot when prompted.
- Connect to a Wi-Fi network or plug in an Ethernet cable.
-
Boot up the Pi and open a terminal. You can use the default working directory or create a custom one for better organization:
mkdir foldername cd foldername
-
Update your Pi:
sudo apt-get update sudo apt-get upgrade
-
Install Node.js and GitHub CLI:
sudo apt-get install npm gh
-
Clone the repo:
gh repo clone bean-frog/pi-neopixel
-
Go to the directory:
cd pi-neopixel
-
Install the necessary packages:
npm install
-
Begin the program:
sudo node index.js
Note: This program requires
sudo
privileges to access the Pi's GPIO pins.
-
Once started, the program shouls output 3 lines containing the port, local address, and network address. To access the web GUI, you can:
-
On other devices on the same network: Enter the local ip and port (last of the 3 lines).
-
On the Pi’s browser: Use the localhost address (second of the 3 lines).
-
Remember to include the port number (this will be
:3000
unless you modified the code). If you just copy the URL from the output, it will already be there.
-