Skip to content

A Python utility for Raspberry Pi to change the color of phillips hue lightstrip

License

Notifications You must be signed in to change notification settings

wcchristian/pi-tv-colorchange

Repository files navigation

[Work in Progress] Raspberry Pi / Hue Lightstrip Camera Color Changer

Description

Usage

This program was written to be run on a raspberry pi however I did debug it on a macbook pro using the webcam and that seemed to work fine as well

Setup

Hardware Setup

  1. It may be wise to give your hue bridge a static ip on your network

Setting up Raspbian SD Card

  1. Download and install raspbian to an sd card using etcher or some other tool.
  2. Mount the sd on your computer. In the root create a file named ssh
  3. Create another file in the root of the card named wpa_supplicant.conf and add the following snippet. Change your ssid to your network name and psk to the password for your network.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid=""
    psk=""
    key_mgmt=WPA-PSK
}
  1. Put the sd card in the pi and plug it in so it boots.

Pi Setup

  1. ssh into the pi with ssh pi@raspberrypi.local the default password is raspberry
  2. run sudo raspi-config
  3. Enable VNC, change the password, and change the hostname of the pi
  4. Exit ssh

VNC Work

  1. Log into the pi via VNC
  2. Take a sample image via command line using raspistill -o ~/Desktop/test.jpg
  3. Make sure the image appears.
  4. Simply copy this repo to the pi using vnc viewer OR cloning the repo on the pi itself.

Configure The Program

  1. In the directory of the program, run pip3 install -r requirements.txt
  2. Using the info from config description below. Setup config.py for your configuration.
  3. Run the program in config mode (Debug = True, Blink_on = False)
  4. Make sure that the image lines up with the display you will be sampling
  5. Turn (Debug = False, Blink_on = False) d

Setup Blynk

  1. Download Blynk from the app store
  2. Create a new project and copy the key into config.py
  3. Add a button and set it up with the virtual pin in your configuration
  4. Turn blink_on = True

Usage

This program was written to be run on a raspberry pi however I did debug it on a macbook pro using the webcam and that seemed to work fine as well

If you have the raspberry pi gui running run the program in debug mode and adjust / re-run the program config as needed.

If you are not using the raspberry pi gui, set debug_gui = False in the config.py file. Then run the program. This should take an image and then exit. View the image and then continue to run the program and tweak the config as needed until the settings are to your liking

Config Description

Development

Using Docker

docker run --rm -it --name pi-tv-colorchange $(docker build -q .)

Attribution

About

A Python utility for Raspberry Pi to change the color of phillips hue lightstrip

Topics

Resources

License

Stars

Watchers

Forks