LED Lights controlled by a Raspberry Pi.
Blog Post: https://jacobsayles.com/2020/09/28/aha2/
- Raspberry Pi (Original Model A in this case)
- 1 Meter, 32 LED Strip LPD8806: https://www.adafruit.com/product/306
- 2 LED string lights: https://www.amazon.com/Sanniu-Operated-Christmas-Centerpiece-Decoration/dp/B072NH2FQ1
- Seperate USB power adapters for Pi and LEDs
Wire up the led string lights using an NPN transistor to connect the GPIO and the 5v rail. https://elinux.org/RPi_GPIO_Interface_Circuits
sudo apt-get install apache2 libapache2-mod-wsgi-py3
sudo ln -s ~lightpi/LightPi/conf/apache2/lightpi.conf /etc/apache2/sites-enabled
The temperature/humidity sensor uses a Seeed Studio Grove DHT22 module and thus the Grove base platform needs to be installed. For detailed information: Grove Wiki
curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
- or -
git clone https://github.com/Seeed-Studio/grove.py
cd grove.py
sudo pip3 install .
The step to setup Grove Sensors installs python3 and python3-pip but just to be thorough I'm including those steps here too.
sudo apt install python3 python3-pip
pip3 install pipenv --user
pipenv install --three
There is a startup script (start_webapp.sh) that simply starts a tmux session (webapp) and fires up pipenv and flask. To see the output, you need to attach to the tmux sesson. To cancel, attach and hit Ctrl-C.
tmux attach -t webapp
To start the webapp but not run it through tmux, run the following:
pipenv run start_webapp
A simple way to make sure the webapp is running upon reboot is to install a crontab.
crontab -e
@reboot cd LightPi; ./start_webapp.sh


