A light control system for heavy meta, an art car headed to burning man.
export FLASK_APP=/home/pi/art-car/src/api.py
pipenv shell
flask run --host=0.0.0.0
You should see some ouput saying "* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)"
Note! On a new raspberry pi you'll probably need to make sure the OS is installed and ssh is enabled
ping raspberrypi.local
nmap -sn 192.168.1.0/24
ssh pi@<raspi ip>
sudo apt-get install libasound-dev portaudio19-dev python3-pyaudio python3-numpy
python3 -m pip install --user pipenv
sudo apt install libatlas3-base
pipenv lock --clear
pipenv install numpy
pipenv shell
pip install -U MarkupSafe
mkdir ./art-car
cd ./art-car
pipenv update && pipenv install
scp -rp ./* pi@<raspi ip>:/home/pi/art-car
sudo cp /home/pi/art-car/art-car.service /lib/systemd/system/art-car.service
sudo chmod 644 /lib/systemd/system/art-car.service
sudo chmod 777 /home/pi/art-car/run.sh
sudo systemctl daemon-reload
sudo systemctl enable art-car.service
sudo reboot
You should now see lights going crazy when the raspberry pi starts. To control the service, on the raspberry pi, use systemd: To stop:
sudo systemctl stop art-car.service
To restart:
sudo systemctl restart art-car.service
To view the logs, use journalctl:
journalctl -u art-car.service
note, pyaudio depends on portaudio, a lower level library. To install on a mac:
brew install portaudio
Using pipenv, setup your dev environment with all the required libs:
pipenv install --dev
This process really sucks. You'll need an internet connection, phone and have to install the app. I do not have alot of confidence in this process. If light strips need to be reset often, it will be challenging without an internet connection because of the dependence on the app during this process.
If you're on android, you'll need to turn on flight mode to make sure your cellular connection does not conflict with the light strip's wifi bootstrapping process.
To setup each strip: