# RGB_fill_light

DIY RGB fill light for photography 

### Usage
There are 3 modes to this fill light and by pressing the MODE button, you can cycle through the 3 modes below.
1. White Mode
2. RGB Channel Mode
3. Color Preset Mode

For each of the settings (e.g brightness), there is a max / min value. When the max value is reached, the control LED will blink in reddish white color 5 times. When the min value is reached, the control LED will blink in blueish white color 5 times. 

#### White Mode
By pressing the + and - button, you adjust the color temperature of the light. The brightness button can be pressed and the + and - button will then be used to adjust the brightness of the fill light.

If you see the control LED (the WS2812B on top of the 4 buttons) are white, you are in temperature setting mode. If the control LED is in yellow, you are in brightness mode.

*Note that the temperature value is not accurate at low brightness level due to limitations of RGB calculation algorithm. *

#### RGB Channel Mode
In this mode, you can adjust the channel brightness independently. Press the brightness button to switch between RGB channels (R -> G -> B, the current adjusting channel is shown on the control LED)

When + or - is pressed, the brightness of that channel will be changed. Note that in this mode, the max brightness is not limited per channel. **Setting max brightness in all channel might results in overheat and the fill light will force shutoff as a result. If you need to increase a channel brightness, consider lowering the other 2 channel brightness instead,**

#### Color Preset Modes
In this mode, you can cycle through the preset color palletes.

### WiFi Control
If you need wireless control of the fill light, press and hold "MODE" button when switching on the light. Next, follow the steps below to setup WiFi access to the light

1. Hold the "MODE" button while turning on the light
2. Release the Mode button. Use your phone WiFi discovery function and look for a WiFi AP named "FL1010-RGB"
3. Connect to the AP
4. Setup your home / environment WiFi account following the on-screen instruction
5. Wait for the WiFi ("FL1010-RGB") auto disconnect. 
6. Check if the WiFi name "FL1010-RGB" still exists. If no, that means the setup is completed

The fill light do not have a web interface. You will need some python script (or any scripting language that support HTTP GET requests) or a browser to control the device. In general, the steps should be similar to the list below.

1. Discover the device IP address (e.g. look up a newly connected device in your router)
2. Connect to the device using your browser or scripts
3. Use one of the following API to control the light

```
/api/rgb?r=255&g=255&b=255
    //R = Red channel value, 0 - 255
    //G = Green channel value, 0 - 255
    //B = Blue channel value, 0 - 255
    
/api/temp?k=4500&b=255
    //K = Color temperature
    //B = Brightness, 0 - 255
    
/api/off
    //Turn off all LEDs
```

For example, this will set the light to white color at full brightness at color temperature 4500k
```
http://192.168.1.101/api/temp?k=4500&b=255
```